mirror of
https://github.com/donl/plivo-node.git
synced 2026-05-25 22:07:10 -06:00
35 lines
889 B
JavaScript
35 lines
889 B
JavaScript
var Plivo = require('../dist/rest/client.js');
|
|
var client = new Plivo.Client();
|
|
|
|
var createParams = {
|
|
alias:"alias",
|
|
applicationId: "applicationId",
|
|
loaId:"loaID",
|
|
number:"number"
|
|
};
|
|
|
|
var listParams = {
|
|
alias:"alias",
|
|
applicationId: "applicationId",
|
|
loaId:"loaID",
|
|
number:"number",
|
|
hostedStatus: "completed",
|
|
};
|
|
|
|
|
|
client.hostedMessagingNumber.create(createParams)
|
|
.then(function (hmn) {
|
|
console.log("\n============ created ===========\n", hmn)
|
|
return client.hostedMessagingNumber.get(hmn.hostedMessagingNumberId);
|
|
})
|
|
.then(function (hmn) {
|
|
console.log("\n============ get ===========\n", hmn)
|
|
return client.hostedMessagingNumber.list(listParams)
|
|
})
|
|
.then(function (hmns) {
|
|
console.log("\n============ list with params ===========\n", hmns)
|
|
})
|
|
.catch(function (err) {
|
|
console.log("\n============ Error :: ===========\n", err);
|
|
});
|
|
|