Comments (8)
@leggetter as I don't have a shortnumber, can you run with --debug
and post the API result?
from nexmo-cli.
Also does the API support this?
from nexmo-cli.
› nexmo insight:standard NUMBER --debug
This operation will charge your account.
Please type "confirm" to continue: confirm
{ host: 'api.nexmo.com',
port: 443,
path: '/number/lookup/json?number=NUMBER&api_key=KEY&api_secret=SECRET',
method: 'GET',
headers:
{ 'Content-Type': 'application/x-www-form-urlencoded',
accept: 'application/json' } }
response ended
Validator.response() - Error:
null
Validator.response() - Response:
{ status: 3,
status_message: 'Invalid request :: Not valid number format detected [ 45************ ]' }
End Validator.response()
/usr/local/lib/node_modules/nexmo-cli/distribution/response.js:185
this.emitter.list(response.international_format_number + ' | ' + response.country_code + ' | ' + response.current_carrier.name, response);
^
TypeError: Cannot read property 'name' of undefined
at Response.insightStandard (/usr/local/lib/node_modules/nexmo-cli/distribution/response.js:185:128)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/nexmo-cli/node_modules/easynexmo/lib/nexmo.js:257:19)
at emitNone (events.js:85:20)
at IncomingMessage.emit (events.js:179:7)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (node.js:377:13)
at process._tickCallback (node.js:401:11)
@cbetta - Will DM you the number.
from nexmo-cli.
@leggetter the number is in the debug...
from nexmo-cli.
@leggetter Were you trying to run number insight against an SMS shortcode? (eg 89101) These type of numbers are country and sometimes even carrier specific so aren't really 'phone numbers' in the sense of the e.164 numbering plan.
Number Insight only works against e.164 numbers that you can dial/sms from ANY phone.
Also FYI LVN's are a term for the e.164 numbers that Nexmo sells for Voice and or SMS
from nexmo-cli.
{ status: 3,
status_message: 'Invalid request :: Not valid number format detected [ NUMBER ]' }
It wasn't a short code.
456***********
from nexmo-cli.
Ok this looks to be a bug with the nexmo-node library when making a request for an invalid number to the insight standard API it works when requesting insight basic (although exposing the error could be better)
BASIC:
{ host: 'api.nexmo.com',
port: 443,
path: '/number/format/json?number=441233444341324&api_key=XXX&api_secret=XXX',
method: 'GET',
headers:
{ 'Content-Type': 'application/x-www-form-urlencoded',
accept: 'application/json' } }
response ended
Validator.response() - Error:
null
Validator.response() - Response:
{ status: 3,
status_message: 'Invalid request :: Not valid number format detected [ 441233444341324 ]' }
STANDARD:
{ host: 'api.nexmo.com',
port: 443,
path: '/number/lookup/json?number=441233444341324&api_key=XXX&api_secret=XXX',
method: 'GET',
headers:
{ 'Content-Type': 'application/x-www-form-urlencoded',
accept: 'application/json' } }
response ended
Validator.response() - Error:
null
Validator.response() - Response:
{ status: 3,
status_message: 'Invalid request :: Not valid number format detected [ 441233444341324 ]' }
End Validator.response()
/usr/local/lib/node_modules/nexmo-cli/distribution/response.js:185
this.emitter.list(response.international_format_number + ' | ' + response.country_code + ' | ' + response.current_carrier.name, response);
^
TypeError: Cannot read property 'name' of undefined
at Response.insightStandard (/usr/local/lib/node_modules/nexmo-cli/distribution/response.js:185:128)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/nexmo-cli/node_modules/easynexmo/lib/nexmo.js:257:19)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:913:12)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
from nexmo-cli.
So having discussed this with @cbetta its not a nexmo-node issue its the CLI not handling the error nicely, so this needs to be fixed in the CLI.
If it seens a status other than 0 returned it should print the contents of the status_message to the screen, this should work in both normal and verbose modes
from nexmo-cli.
Related Issues (20)
- "exp" should be a number of seconds when generating JWTs
- Recreating a user with the same name returns an irrelevant error message.
- Better error message for failed app link HOT 1
- Support partial app IDs HOT 4
- Display App Names in Verbose Numbers List
- npm `prepublish` scripts are deprecated
- Support host overriding for both api.nexmo and rest.nexmo
- nexmo ml <conversation-id> doesn't show member id HOT 1
- nexmo cc cli issue HOT 1
- [Feature] list users in a nexmo application
- Returns empty list of members in a conversation when there are actual members HOT 2
- Error when creating messages applications HOT 2
- Prompt when creating a new app in a folder already hosting a .nexmo-app
- Define nexmo setup structure in error message HOT 1
- price:country fails HOT 2
- Windows Powershell - "running scripts is disabled on this system" when running `nexmo`
- Creation of application fails when only messages capability is needed. HOT 2
- Hide API_SECRET by default HOT 1
- Error in Validator.Response : Method Failed HOT 2
- nexmo-2.9.1.tgz: 8 vulnerabilities (highest severity is: 9.8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nexmo-cli.