Socket
Socket
Sign inDemoInstall

piopiy

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    piopiy

PIOPIY REST API client for nodejs,It support Voice,SMS and more.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
445 kB
Created
Weekly downloads
 

Readme

Source

PIOPIY NodeJS SDK

The Node.js SDK is used to integrate communications into your Node.js applications using the PIOPIY REST API. Using the SDK, you will be able to make voice calls and can control your call flows.

Install

Follow the below installation instructions

Prerequisites

Prerequisites for javascript web server.

  • node.js (>= v10.16.3 required)
  • npm (>= 6.9.0 required)

Installation

Install the SDK using npm

$ npm install piopiy

Authentication

In order to authenticate your app, and to make an API request, you should have an app id and secret for authentication. Find your App ID and secret in your PIOPIY dashboard

Specifiy the authentication credentials

const Piopiy = require( 'piopiy' );
const piopiy = new Piopiy( 'your_app_id', 'your_app_secret' );

Make a call

To make a call , mention the to_number, piopiy_phone_number and .

piopiy.voice.call( 
    'your_leg_a_to_number', 
    'your_piopiy_phone_number',
    'your_leg_b_to_number' 
).then( ( result  ) => {
     console.log( result  )
} ).catch( ( error ) => {
     console.log( error )
} );

To make a call using PCMO, mention the to_number, piopiy_phone_number and .

piopiy.voice.callPCMO( 
    'your_to_number', 
    'your_piopiy_phone_number',
    'your_PCMO_Object' 
).then( ( result  ) => {
     console.log( result  )
} ).catch( ( error ) => {
     console.log( error )
} );

To make a call with answer, mention the to_number, piopiy_phone_number and answer_url.

piopiy.voice.make( 
    'your_to_number', 
    'your_piopiy_phone_number',
    'your_answer_url' 
).then( ( result  ) => {
     console.log( result  )
} ).catch( ( error ) => {
     console.log( error )
} );

Hold a call

To hold a call, mention the cmiuuid of the call.

piopiy.voice.hold( 
    'cmiuuid'
).then( ( result  ) => {
     console.log( result  )
} ).catch( ( error ) => {
     console.log( error )
} );

Unhold a call

To unhold a call, mention the cmiuuid of the call.

piopiy.voice.unhold( 
    'cmiuuid'
).then( ( result  ) => {
     console.log( result  )
} ).catch( ( error ) => {
     console.log( error )
} );

Toggle a call

To toggle a call, mention the cmiuuid of the call.

piopiy.voice.toggle( 
    'cmiuuid'
).then( ( result  ) => {
     console.log( result  )
} ).catch( ( error ) => {
     console.log( error )
} );

Hangup a call

To hangup a call, mention the cmiuuid of the call.

piopiy.voice.hangup( 
    'cmiuuid'
).then( ( result  ) => {
     console.log( result )
} ).catch( ( error ) => {
     console.log( error )
} );

More Examples

Refer to the piopiy docs for more examples. Now create the PIOPIY account and setup the express server and test out your integration in few minutes.

Reporting issues

For any feedbacks and problems, you can open an issue on github.

Keywords

FAQs

Last updated on 19 Mar 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc