mirror of
https://github.com/donl/plivo-node.git
synced 2026-05-26 06:12:28 -06:00
Merge pull request #167 from plivo/ppai-lookup-api-v2
Lookup API: Change endpoint and response
This commit is contained in:
commit
d0514bf747
7 changed files with 12 additions and 11 deletions
|
|
@ -1,5 +1,8 @@
|
|||
# Change Log
|
||||
|
||||
## [4.11.0](https://github.com/plivo/plivo-node/releases/tag/v4.11.0)(2020-10-30)
|
||||
- Change lookup API endpoint and response.
|
||||
|
||||
## [4.10.0](https://github.com/plivo/plivo-node/releases/tag/v4.10.0)(2020-09-21)
|
||||
- Add Lookup API support.
|
||||
|
||||
|
|
|
|||
|
|
@ -84,8 +84,7 @@ let plivo = require('plivo');
|
|||
let client = new plivo.Client('AUTH_ID', 'AUTH_TOKEN');
|
||||
|
||||
client.lookup.get(
|
||||
"<number-goes-here>",
|
||||
"carrier" // default type
|
||||
"<number-goes-here>"
|
||||
).then(function(response) {
|
||||
console.log(response);
|
||||
}).catch(function(error) {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ let plivo = require('plivo');
|
|||
let client = new plivo.Client('', '');
|
||||
|
||||
client.lookup.get(
|
||||
"",
|
||||
"carrier" // default info
|
||||
""
|
||||
).then(function(response) {
|
||||
console.log(response);
|
||||
}).catch(function(error) {
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ import {
|
|||
import * as _ from "lodash";
|
||||
|
||||
const clientKey = Symbol();
|
||||
const action = 'Lookup/Number/'; // unused as it is overridden, only for unit tests
|
||||
const action = 'Number/'; // unused as it is overridden, only for unit tests
|
||||
const idField = 'OVERRIDDEN';
|
||||
const LOOKUP_API_BASE_URL = 'https://api.plivo.com/v1/Lookup/Number'
|
||||
const LOOKUP_API_BASE_URL = 'https://lookup.plivo.com/v1/Number'
|
||||
|
||||
export class Number extends PlivoResource {
|
||||
constructor(client, data = {}) {
|
||||
|
|
|
|||
|
|
@ -913,8 +913,8 @@ export function Request(config) {
|
|||
api_id: "930692a3-6f09-45b5-80f5-5585565fb30e",
|
||||
phone_number: "+14154305555",
|
||||
country: {
|
||||
code_iso2: "US",
|
||||
code_iso3: "USA",
|
||||
iso2: "US",
|
||||
iso3: "USA",
|
||||
name: "United States"
|
||||
},
|
||||
format: {
|
||||
|
|
@ -927,7 +927,7 @@ export function Request(config) {
|
|||
mobile_country_code: "310",
|
||||
mobile_network_code: "160",
|
||||
name: "Cingular Wireless",
|
||||
ported: true,
|
||||
ported: "yes",
|
||||
type: "mobile"
|
||||
},
|
||||
resource_uri: "/v1/Lookup/Number/+14154305555?type=carrier"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "plivo",
|
||||
"version": "4.10.0",
|
||||
"version": "4.11.0",
|
||||
"description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML",
|
||||
"homepage": "https://github.com/plivo/plivo-node",
|
||||
"files": [
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ describe('LookupInterface', function() {
|
|||
.then(function(number) {
|
||||
assert.equal(number.numberFormat.e164, '+14154305555')
|
||||
assert.equal(number.phoneNumber, '+14154305555')
|
||||
assert.equal(number.resourceUri, '/v1/Lookup/Number/+14154305555?type=carrier')
|
||||
assert.equal(number.resourceUri, '/v1/Number/+14154305555?type=carrier')
|
||||
})
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue