{"_id":"@amwork/voximplant-apiclient-nodejs","name":"@amwork/voximplant-apiclient-nodejs","dist-tags":{"latest":"2.3.0-f"},"versions":{"2.3.0-f":{"name":"@amwork/voximplant-apiclient-nodejs","version":"2.3.0-f","description":"Voximplant API client library with modified constructor","main":"dist/index.js","scripts":{"prebuild":"rimraf dist ","build":"tsc"},"repository":{"type":"git","url":"git+https://gitlab.com/amwork/voximplant-api-client.git"},"homepage":"https://voximplant.com/","bugs":{"url":"https://github.com/voximplant/apiclient-nodejs/issues","email":"support@voximplant.com"},"author":{"name":"Zingaya Inc.","email":"info@voximplant.com","url":"https://voximplant.com"},"license":"Apache-2.0","devDependencies":{"@types/node":"11.11.5","rimraf":"2.7.1","typescript":"3.9.10"},"dependencies":{"axios":"0.21.4","form-data":"2.5.1","jsonwebtoken":"8.5.1"},"_id":"@amwork/voximplant-apiclient-nodejs@2.3.0-f","gitHead":"6a639c0ea6bbf10493e0d478667ed33bb7107fa8","types":"./dist/index.d.ts","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-tveFRjiAoox4fPed2kSyzVecgofueYuaUkZyB5w8AEGC3ooG4mzH0QNkLB8swNFRCEotY0RpvGF7VOIOwuznnQ==","shasum":"39c4354ce2586a97283b4df8509551ad1f8d14a9","tarball":"https://registry.npmjs.org/@amwork/voximplant-apiclient-nodejs/-/voximplant-apiclient-nodejs-2.3.0-f.tgz","fileCount":219,"unpackedSize":1887244,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHED+6NZeSZkJ9fSXKEoY0uhRNQm3yCsnRUOLG5E60XGAiEApLqhasDNedxeOvQ6aOJNuP60OJwfGumc1GeICvn7Mio="}]},"_npmUser":{"name":"amwork","email":"amworkstartup@gmail.com"},"directories":{},"maintainers":[{"name":"amwork","email":"amworkstartup@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/voximplant-apiclient-nodejs_2.3.0-f_1697637598055_0.08609118203784849"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-18T13:59:57.941Z","2.3.0-f":"2023-10-18T13:59:58.431Z","modified":"2023-10-18T13:59:58.678Z"},"maintainers":[{"name":"amwork","email":"amworkstartup@gmail.com"}],"description":"Voximplant API client library with modified constructor","homepage":"https://voximplant.com/","repository":{"type":"git","url":"git+https://gitlab.com/amwork/voximplant-api-client.git"},"author":{"name":"Zingaya Inc.","email":"info@voximplant.com","url":"https://voximplant.com"},"bugs":{"url":"https://github.com/voximplant/apiclient-nodejs/issues","email":"support@voximplant.com"},"license":"Apache-2.0","readme":"# Voximplant API client library\n\n#### Version 2.3.0\n\n## Prerequisites\n\nIn order to use Voximplant Node.js SDK, you need the following:\n\n1. A developer account. If you don't have one, [sign up here](https://voximplant.com/sign-up/).\n1. A private API key. There are 2 options to obtain it:\n    1. Generate it in the [Voximplant Control panel](https://manage.voximplant.com/settings/service_accounts)\n    1. Call the [CreateKey](https://voximplant.com/docs/references/httpapi/managing_role_system#createkey) HTTP API\n       method with the\n       specified [authentication parameters](https://voximplant.com/docs/references/httpapi/auth_parameters). You'll\n       receive a response with the **result** field in it. Save the **result** value in a file (since we don't store the\n       keys, save it securely on your side).\n1. Node.js >= 11\n\n## How to use\n\nGo to your project folder and install the SDK using `npm`:\n\n```bash\nnpm i --save @voximplant/apiclient-nodejs\n```\n\nThen import the SDK in your script\n\n```js\nconst VoximplantApiClient = require('@voximplant/apiclient-nodejs').default;\n```\n\nNext, specify the path to the file with the **result** value either in the constructor or using the environment.\n\n**constructor**:\n\n```js\nconst client = new VoximplantApiClient('/path/to/credentials.json');\n```\n\n**env**:\n\n```bash\nexport VOXIMPLANT_CREDENTIALS=/path/to/credentials.json\n```\n\n## Examples\n\n### Start a scenario\n\n```js\nconst VoximplantApiClient = require('@voximplant/apiclient-nodejs').default;\nconst client = new VoximplantApiClient();\nclient.onReady = function () {\n  // Start the scripts from the account.\n  client.Scenarios.startScenarios({ruleId: '1', scriptCustomData: 'mystr'})\n    .then((ev) => console.log(ev))\n    .catch((err) => console.error(err));\n};\n```\n\n### Send an SMS\n\n```js\nconst VoximplantApiClient = require('@voximplant/apiclient-nodejs').default;\nconst client = new VoximplantApiClient();\nclient.onReady = function () {\n  // Send the SMS message with text \"Test message\" from the phone number 447443332211 to the phone number 447443332212.\n  client.SMS.sendSmsMessage({\n    source: '447443332211',\n    destination: '447443332212',\n    smsBody: 'Test message',\n  })\n    .then((ev) => console.log(ev))\n    .catch((err) => console.error(err));\n};\n```\n\n### Get a call history item\n\n```js\nconst VoximplantApiClient = require('@voximplant/apiclient-nodejs').default;\nconst client = new VoximplantApiClient();\nclient.onReady = function () {\n  // Get the first call session history record from the 2012-01-01 00:00:00 UTC to the 2014-01-01 00:00:00 UTC\n  client.History.getCallHistory({\n    fromDate: new Date('2012-01-01 00:00:00 GMT'),\n    toDate: new Date('2014-01-01 00:00:00 GMT'),\n    count: '1',\n    timezone: 'Etc/GMT',\n  })\n    .then((ev) => console.log(ev))\n    .catch((err) => console.error(err));\n};\n```\n","readmeFilename":"README.md"}