nexmo_api_specification 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8f9d62b6cc71ba0a14eba4ba83d6318da4a6b29
4
- data.tar.gz: a5e22b5126eadd14a44eef0a0758030fcfbc1cb2
3
+ metadata.gz: 57c8372d49a0600ba11950ec4ddfabe67ba21d1e
4
+ data.tar.gz: 045e0b501a1673c7b1636757e1de9006223569d4
5
5
  SHA512:
6
- metadata.gz: 04af3bfe700d83719b6a08e507052e5422c9d2deb414ad4f192d97cfb000a6be444deef4907d5c0b2666e74d976124d5d03354f687d478bafd9e55115bc4f58d
7
- data.tar.gz: 54daa61f9b58469c3fb59593eb187d4e27f39bfff707a9cdabff1394ecd3e4651d9a832509483873aaff3b349b6a54a7e053623435c73a83c6c18c427b536c7c
6
+ metadata.gz: '086067b66fb035103886cc8775a4e22556304746a3acce221e060c9a2bd4f9aeb740ed52bec2b29de133cb254c7c649d717a377289867e72d51b0bf1888f3866'
7
+ data.tar.gz: 458d0d8b2941039dd93044b7e6f443fd036ead54108c260743bcde353f530d49d22cce93d246856295705b7c53a99d4125f8929afc41e8c4e82bd362903c44db
@@ -356,8 +356,7 @@ x-groups:
356
356
  description: >-
357
357
  A conversation is a shared core component that Nexmo APIs rely on. Conversations happen over multiple mediums and and can have associated Users through Memberships.
358
358
  schema:
359
- application/json:
360
- $ref: '#/components/schemas/ConversationFull'
359
+ $ref: '#/components/schemas/ConversationFull'
361
360
  user:
362
361
  name: "User"
363
362
  order: 2
@@ -1,685 +1,995 @@
1
- ---
2
- openapi: 3.0.0
3
- servers:
4
- - url: 'https://api.nexmo.com/ni'
5
- info:
6
- title: Nexmo Number Insight API
7
- version: 1.0.0
8
- description: >-
9
- Nexmo's Number Insight API provides details about the validity, reachability and roaming status of a phone number, as well as giving you details on how to format the number properly in your application. There are three levels of Number Insight API available: Basic, Standard and Advanced. The advanced API is available asynchronously as well as synchronously. Getting information about a number with Nexmo's Number Insight API is easy. Simply [sign up for an account](https://dashboard.nexmo.com/sign-up).
10
- contact:
11
- name: Nexmo.com
12
- email: devrel@nexmo.com
13
- url: https://developer.nexmo.com/
14
- x-twitter: Nexmo
15
- termsOfService: 'https://www.nexmo.com/terms-of-use'
16
- license:
17
- name: 'The MIT License (MIT)'
18
- url: 'https://opensource.org/licenses/MIT'
19
- x-logo:
20
- url: 'https://twitter.com/Nexmo/profile_image?size=original'
21
- x-apiClientRegistration: 'https://dashboard.nexmo.com/sign-up'
22
- externalDocs:
23
- url: https://developer.nexmo.com/api/number-insight
24
- x-sha1: 081f6d985e2e4a75586da1654fde880a96885405
25
- security:
26
- - apiKey: []
27
- apiSecret: []
28
- tags:
29
- - name: Request
30
- description: 'Ask for information about a phone number'
31
- paths:
32
- '/{level}/{format}':
33
- parameters:
34
- - $ref: '#/components/parameters/level'
35
- - $ref: '#/components/parameters/format'
36
- get:
37
- operationId: getNumberInsight
38
- summary: ask for information about a phone number
39
- tags:
40
- - Request
41
- parameters:
42
- - $ref: '#/components/parameters/number'
43
- - $ref: '#/components/parameters/country'
44
- - $ref: '#/components/parameters/cnam'
45
- - $ref: '#/components/parameters/ip'
46
- responses:
47
- '200':
48
- description: OK
49
- content:
50
- 'application/json':
51
- schema:
52
- $ref: '#/components/schemas/niResponse'
53
- 'text/xml':
54
- schema:
55
- $ref: '#/components/schemas/niResponse'
56
- '401':
57
- description: Unauthorised
58
- '/advanced/async/{format}':
59
- parameters:
60
- - $ref: '#/components/parameters/format'
61
- get:
62
- operationId: getNumberInsightAsync
63
- summary: Ask for information about a phone number
64
- tags:
65
- - Request
66
- parameters:
67
- - $ref: '#/components/parameters/callback'
68
- - $ref: '#/components/parameters/number'
69
- - $ref: '#/components/parameters/country'
70
- - $ref: '#/components/parameters/cnam'
71
- - $ref: '#/components/parameters/ip'
72
- responses:
73
- '200':
74
- description: OK
75
- content:
76
- 'application/json':
77
- schema:
78
- $ref: '#/components/schemas/niResponse'
79
- 'text/xml':
80
- schema:
81
- $ref: '#/components/schemas/niResponse'
82
- '401':
83
- description: Unauthorised
84
- callbacks:
85
- onData:
86
- '{$request.query.callback}':
87
- post:
88
- operationId: asyncCallback
89
- summary: The requested WebHook response
90
- requestBody:
91
- description: Async response payload
92
- content:
93
- application/json:
94
- schema:
95
- $ref: '#/components/schemas/niResponse'
96
- text/xml:
97
- schema:
98
- $ref: '#/components/schemas/niResponse'
99
- responses:
100
- '200':
101
- description: OK
102
- components:
103
- parameters:
104
- level:
105
- name: level
106
- in: path
107
- required: true
108
- description: 'The level of request you wish to make.'
109
- schema:
110
- type: string
111
- enum:
112
- - 'basic'
113
- - 'standard'
114
- - 'advanced'
115
- format:
116
- name: format
117
- in: path
118
- required: true
119
- description: 'The format of the response'
120
- schema:
121
- type: string
122
- enum:
123
- - 'json'
124
- - 'xml'
125
- number:
126
- name: number
127
- in: query
128
- description: 'A single phone number that you need insight about in national or international format.'
129
- example: '447700900000'
130
- schema:
131
- type: string
132
- pattern: '^[0-9-+\(\)\s]*$'
133
- country:
134
- name: country
135
- in: query
136
- example: 'GB'
137
- description: 'If a number does not have a country code or is uncertain, set the two-character country code. This code must be in ISO 3166-1 alpha-2 format and in upper case. For example, GB or US. If you set country and number is already in [E.164](https://en.wikipedia.org/wiki/E.164) format, country must match the country code in number.'
138
- schema:
139
- type: string
140
- pattern: '[A-Z]{2}'
141
- cnam:
142
- name: cnam
143
- in: query
144
- example: true
145
- description: 'Indicates if the name of the person who owns the phone number should be looked up and returned in the response. Set to true to receive phone number owner name in the response. This features is available for US numbers only and incurs an additional charge.'
146
- schema:
147
- type: boolean
148
- default: false
149
- ip:
150
- name: ip
151
- in: query
152
- example: '123.0.0.255'
153
- description: "The IP address of the user. If supplied, we will compare this to the country the user's phone is located in and return an error if it does not match."
154
- schema:
155
- type: string
156
- #pattern: TODO are IPv4 and IPv6 addresses permitted?
157
- callback:
158
- name: callback
159
- in: query
160
- example: 'https://example.com/callback'
161
- description: 'The callback URL'
162
- required: true
163
- schema:
164
- type: string
165
- format: uriref
166
- schemas:
167
- niResponse:
168
- oneOf:
169
- - $ref: '#/components/schemas/niError'
170
- - $ref: '#/components/schemas/niDetails'
171
- - $ref: '#/components/schemas/format'
172
- - $ref: '#/components/schemas/lookup'
173
- niError:
174
- type: object
175
- properties:
176
- status:
177
- $ref: '#/components/schemas/niStatus'
178
- error_text:
179
- type: string
180
- required:
181
- - status
182
- - error_text
183
- format:
184
- type: object
185
- properties:
186
- lookup_outcome:
187
- type: object
188
- properties:
189
- code:
190
- type: integer
191
- description: |
192
- Shows if all information about a phone number has been returned. Possible values:
193
- Code | Text
194
- -- | --
195
- 0 | Success
196
- 1 | Partial success - some fields populated
197
- 2 | Failed
198
- enum:
199
- - 0
200
- - 1
201
- - 2
202
- lookup_outcome_message:
203
- type: string
204
- description: 'Shows if all information about a phone number has been returned.'
205
- xml:
206
- x-text: true # see https://github.com/OAI/OpenAPI-Specification/issues/630
207
- reachable:
208
- type: string
209
- description: 'Can you call `number` now. This is applicable to mobile numbers only.'
210
- enum:
211
- - unknown
212
- - reachable
213
- - undeliverable
214
- - absent
215
- - bad_number
216
- - blacklisted
217
- request_id:
218
- type: string
219
- description: 'The unique identifier for your request. This is a alphanumeric string up to 40 characters.'
220
- maxLength: 40
221
- international_format_number:
222
- type: string
223
- description: 'The `number` in your request in International format.'
224
- local_number:
225
- type: object
226
- properties:
227
- country_code:
228
- type: string
229
- description: 'Two character country code for `number`. This is in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.'
230
- pattern: '[A-Z]{2}'
231
- xml:
232
- attribute: true
233
- country_code_iso3:
234
- type: string
235
- description: 'Three character country code for `number`. This is in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.'
236
- pattern: '[A-Z]{3}'
237
- xml:
238
- attribute: true
239
- country_name:
240
- type: string
241
- description: 'The full name of the country that `number` is registered in.'
242
- xml:
243
- attribute: true
244
- country_prefix:
245
- type: string
246
- description: 'The numeric prefix for the country that `number` is registered in.'
247
- xml:
248
- attribute: true
249
- national_format_number:
250
- type: string
251
- description: 'The `number` in your request in the format used by the country the number belongs to.'
252
- xml:
253
- x-text: true # see https://github.com/OAI/OpenAPI-Specification/issues/630
254
- error:
255
- type: object
256
- properties:
257
- code:
258
- allOf:
259
- - xml:
260
- attribute: true
261
- - $ref: '#/components/schemas/niStatus'
262
- status_message:
263
- type: string
264
- xml:
265
- x-text: true # see https://github.com/OAI/OpenAPI-Specification/issues/630
266
- lookup:
267
- type: object
268
- properties:
269
- request_id:
270
- type: string
271
- description: 'The unique identifier for your request. This is a alphanumeric string up to 40 characters.'
272
- maxLength: 40
273
- international_format_number:
274
- type: string
275
- description: 'The `number` in your request in International format.'
276
- local_number:
277
- type: object
278
- properties:
279
- country_code:
280
- type: string
281
- description: 'Two character country code for `number`. This is in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.'
282
- pattern: '[A-Z]{2}'
283
- xml:
284
- attribute: true
285
- country_code_iso3:
286
- type: string
287
- description: 'Three character country code for `number`. This is in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.'
288
- pattern: '[A-Z]{3}'
289
- xml:
290
- attribute: true
291
- country_name:
292
- type: string
293
- description: 'The full name of the country that `number` is registered in.'
294
- xml:
295
- attribute: true
296
- country_prefix:
297
- type: string
298
- description: 'The numeric prefix for the country that `number` is registered in.'
299
- xml:
300
- attribute: true
301
- national_format_number:
302
- type: string
303
- description: 'The `number` in your request in the format used by the country the number belongs to.'
304
- xml:
305
- x-text: true # see https://github.com/OAI/OpenAPI-Specification/issues/630
306
- error:
307
- type: object
308
- properties:
309
- code:
310
- allOf:
311
- - xml:
312
- attribute: true
313
- - $ref: '#/components/schemas/niStatus'
314
- status_message:
315
- type: string
316
- xml:
317
- x-text: true # see https://github.com/OAI/OpenAPI-Specification/issues/630
318
- request_price:
319
- type: number
320
- description: 'The amount in EUR charged to your account.'
321
- refund_price:
322
- type: number
323
- description: 'If there is an internal lookup error, the `refund_price` will reflect the lookup price. If `cnam` is requested for a non-US number the `refund_price` will reflect the `cnam` price. If both of these conditions occur, `refund_price` is the sum of the lookup price and `cnam` price.'
324
- remaining_balance:
325
- type: number
326
- description: 'Your account balance in EUR after this request. Not returned with Number Insight Advanced Async API.'
327
- current_carrier:
328
- description: 'Information about the network `number` is currently connected to.'
329
- $ref: '#/components/schemas/niCarrier'
330
- original_carrier:
331
- description: 'Information about the network `number` was initially connected to.'
332
- $ref: '#/components/schemas/niCarrier'
333
- ported:
334
- type: string
335
- description: 'If the user has changed carrier for `number`. The assumed status means that the information supplier has replied to the request but has not said explicitly that the number is ported.'
336
- enum:
337
- - unknown
338
- - ported
339
- - not_ported
340
- - assumed_not_ported
341
- - assumed_ported
342
- caller_name:
343
- type: string
344
- description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
345
- last_name:
346
- type: string
347
- description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
348
- first_name:
349
- type: string
350
- description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
351
- caller_type:
352
- type: string
353
- description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
354
- enum:
355
- - business
356
- - consumer
357
- - unknown
358
- roaming:
359
- description: 'Information about the roaming status for `number`. This is applicable to mobile numbers only.'
360
- $ref: '#/components/schemas/niRoaming'
361
- ip:
362
- type: string
363
- description: 'The ip address you specified in the request. This field is blank if you did not specify `ip`.'
364
- ip_warnings:
365
- type: string
366
- description: 'Warning levels for `ip`: `unknown` or `no_warning`'
367
- enum:
368
- - unknown
369
- - no_warning
370
- ip_match_level:
371
- type: string
372
- description: 'The match status between ip and number parameters. This value is only returned if you set ip in the `request`.'
373
- enum:
374
- - 'Country Level'
375
- - 'Mismatch'
376
- ip_country:
377
- type: string
378
- description: 'The country that `ip` is allocated to. This value is only returned if you set ip in the `request`.'
379
- niDetails:
380
- type: object
381
- properties:
382
- status:
383
- $ref: '#/components/schemas/niStatus'
384
- status_message:
385
- type: string
386
- description: 'The status description of your request.'
387
- example: 'Success'
388
- lookup_outcome:
389
- type: integer
390
- description: |
391
- Shows if all information about a phone number has been returned. Possible values:
392
- Code | Text
393
- -- | --
394
- 0 | Success
395
- 1 | Partial success - some fields populated
396
- 2 | Failed
397
- enum:
398
- - 0
399
- - 1
400
- - 2
401
- example: '0'
402
- lookup_outcome_message:
403
- type: string
404
- description: 'Shows if all information about a phone number has been returned.'
405
- example: 'Success'
406
- request_id:
407
- type: string
408
- description: 'The unique identifier for your request. This is a alphanumeric string up to 40 characters.'
409
- example: 'aaaaaaaa-bbbb-cccc-dddd-0123456789ab'
410
- maxLength: 40
411
- international_format_number:
412
- type: string
413
- description: "The `number` in your request in international format."
414
- example: "447700900000"
415
- national_format_number:
416
- type: string
417
- description: "The `number` in your request in the format used by the country the number belongs to."
418
- example: "07700 900000"
419
- country_code:
420
- type: string
421
- description: 'Two character country code for `number`. This is in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.'
422
- example: "GB"
423
- pattern: '[A-Z]{2}'
424
- country_code_iso3:
425
- type: string
426
- description: 'Three character country code for `number`. This is in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.'
427
- example: "GBR"
428
- pattern: '[A-Z]{3}'
429
- country_name:
430
- type: string
431
- description: 'The full name of the country that `number` is registered in.'
432
- example: "United Kingdom"
433
- country_prefix:
434
- type: string
435
- description: 'The numeric prefix for the country that `number` is registered in.'
436
- example: '44'
437
- request_price:
438
- type: number
439
- description: 'The amount in EUR charged to your account.'
440
- example: "0.04000000"
441
- refund_price:
442
- type: number
443
- description: 'If there is an internal lookup error, the `refund_price` will reflect the lookup price. If `cnam` is requested for a non-US number the `refund_price` will reflect the `cnam` price. If both of these conditions occur, `refund_price` is the sum of the lookup price and `cnam` price.'
444
- example: '0.01'
445
- remaining_balance:
446
- type: number
447
- description: 'Your account balance in EUR after this request. Not returned with Number Insight Advanced Async API.'
448
- example: '1.23456789'
449
- current_carrier:
450
- description: 'Information about the network `number` is currently connected to.'
451
- $ref: '#/components/schemas/niCarrier'
452
- original_carrier:
453
- description: 'Information about the network `number` was initially connected to.'
454
- $ref: '#/components/schemas/niCarrier'
455
- valid_number:
456
- type: string
457
- description: 'Does `number` exist. This is applicable to mobile numbers only.'
458
- enum:
459
- - unknown
460
- - valid
461
- - not_valid
462
- example: 'valid'
463
- reachable:
464
- type: string
465
- description: 'Can you call `number` now. This is applicable to mobile numbers only.'
466
- enum:
467
- - unknown
468
- - reachable
469
- - undeliverable
470
- - absent
471
- - bad_number
472
- - blacklisted
473
- example: 'reachable'
474
- ported:
475
- type: string
476
- description: 'If the user has changed carrier for `number`. The assumed status means that the information supplier has replied to the request but has not said explicitly that the number is ported.'
477
- enum:
478
- - unknown
479
- - ported
480
- - not_ported
481
- - assumed_not_ported
482
- - assumed_ported
483
- example:
484
- - 'not_ported'
485
- roaming:
486
- description: 'Information about the roaming status for `number`. This is applicable to mobile numbers only.'
487
- $ref: '#/components/schemas/niRoaming'
488
- ip:
489
- description: 'Information about the provided IP address'
490
- $ref: '#/components/schemas/niIP'
491
- ip_warnings:
492
- type: string
493
- description: 'Warning levels for `ip`'
494
- enum:
495
- - unknown
496
- - no_warning
497
- example: 'no_warning'
498
- caller_identity:
499
- description: 'Information about the roaming status for `number`. This is applicable to mobile numbers only.'
500
- $ref: '#/components/schemas/niCallerIdentity'
501
- # END
502
- caller_name:
503
- type: string
504
- description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
505
- example: 'John Smith'
506
- last_name:
507
- type: string
508
- description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
509
- example: 'Smith'
510
- first_name:
511
- type: string
512
- description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
513
- example: 'John'
514
- caller_type:
515
- type: string
516
- description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
517
- enum:
518
- - business
519
- - consumer
520
- - unknown
521
- example: 'consumer'
522
- required:
523
- - status
524
- - status_message
525
- - request_id
526
- - international_format_number
527
- - national_format_number
528
- - country_code
529
- - country_code_iso3
530
- - country_name
531
- - country_prefix
532
- niStatus:
533
- type: integer
534
- enum:
535
- - 0
536
- - 1
537
- - 3
538
- - 4
539
- - 5
540
- - 9
541
- - 19
542
- - 43
543
- - 44
544
- - 45
545
- - 999
546
- description: |
547
- Code | Text
548
- -- | --
549
- 0 | Success - request accepted for delivery by Nexmo.
550
- 1 | Busy - you have made more requests in the last second than are permitted by your Nexmo account. Please retry.
551
- 3 | Invalid - your request is incomplete and missing some mandatory parameters.
552
- 4 | Invalid credentials - the _api_key_ or _api_secret_ you supplied is either not valid or has been disabled.
553
- 5 | Internal Error - the format of the recipient address is not valid.
554
- 9 | Partner quota exceeded - your Nexmo account does not have sufficient credit to process this request.
555
-
556
- ## Standard and Advanced only
557
-
558
- Code | Text
559
- -- | --
560
- 19 | Facility Not Allowed - your request makes use of a facility that is not enabled on your account.
561
- 43, 44, 45 | Live mobile lookup not returned. Not all return parameters are available.
562
- 999 | Request unparseable.
563
- niCarrier:
564
- type: object
565
- properties:
566
- network_code:
567
- type: string
568
- description: 'The [https://en.wikipedia.org/wiki/Mobile_country_code](https://en.wikipedia.org/wiki/Mobile_country_code) for the carrier`number` is associated with. Unreal numbers are marked as`unknown` and the request is rejected altogether if the number is impossible according to the [E.164](https://en.wikipedia.org/wiki/E.164) guidelines.'
569
- xml:
570
- attribute: true
571
- example: '12345'
572
- name:
573
- type: string
574
- description: 'The full name of the carrier that `number` is associated with.'
575
- xml:
576
- attribute: true
577
- example: 'Acme Inc'
578
- country:
579
- type: string
580
- description: 'The country that `number` is associated with. This is in ISO 3166-1 alpha-2 format.'
581
- xml:
582
- attribute: true
583
- example: 'GB'
584
- network_type:
585
- type: string
586
- description: 'The type of network that `number` is associated with.'
587
- enum:
588
- - mobile
589
- - landline
590
- - landline_premium
591
- - landline_tollfree
592
- - virtual
593
- - unknown
594
- - pager
595
- xml:
596
- attribute: true
597
- example: 'mobile'
598
- niRoaming:
599
- type: object
600
- properties:
601
- status:
602
- type: string
603
- description: 'Is `number` outside its home carrier network.'
604
- enum:
605
- - unknown
606
- - roaming
607
- - not_roaming
608
- xml:
609
- attribute: true
610
- roaming_country_code:
611
- type: string
612
- description: 'If `number` is `roaming`, this is the [code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the country `number` is roaming in.'
613
- xml:
614
- attribute: true
615
- roaming_network_code:
616
- type: string
617
- description: 'If `number` is `roaming`, this is the id of the carrier network `number` is roaming in.'
618
- xml:
619
- attribute: true
620
- roaming_network_name:
621
- type: string
622
- description: 'If `number` is `roaming`, this is the name of the carrier network `number` is roaming in.'
623
- xml:
624
- attribute: true
625
- niIP:
626
- type: object
627
- properties:
628
- address:
629
- type: string
630
- description: 'The ip address you specified in the request.'
631
- example: '123.0.0.255'
632
- ip_match_level:
633
- type: string
634
- description: 'The match status between ip and number parameters.'
635
- enum:
636
- - 'country'
637
- - 'mismatch'
638
- example: 'country'
639
- ip_country:
640
- type: string
641
- description: 'The country that `ip` is allocated to.'
642
- example: 'GB'
643
- ip_city:
644
- type: string
645
- description: 'The city that `ip` is allocated to.'
646
- example: 'London'
647
- niCallerIdentity:
648
- type: object
649
- properties:
650
- caller_type:
651
- type: string
652
- description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
653
- enum:
654
- - business
655
- - consumer
656
- - unknown
657
- example: 'consumer'
658
- caller_name:
659
- type: string
660
- description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
661
- example: 'John Smith'
662
- first_name:
663
- type: string
664
- description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
665
- example: 'John'
666
- last_name:
667
- type: string
668
- description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
669
- example: 'Smith'
670
- subscription_type:
671
- type: string
672
- # @TODO: description: ''
673
- example: 'unknown'
674
-
675
- securitySchemes:
676
- apiKey:
677
- type: apiKey
678
- name: api_key
679
- in: query
680
- description: 'You can find your API key in your [account overview](https://dashboard.nexmo.com/account-overview)'
681
- apiSecret:
682
- type: apiKey
683
- name: api_secret
684
- in: query
685
- description: 'You can find your API secret in your [account overview](https://dashboard.nexmo.com/account-overview)'
1
+ ---
2
+ openapi: 3.0.0
3
+ servers:
4
+ - url: 'https://api.nexmo.com/ni'
5
+ info:
6
+ title: Number Insight API
7
+ version: 1.0.0
8
+ description: >-
9
+ Nexmo's Number Insight API provides details about the validity, reachability and roaming status of a phone number, as well as giving you details on how to format the number properly in your application. There are three levels of Number Insight API available: Basic, Standard and Advanced. The advanced API is available asynchronously as well as synchronously.
10
+ contact:
11
+ name: Nexmo.com
12
+ email: devrel@nexmo.com
13
+ url: https://developer.nexmo.com/
14
+ x-twitter: Nexmo
15
+ termsOfService: 'https://www.nexmo.com/terms-of-use'
16
+ license:
17
+ name: 'The MIT License (MIT)'
18
+ url: 'https://opensource.org/licenses/MIT'
19
+ x-logo:
20
+ url: 'https://twitter.com/Nexmo/profile_image?size=original'
21
+ x-apiClientRegistration: 'https://dashboard.nexmo.com/sign-up'
22
+ externalDocs:
23
+ url: https://developer.nexmo.com/api/number-insight
24
+ x-sha1: 081f6d985e2e4a75586da1654fde880a96885405
25
+ security:
26
+ - apiKey: []
27
+ apiSecret: []
28
+ tags:
29
+ - name: Request
30
+ description: 'Ask for information about a phone number'
31
+ paths:
32
+ '/{level}/{format}':
33
+ parameters:
34
+ - $ref: '#/components/parameters/level'
35
+ - $ref: '#/components/parameters/format'
36
+ get:
37
+ operationId: getNumberInsight
38
+ summary: Synchronously get information about a phone number
39
+ x-code-example-path: number_insight.standard
40
+ x-group: number-insight
41
+ tags:
42
+ - Request
43
+ parameters:
44
+ - $ref: '#/components/parameters/number'
45
+ - $ref: '#/components/parameters/country'
46
+ - $ref: '#/components/parameters/cnam'
47
+ - $ref: '#/components/parameters/ip'
48
+ responses:
49
+ '200':
50
+ description: OK
51
+ content:
52
+ 'application/json':
53
+ schema:
54
+ $ref: '#/components/schemas/niResponseJson'
55
+ 'text/xml':
56
+ schema:
57
+ $ref: '#/components/schemas/niResponseXml'
58
+ '/advanced/async/{format}':
59
+ parameters:
60
+ - $ref: '#/components/parameters/format'
61
+ get:
62
+ operationId: getNumberInsightAsync
63
+ summary: Asynchronously get information about a phone number
64
+ x-code-example-path: number_insight.async
65
+ x-group: number-insight
66
+ tags:
67
+ - Request
68
+ parameters:
69
+ - $ref: '#/components/parameters/callback'
70
+ - $ref: '#/components/parameters/number'
71
+ - $ref: '#/components/parameters/country'
72
+ - $ref: '#/components/parameters/cnam'
73
+ - $ref: '#/components/parameters/ip'
74
+ responses:
75
+ '200':
76
+ description: OK
77
+ content:
78
+ 'application/json':
79
+ schema:
80
+ $ref: '#/components/schemas/niResponseAsync'
81
+ 'text/xml':
82
+ schema:
83
+ $ref: '#/components/schemas/niResponseAsync'
84
+ callbacks:
85
+ onData:
86
+ '{$request.query.callback}':
87
+ post:
88
+ operationId: asyncCallback
89
+ summary: Asynchronous response
90
+ description: Contains the response to your
91
+ requestBody:
92
+ content:
93
+ application/json:
94
+ schema:
95
+ $ref: '#/components/schemas/niResponseJsonAdvanced'
96
+ text/xml:
97
+ schema:
98
+ $ref: '#/components/schemas/niResponseXmlAdvanced'
99
+ responses:
100
+ '200':
101
+ description: OK
102
+ components:
103
+ parameters:
104
+ level:
105
+ name: level
106
+ in: path
107
+ required: true
108
+ description: 'The level of request you wish to make.'
109
+ example: standard
110
+ schema:
111
+ type: string
112
+ enum:
113
+ - 'basic'
114
+ - 'standard'
115
+ - 'advanced'
116
+ format:
117
+ name: format
118
+ in: path
119
+ required: true
120
+ description: 'The format of the response'
121
+ example: json
122
+ schema:
123
+ type: string
124
+ enum:
125
+ - 'json'
126
+ - 'xml'
127
+ number:
128
+ name: number
129
+ in: query
130
+ description: 'A single phone number that you need insight about in national or international format.'
131
+ example: '447700900000'
132
+ required: true
133
+ schema:
134
+ type: string
135
+ pattern: '^[0-9-+\(\)\s]*$'
136
+ country:
137
+ name: country
138
+ in: query
139
+ example: 'GB'
140
+ description: 'If a number does not have a country code or is uncertain, set the two-character country code. This code must be in ISO 3166-1 alpha-2 format and in upper case. For example, GB or US. If you set country and number is already in [E.164](https://en.wikipedia.org/wiki/E.164) format, country must match the country code in number.'
141
+ schema:
142
+ type: string
143
+ pattern: '[A-Z]{2}'
144
+ cnam:
145
+ name: cnam
146
+ in: query
147
+ example: true
148
+ description: 'Indicates if the name of the person who owns the phone number should be looked up and returned in the response. Set to true to receive phone number owner name in the response. This features is available for US numbers only and incurs an additional charge.'
149
+ schema:
150
+ type: boolean
151
+ default: false
152
+ ip:
153
+ name: ip
154
+ in: query
155
+ example: '123.0.0.255'
156
+ description: "The IP address of the user. If supplied, we will compare this to the country the user's phone is located in and return an error if it does not match."
157
+ schema:
158
+ type: string
159
+ callback:
160
+ name: callback
161
+ in: query
162
+ example: 'https://example.com/callback'
163
+ description: 'The callback URL'
164
+ required: true
165
+ schema:
166
+ type: string
167
+ format: uriref
168
+ schemas:
169
+ niResponseAsync:
170
+ type: object
171
+ xml:
172
+ name: lookup
173
+ properties:
174
+ request_id:
175
+ type: string
176
+ description: 'The unique identifier for your request. This is a alphanumeric string up to 40 characters.'
177
+ example: 'aaaaaaaa-bbbb-cccc-dddd-0123456789ab'
178
+ maxLength: 40
179
+ xml:
180
+ name: requestId
181
+ number:
182
+ type: string
183
+ description: "The `number` in your request"
184
+ example: '447700900000'
185
+ remaining_balance:
186
+ type: string
187
+ description: 'Your account balance in EUR after this request. Not returned with Number Insight Advanced Async API.'
188
+ example: '1.23456789'
189
+ xml:
190
+ name: remainingBalance
191
+ request_price:
192
+ type: number
193
+ description: 'If there is an internal lookup error, the `refund_price` will reflect the lookup price. If `cnam` is requested for a non-US number the `refund_price` will reflect the `cnam` price. If both of these conditions occur, `refund_price` is the sum of the lookup price and `cnam` price.'
194
+ example: '0.01500000'
195
+ xml:
196
+ name: requestPrice
197
+ status:
198
+ $ref: '#/components/schemas/niStatus'
199
+ niResponseXml:
200
+ type: object
201
+ description: 'The root object of the XML response varies based on the detail level requested.'
202
+ oneOf:
203
+ - $ref: '#/components/schemas/niResponseXmlBasic'
204
+ - $ref: '#/components/schemas/niResponseXmlStandard'
205
+ - $ref: '#/components/schemas/niResponseXmlAdvanced'
206
+ niResponseXmlBasic:
207
+ type: object
208
+ description: Basic
209
+ xml:
210
+ name: format
211
+ properties:
212
+ request_id:
213
+ type: string
214
+ description: 'The unique identifier for your request. This is a alphanumeric string up to 40 characters.'
215
+ example: 'aaaaaaaa-bbbb-cccc-dddd-0123456789ab'
216
+ maxLength: 40
217
+ xml:
218
+ name: request_id
219
+ international_format_number:
220
+ type: string
221
+ description: "The `number` in your request in international format."
222
+ example: "447700900000"
223
+ local_number:
224
+ type: object
225
+ description: "An object containing the `number` in your request in the format used by the country the number belongs to."
226
+ properties:
227
+ country_code:
228
+ type: string
229
+ description: 'Two character country code for `number`. This is in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.'
230
+ example: "GB"
231
+ pattern: '[A-Z]{2}'
232
+ xml:
233
+ attribute: true
234
+ country_code_iso3:
235
+ type: string
236
+ description: 'Three character country code for `number`. This is in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.'
237
+ example: "GBR"
238
+ pattern: '[A-Z]{3}'
239
+ xml:
240
+ attribute: true
241
+ country_name:
242
+ type: string
243
+ description: 'The full name of the country that `number` is registered in.'
244
+ example: "United Kingdom"
245
+ xml:
246
+ attribute: true
247
+ country_prefix:
248
+ type: string
249
+ description: 'The numeric prefix for the country that `number` is registered in.'
250
+ example: '44'
251
+ xml:
252
+ attribute: true
253
+ number:
254
+ type: string
255
+ description: "The `number` in your request in the format used by the country the number belongs to."
256
+ example: '07700 900000'
257
+ xml:
258
+ x-text: true # see https://github.com/OAI/OpenAPI-Specification/issues/630
259
+ error:
260
+ type: object
261
+ properties:
262
+ code:
263
+ type: string
264
+ description: 'The status code'
265
+ example: 0
266
+ xml:
267
+ attribute: true
268
+ status_text:
269
+ type: string
270
+ description: 'The status description of your request.'
271
+ example: Success
272
+ xml:
273
+ x-text: true # see https://github.com/OAI/OpenAPI-Specification/issues/630
274
+ niResponseXmlStandard:
275
+ type: object
276
+ description: 'Standard'
277
+ xml:
278
+ name: lookup
279
+ allOf:
280
+ - $ref: '#/components/schemas/niResponseXmlBasic'
281
+ - properties:
282
+ request_price:
283
+ type: number
284
+ description: 'If there is an internal lookup error, the `refund_price` will reflect the lookup price. If `cnam` is requested for a non-US number the `refund_price` will reflect the `cnam` price. If both of these conditions occur, `refund_price` is the sum of the lookup price and `cnam` price.'
285
+ example: '0.01500000'
286
+ remaining_balance:
287
+ type: number
288
+ description: 'Your account balance in EUR after this request. Not returned with Number Insight Advanced Async API.'
289
+ example: '1.23456789'
290
+ current_carrier:
291
+ description: 'Information about the network `number` is currently connected to.'
292
+ $ref: '#/components/schemas/niCarrier'
293
+ original_carrier:
294
+ description: 'Information about the network `number` was initially connected to.'
295
+ $ref: '#/components/schemas/niCarrier'
296
+ ported:
297
+ properties:
298
+ ported_message:
299
+ type: string
300
+ description: 'If the user has changed carrier for `number`. The assumed status means that the information supplier has replied to the request but has not said explicitly that the number is ported.'
301
+ enum:
302
+ - unknown
303
+ - ported
304
+ - not_ported
305
+ - assumed_not_ported
306
+ - assumed_ported
307
+ example: 'not_ported'
308
+ xml:
309
+ x-text: true
310
+ roaming:
311
+ type: object
312
+ properties:
313
+ status:
314
+ type: string
315
+ enum:
316
+ - unknown
317
+ example: unknown
318
+ xml:
319
+ attribute: true
320
+ cnam:
321
+ properties:
322
+ caller-type:
323
+ type: string
324
+ description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
325
+ enum:
326
+ - business
327
+ - consumer
328
+ - unknown
329
+ example: 'consumer'
330
+ xml:
331
+ attribute: true
332
+ caller-name:
333
+ type: string
334
+ description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
335
+ example: 'John Smith'
336
+ xml:
337
+ attribute: true
338
+ first-name:
339
+ type: string
340
+ description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
341
+ example: 'John'
342
+ xml:
343
+ attribute: true
344
+ last-name:
345
+ type: string
346
+ description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
347
+ example: 'Smith'
348
+ xml:
349
+ attribute: true
350
+ subscription-type:
351
+ example: unknown
352
+ xml:
353
+ attribute: true
354
+ caller_name:
355
+ type: string
356
+ description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
357
+ example: 'John Smith'
358
+ last_name:
359
+ type: string
360
+ description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
361
+ example: 'Smith'
362
+ firs_name:
363
+ # Key is not a typo. Do not change.
364
+ type: string
365
+ description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
366
+ example: 'John'
367
+ caller_type:
368
+ type: string
369
+ description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
370
+ enum:
371
+ - business
372
+ - consumer
373
+ - unknown
374
+ example: 'consumer'
375
+ niResponseXmlAdvanced:
376
+ type: object
377
+ description: 'Advanced'
378
+ xml:
379
+ name: lookup
380
+ allOf:
381
+ - $ref: '#/components/schemas/niResponseXmlBasic'
382
+ - properties:
383
+ request_price:
384
+ type: number
385
+ description: 'If there is an internal lookup error, the `refund_price` will reflect the lookup price. If `cnam` is requested for a non-US number the `refund_price` will reflect the `cnam` price. If both of these conditions occur, `refund_price` is the sum of the lookup price and `cnam` price.'
386
+ example: '0.01500000'
387
+ remaining_balance:
388
+ type: number
389
+ description: 'Your account balance in EUR after this request. Not returned with Number Insight Advanced Async API.'
390
+ example: '1.23456789'
391
+ current_carrier:
392
+ description: 'Information about the network `number` is currently connected to.'
393
+ $ref: '#/components/schemas/niCarrier'
394
+ original_carrier:
395
+ description: 'Information about the network `number` was initially connected to.'
396
+ $ref: '#/components/schemas/niCarrier'
397
+ ported:
398
+ properties:
399
+ ported_message:
400
+ type: string
401
+ description: 'If the user has changed carrier for `number`. The assumed status means that the information supplier has replied to the request but has not said explicitly that the number is ported.'
402
+ enum:
403
+ - unknown
404
+ - ported
405
+ - not_ported
406
+ - assumed_not_ported
407
+ - assumed_ported
408
+ example: 'not_ported'
409
+ xml:
410
+ x-text: true
411
+ cnam:
412
+ properties:
413
+ caller-type:
414
+ type: string
415
+ description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
416
+ enum:
417
+ - business
418
+ - consumer
419
+ - unknown
420
+ example: 'consumer'
421
+ xml:
422
+ attribute: true
423
+ caller-name:
424
+ type: string
425
+ description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
426
+ example: 'John Smith'
427
+ xml:
428
+ attribute: true
429
+ first-name:
430
+ type: string
431
+ description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
432
+ example: 'John'
433
+ xml:
434
+ attribute: true
435
+ last-name:
436
+ type: string
437
+ description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
438
+ example: 'Smith'
439
+ xml:
440
+ attribute: true
441
+ subscription-type:
442
+ example: unknown
443
+ xml:
444
+ attribute: true
445
+ caller_name:
446
+ type: string
447
+ description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
448
+ example: 'John Smith'
449
+ last_name:
450
+ type: string
451
+ description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
452
+ example: 'Smith'
453
+ firs_name:
454
+ # Key is not a typo. Do not change.
455
+ type: string
456
+ description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
457
+ example: 'John'
458
+ caller_type:
459
+ type: string
460
+ description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
461
+ enum:
462
+ - business
463
+ - consumer
464
+ - unknown
465
+ example: 'consumer'
466
+ lookup_outcome:
467
+ type: object
468
+ description: "An object indicating whether all information about a phone number has been returned."
469
+ properties:
470
+ code:
471
+ description: |
472
+ Shows if all information about a phone number has been returned. Possible values:
473
+
474
+ Code | Text
475
+ -- | --
476
+ 0 | Success
477
+ 1 | Partial success - some fields populated
478
+ 2 | Failed
479
+ enum:
480
+ - 0
481
+ - 1
482
+ - 2
483
+ example: '0'
484
+ xml:
485
+ attribute: true
486
+ lookup_outcome_message:
487
+ type: string
488
+ description: 'Shows if all information about a phone number has been returned.'
489
+ example: 'Success'
490
+ xml:
491
+ x-text: true # see https://github.com/OAI/OpenAPI-Specification/issues/630
492
+ reachable:
493
+ type: string
494
+ description: 'Can you call `number` now. This is applicable to mobile numbers only.'
495
+ enum:
496
+ - unknown
497
+ - reachable
498
+ - undeliverable
499
+ - absent
500
+ - bad_number
501
+ - blacklisted
502
+ example: 'reachable'
503
+ roaming:
504
+ description: 'Information about the roaming status for `number`. This is applicable to mobile numbers only.'
505
+ $ref: '#/components/schemas/niRoaming'
506
+ ip:
507
+ description: 'Information about the provided IP address'
508
+ $ref: '#/components/schemas/niIP'
509
+ valid_number:
510
+ type: string
511
+ description: 'Does `number` exist. This is applicable to mobile numbers only.'
512
+ enum:
513
+ - unknown
514
+ - valid
515
+ - not_valid
516
+ example: 'valid'
517
+ ip_warnings:
518
+ type: string
519
+ description: 'Warning levels for `ip`'
520
+ enum:
521
+ - unknown
522
+ - no_warning
523
+ example: 'no_warning'
524
+ niResponseJson:
525
+ type: object
526
+ description: 'The root object of the XML response varies based on the detail level requested.'
527
+ oneOf:
528
+ - $ref: '#/components/schemas/niResponseJsonBasic'
529
+ - $ref: '#/components/schemas/niResponseJsonStandard'
530
+ - $ref: '#/components/schemas/niResponseJsonAdvanced'
531
+ niResponseJsonBasic:
532
+ type: object
533
+ description: Basic
534
+ properties:
535
+ status:
536
+ $ref: '#/components/schemas/niStatus'
537
+ status_message:
538
+ type: string
539
+ description: 'The status description of your request. Returned when status is 0 or 1'
540
+ example: 'Success'
541
+ request_id:
542
+ type: string
543
+ description: 'The unique identifier for your request. This is a alphanumeric string up to 40 characters.'
544
+ example: 'aaaaaaaa-bbbb-cccc-dddd-0123456789ab'
545
+ maxLength: 40
546
+ international_format_number:
547
+ type: string
548
+ description: "The `number` in your request in international format."
549
+ example: "447700900000"
550
+ national_format_number:
551
+ type: string
552
+ description: "The `number` in your request in the format used by the country the number belongs to."
553
+ example: "07700 900000"
554
+ country_code:
555
+ type: string
556
+ description: 'Two character country code for `number`. This is in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.'
557
+ example: "GB"
558
+ pattern: '[A-Z]{2}'
559
+ country_code_iso3:
560
+ type: string
561
+ description: 'Three character country code for `number`. This is in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.'
562
+ example: "GBR"
563
+ pattern: '[A-Z]{3}'
564
+ country_name:
565
+ type: string
566
+ description: 'The full name of the country that `number` is registered in.'
567
+ example: "United Kingdom"
568
+ country_prefix:
569
+ type: string
570
+ description: 'The numeric prefix for the country that `number` is registered in.'
571
+ example: '44'
572
+ niResponseJsonStandard:
573
+ type: object
574
+ description: Standard
575
+ properties:
576
+ status:
577
+ $ref: '#/components/schemas/niStatus'
578
+ status_message:
579
+ type: string
580
+ description: 'The status description of your request. Returned when status is 0 or 1'
581
+ example: 'Success'
582
+ request_id:
583
+ type: string
584
+ description: 'The unique identifier for your request. This is a alphanumeric string up to 40 characters.'
585
+ example: 'aaaaaaaa-bbbb-cccc-dddd-0123456789ab'
586
+ maxLength: 40
587
+ international_format_number:
588
+ type: string
589
+ description: "The `number` in your request in international format."
590
+ example: "447700900000"
591
+ national_format_number:
592
+ type: string
593
+ description: "The `number` in your request in the format used by the country the number belongs to."
594
+ example: "07700 900000"
595
+ country_code:
596
+ type: string
597
+ description: 'Two character country code for `number`. This is in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.'
598
+ example: "GB"
599
+ pattern: '[A-Z]{2}'
600
+ country_code_iso3:
601
+ type: string
602
+ description: 'Three character country code for `number`. This is in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.'
603
+ example: "GBR"
604
+ pattern: '[A-Z]{3}'
605
+ country_name:
606
+ type: string
607
+ description: 'The full name of the country that `number` is registered in.'
608
+ example: "United Kingdom"
609
+ country_prefix:
610
+ type: string
611
+ description: 'The numeric prefix for the country that `number` is registered in.'
612
+ example: '44'
613
+ request_price:
614
+ type: number
615
+ description: 'The amount in EUR charged to your account.'
616
+ example: "0.04000000"
617
+ refund_price:
618
+ type: number
619
+ description: 'If there is an internal lookup error, the `refund_price` will reflect the lookup price. If `cnam` is requested for a non-US number the `refund_price` will reflect the `cnam` price. If both of these conditions occur, `refund_price` is the sum of the lookup price and `cnam` price.'
620
+ example: '0.01500000'
621
+ remaining_balance:
622
+ type: number
623
+ description: 'Your account balance in EUR after this request. Not returned with Number Insight Advanced Async API.'
624
+ example: '1.23456789'
625
+ current_carrier:
626
+ description: 'Information about the network `number` is currently connected to.'
627
+ $ref: '#/components/schemas/niCarrier'
628
+ original_carrier:
629
+ description: 'Information about the network `number` was initially connected to.'
630
+ $ref: '#/components/schemas/niCarrier'
631
+ ported:
632
+ type: string
633
+ description: 'If the user has changed carrier for `number`. The assumed status means that the information supplier has replied to the request but has not said explicitly that the number is ported.'
634
+ enum:
635
+ - unknown
636
+ - ported
637
+ - not_ported
638
+ - assumed_not_ported
639
+ - assumed_ported
640
+ example: 'not_ported'
641
+ roaming:
642
+ description: 'Information about the roaming status for `number`. This is applicable to mobile numbers only.'
643
+ $ref: '#/components/schemas/niRoaming'
644
+ caller_identity:
645
+ description: 'Information about the network `number` is currently connected to.'
646
+ $ref: '#/components/schemas/niCallerIdentity'
647
+ caller_name:
648
+ type: string
649
+ description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
650
+ example: 'John Smith'
651
+ last_name:
652
+ type: string
653
+ description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
654
+ example: 'Smith'
655
+ first_name:
656
+ type: string
657
+ description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
658
+ example: 'John'
659
+ caller_type:
660
+ type: string
661
+ description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
662
+ enum:
663
+ - business
664
+ - consumer
665
+ - unknown
666
+ example: 'consumer'
667
+ niResponseJsonAdvanced:
668
+ type: object
669
+ description: Advanced
670
+ properties:
671
+ status:
672
+ $ref: '#/components/schemas/niStatus'
673
+ status_message:
674
+ type: string
675
+ description: 'The status description of your request. Returned when status is 0 or 1'
676
+ example: 'Success'
677
+ request_id:
678
+ type: string
679
+ description: 'The unique identifier for your request. This is a alphanumeric string up to 40 characters.'
680
+ example: 'aaaaaaaa-bbbb-cccc-dddd-0123456789ab'
681
+ maxLength: 40
682
+ international_format_number:
683
+ type: string
684
+ description: "The `number` in your request in international format."
685
+ example: "447700900000"
686
+ national_format_number:
687
+ type: string
688
+ description: "The `number` in your request in the format used by the country the number belongs to."
689
+ example: "07700 900000"
690
+ country_code:
691
+ type: string
692
+ description: 'Two character country code for `number`. This is in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.'
693
+ example: "GB"
694
+ pattern: '[A-Z]{2}'
695
+ country_code_iso3:
696
+ type: string
697
+ description: 'Three character country code for `number`. This is in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.'
698
+ example: "GBR"
699
+ pattern: '[A-Z]{3}'
700
+ country_name:
701
+ type: string
702
+ description: 'The full name of the country that `number` is registered in.'
703
+ example: "United Kingdom"
704
+ country_prefix:
705
+ type: string
706
+ description: 'The numeric prefix for the country that `number` is registered in.'
707
+ example: '44'
708
+ request_price:
709
+ type: number
710
+ description: 'The amount in EUR charged to your account.'
711
+ example: "0.04000000"
712
+ refund_price:
713
+ type: number
714
+ description: 'If there is an internal lookup error, the `refund_price` will reflect the lookup price. If `cnam` is requested for a non-US number the `refund_price` will reflect the `cnam` price. If both of these conditions occur, `refund_price` is the sum of the lookup price and `cnam` price.'
715
+ example: '0.01500000'
716
+ remaining_balance:
717
+ type: number
718
+ description: 'Your account balance in EUR after this request. Not returned with Number Insight Advanced Async API.'
719
+ example: '1.23456789'
720
+ current_carrier:
721
+ description: 'Information about the network `number` is currently connected to.'
722
+ $ref: '#/components/schemas/niCarrier'
723
+ original_carrier:
724
+ description: 'Information about the network `number` was initially connected to.'
725
+ $ref: '#/components/schemas/niCarrier'
726
+ ported:
727
+ type: string
728
+ description: 'If the user has changed carrier for `number`. The assumed status means that the information supplier has replied to the request but has not said explicitly that the number is ported.'
729
+ enum:
730
+ - unknown
731
+ - ported
732
+ - not_ported
733
+ - assumed_not_ported
734
+ - assumed_ported
735
+ example: 'not_ported'
736
+ roaming:
737
+ description: 'Information about the roaming status for `number`. This is applicable to mobile numbers only.'
738
+ $ref: '#/components/schemas/niRoaming'
739
+ caller_identity:
740
+ description: 'Information about the network `number` is currently connected to.'
741
+ $ref: '#/components/schemas/niCallerIdentity'
742
+ caller_name:
743
+ type: string
744
+ description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
745
+ example: 'John Smith'
746
+ last_name:
747
+ type: string
748
+ description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
749
+ example: 'Smith'
750
+ first_name:
751
+ type: string
752
+ description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
753
+ example: 'John'
754
+ caller_type:
755
+ type: string
756
+ description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
757
+ enum:
758
+ - business
759
+ - consumer
760
+ - unknown
761
+ example: 'consumer'
762
+ lookup_outcome:
763
+ type: integer
764
+ description: |
765
+ Shows if all information about a phone number has been returned. Possible values:
766
+
767
+ Code | Text
768
+ --- | ---
769
+ 0 | Success
770
+ 1 | Partial success - some fields populated
771
+ 2 | Failed
772
+ enum:
773
+ - 0
774
+ - 1
775
+ - 2
776
+ example: '0'
777
+ lookup_outcome_message:
778
+ type: string
779
+ description: 'Shows if all information about a phone number has been returned.'
780
+ example: 'Success'
781
+ valid_number:
782
+ type: string
783
+ description: 'Does `number` exist. This is applicable to mobile numbers only.'
784
+ enum:
785
+ - unknown
786
+ - valid
787
+ - not_valid
788
+ example: 'valid'
789
+ reachable:
790
+ type: string
791
+ description: 'Can you call `number` now. This is applicable to mobile numbers only.'
792
+ enum:
793
+ - unknown
794
+ - reachable
795
+ - undeliverable
796
+ - absent
797
+ - bad_number
798
+ - blacklisted
799
+ example: 'reachable'
800
+ ip:
801
+ description: 'Information about the provided IP address'
802
+ $ref: '#/components/schemas/niIP'
803
+ ip_warnings:
804
+ type: string
805
+ description: 'Warning levels for `ip`'
806
+ enum:
807
+ - unknown
808
+ - no_warning
809
+ example: 'no_warning'
810
+ required:
811
+ - status
812
+ - status_message
813
+ - request_id
814
+ - international_format_number
815
+ - national_format_number
816
+ - country_code
817
+ - country_code_iso3
818
+ - country_name
819
+ - country_prefix
820
+ niCarrier:
821
+ type: object
822
+ properties:
823
+ network_code:
824
+ type: string
825
+ description: 'The [https://en.wikipedia.org/wiki/Mobile_country_code](https://en.wikipedia.org/wiki/Mobile_country_code) for the carrier`number` is associated with. Unreal numbers are marked as`unknown` and the request is rejected altogether if the number is impossible according to the [E.164](https://en.wikipedia.org/wiki/E.164) guidelines.'
826
+ xml:
827
+ attribute: true
828
+ example: '12345'
829
+ name:
830
+ type: string
831
+ description: 'The full name of the carrier that `number` is associated with.'
832
+ xml:
833
+ attribute: true
834
+ example: 'Acme Inc'
835
+ country:
836
+ type: string
837
+ description: 'The country that `number` is associated with. This is in ISO 3166-1 alpha-2 format.'
838
+ xml:
839
+ attribute: true
840
+ example: 'GB'
841
+ network_type:
842
+ type: string
843
+ description: 'The type of network that `number` is associated with.'
844
+ enum:
845
+ - mobile
846
+ - landline
847
+ - landline_premium
848
+ - landline_tollfree
849
+ - virtual
850
+ - unknown
851
+ - pager
852
+ xml:
853
+ attribute: true
854
+ example: 'mobile'
855
+ niRoaming:
856
+ type: object
857
+ properties:
858
+ status:
859
+ type: string
860
+ description: 'Is `number` outside its home carrier network.'
861
+ enum:
862
+ - unknown
863
+ - roaming
864
+ - not_roaming
865
+ example: roaming
866
+ xml:
867
+ attribute: true
868
+ roaming_country_code:
869
+ type: string
870
+ description: 'If `number` is `roaming`, this is the [code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the country `number` is roaming in.'
871
+ example: US
872
+ xml:
873
+ attribute: true
874
+ roaming_network_code:
875
+ type: string
876
+ description: 'If `number` is `roaming`, this is the id of the carrier network `number` is roaming in.'
877
+ example: 12345
878
+ xml:
879
+ attribute: true
880
+ roaming_network_name:
881
+ type: string
882
+ description: 'If `number` is `roaming`, this is the name of the carrier network `number` is roaming in.'
883
+ example: 'Acme Inc'
884
+ xml:
885
+ attribute: true
886
+ niIP:
887
+ type: object
888
+ properties:
889
+ address:
890
+ type: string
891
+ description: 'The ip address you specified in the request.'
892
+ example: '123.0.0.255'
893
+ xml:
894
+ attribute: true
895
+ ip_match_level:
896
+ type: string
897
+ description: 'The match status between ip and number parameters.'
898
+ enum:
899
+ - 'country'
900
+ - 'mismatch'
901
+ example: 'country'
902
+ xml:
903
+ attribute: true
904
+ ip_country:
905
+ type: string
906
+ description: 'The country that `ip` is allocated to.'
907
+ example: 'GB'
908
+ xml:
909
+ attribute: true
910
+ ip_city:
911
+ type: string
912
+ description: 'The city that `ip` is allocated to.'
913
+ example: 'London'
914
+ xml:
915
+ attribute: true
916
+ niCallerIdentity:
917
+ type: object
918
+ properties:
919
+ caller_type:
920
+ type: string
921
+ description: 'The value will be `business` if the owner of a phone number is a business. If the owner is an individual the value will be `consumer`. The value will be `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
922
+ enum:
923
+ - business
924
+ - consumer
925
+ - unknown
926
+ example: 'consumer'
927
+ caller_name:
928
+ type: string
929
+ description: 'Full name of the person who owns the phone number. `unknown` if this information is not available. This parameter is only present if `cnam` had a value of `true` within the request.'
930
+ example: 'John Smith'
931
+ first_name:
932
+ type: string
933
+ description: 'First name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
934
+ example: 'John'
935
+ last_name:
936
+ type: string
937
+ description: 'Last name of the person who owns the phone number if the owner is an individual. This parameter is only present if `cnam` had a value of `true` within the request.'
938
+ example: 'Smith'
939
+ subscription_type:
940
+ type: string
941
+ # @TODO: description: ''
942
+ example: 'unknown'
943
+ niStatus:
944
+ type: integer
945
+ example: 0
946
+ enum:
947
+ - 0
948
+ - 1
949
+ - 3
950
+ - 4
951
+ - 5
952
+ - 9
953
+ - 19
954
+ - 43
955
+ - 44
956
+ - 45
957
+ - 999
958
+ description: |
959
+ Code | Text
960
+ -- | --
961
+ 0 | Success - request accepted for delivery by Nexmo.
962
+ 1 | Busy - you have made more requests in the last second than are permitted by your Nexmo account. Please retry.
963
+ 3 | Invalid - your request is incomplete and missing some mandatory parameters.
964
+ 4 | Invalid credentials - the _api_key_ or _api_secret_ you supplied is either not valid or has been disabled.
965
+ 5 | Internal Error - the format of the recipient address is not valid.
966
+ 9 | Partner quota exceeded - your Nexmo account does not have sufficient credit to process this request.
967
+
968
+ ## Standard and Advanced only
969
+
970
+ Code | Text
971
+ -- | --
972
+ 19 | Facility Not Allowed - your request makes use of a facility that is not enabled on your account.
973
+ 43, 44, 45 | Live mobile lookup not returned. Not all return parameters are available.
974
+ 999 | Request unparseable.
975
+ securitySchemes:
976
+ apiKey:
977
+ type: apiKey
978
+ name: api_key
979
+ in: query
980
+ description: 'You can find your API key in your [account overview](https://dashboard.nexmo.com/account-overview)'
981
+ apiSecret:
982
+ type: apiKey
983
+ name: api_secret
984
+ in: query
985
+ description: 'You can find your API secret in your [account overview](https://dashboard.nexmo.com/account-overview)'
986
+ x-groups:
987
+ number-insight:
988
+ name: Number Insight
989
+ description: The Number Insight object contains information about the request and details of the phone number information has been requested about.
990
+ order: 1
991
+ schema:
992
+ application/json:
993
+ $ref: '#/components/schemas/niResponseJsonAdvanced'
994
+ text/xml:
995
+ $ref: '#/components/schemas/niResponseXmlAdvanced'