Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plivo numbers.buy #144

Closed
apex2060 opened this issue Feb 9, 2020 · 1 comment
Closed

Plivo numbers.buy #144

apex2060 opened this issue Feb 9, 2020 · 1 comment

Comments

@apex2060
Copy link

apex2060 commented Feb 9, 2020

I am getting an error when attempting to purchase a new number through the node library:
All variables exist and are correct. I've tried just the number

let plivo = new Plivo.Client(process.env.plivoId, process.env.plivoToken);
plivo.numbers.buy(number.id).then(r=>{

let plivo = new Plivo.Client(process.env.plivoId, process.env.plivoToken);
plivo.numbers.buy(number.id, process.env.plivoApp).then(r=>{

returns an error:
2020-02-09T01:06:16.182390+00:00 app[web.1]: Error: {"api_id":"5f595aa6-4ad8-11ea-a859-0242ac110003","error":"not found"}
2020-02-09T01:06:16.182401+00:00 app[web.1]: at ResourceNotFoundError.PlivoRestError (/app/node_modules/plivo/dist/utils/exceptions.js:19:113)
2020-02-09T01:06:16.182401+00:00 app[web.1]: at new ResourceNotFoundError (/app/node_modules/plivo/dist/utils/exceptions.js:31:127)
2020-02-09T01:06:16.182402+00:00 app[web.1]: at Request._callback (/app/node_modules/plivo/dist/rest/request.js:80:20)
2020-02-09T01:06:16.182402+00:00 app[web.1]: at Request.self.callback (/app/node_modules/request/request.js:185:22)
2020-02-09T01:06:16.182402+00:00 app[web.1]: at Request.emit (events.js:223:5)
2020-02-09T01:06:16.182403+00:00 app[web.1]: at Request. (/app/node_modules/request/request.js:1161:10)
2020-02-09T01:06:16.182403+00:00 app[web.1]: at Request.emit (events.js:223:5)
2020-02-09T01:06:16.182403+00:00 app[web.1]: at IncomingMessage. (/app/node_modules/request/request.js:1083:12)
2020-02-09T01:06:16.182403+00:00 app[web.1]: at Object.onceWrapper (events.js:312:28)
2020-02-09T01:06:16.182404+00:00 app[web.1]: at IncomingMessage.emit (events.js:228:7)
2020-02-09T01:06:16.182404+00:00 app[web.1]: at endReadableNT (_stream_readable.js:1185:12)
2020-02-09T01:06:16.182404+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:81:21)

@nixonsam
Copy link
Contributor

@apex2060 Looks like you're using the legacy SDK's method 'plivo.numbers.buy'. Please use the latest SDK.
You can find the code snippet here and you can install the SDK by referring to the instructions here

Feel free to contact our support team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants