IncomingCarrier

You can use this API if you own phone numbers from a carrier and want to route incoming calls on those carrier’s numbers through Plivo. The APIs enables you to perform the following actions:

BaseURI https://api.plivo.com/v1/Account/{auth_id}/IncomingCarrier/

List Incoming Carriers

This API will list all incoming carrier registered with you account on Plivo.

GET https://api.plivo.com/v1/Account/{auth_id}/IncomingCarrier/

Arguments

There are no mandatory parameters for this API. The following optional parameters can be specified:

Parameter Description
name (optional) Allows filtering by name. The filter term can be one of the following:
  • The exact name of the Carrier
  • Phrase contained within the name the carrier (includes the "starts with" filter)
limit (optional) Used to display the number of results per page. The maximum number of results that can be fetched is 20.
offset (optional) Denotes the number of value items by which the results should be offset.
Eg:- If the result contains a 1000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results.

Response

HTTP Status Code: 200

{
  "meta": {
    "previous": null,
    "total_count": 1,
    "offset": 0,
    "limit": 20,
    "next": null
  },
  "api_id": "a90cbe28-58d7-11e1-86da-adf28403fe48",
  "objects": [
    {
      "carrier_id": "19381640842535",
      "ip_set": "10.20.10.20,10.10.10.10,10.20.10.30",
      "name": "Custom carrier 1",
      "resource_uri": "/v1/Account/MAVMMGU4MGVKYZA4ZJU0/IncomingCarrier/19381640842535/",
      "sms": false,
      "voice": true
      }
  ]
}

Details of an Incoming Carrier

This API returns the details of an incoming carrier

GET https://api.plivo.com/v1/Account/{auth_id}/IncomingCarrier/{carrier_id}/

Arguments

None

Response

HTTP Status Code: 200

{
    "api_id": "18c3881e-5060-11e4-8a4a-123140008edf",
    "carrier_id": "12209049768983",
    "ip_set": "172.168.1.4",
    "name": "Bermuda",
    "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/IncomingCarrier/12209049768983/",
    "sms": false,
    "voice": true
}

Add a New Incoming Carrier

This API lets you add a new incoming carrier to your Plivo account.

POST https://api.plivo.com/v1/Account/{auth_id}/IncomingCarrier/

Arguments

Parameter Description
name (mandatory) The name of the carrier being added. It is just a representation and the name can be chosen at will.
ip_set (mandatory) Comma separated list of ip addresses from which calls belonging to the carrier will reach Plivo. This list will be used by Plivo to allow incoming call traffic into Plivo's servers. If calls come from an IP outside of this list, Plivo will not accept the call.

Response

HTTP Status Code: 201

{
    "api_id": "65368fb6-5060-11e4-8a4a-123140008edf",
    "carrier_id": "13455781930894",
    "message": "created"
}

Modify an Existing Incoming Carrier

This API lets you modify an existing incoming carrier set up on your account.

POST https://api.plivo.com/v1/Account/{auth_id}/IncomingCarrier/{carrier_id}/

Arguments

Parameter Description
name (optional) The name of the carrier. It is just a representation and the name can be chosen at will.
ip_set (optional) Comma separated list of IP addresses from which Plivo should receive incoming calls for the carrier. The complete set of ips will be replaced when the update api is used.

Response

HTTP Status Code: 202

{
    "api_id": "7127cccc-5060-11e4-80aa-12313f048015",
    "message": "changed"
}

Remove a Carrier

This API lets you remove an incoming carrier added to your account.

Please note that removing a carrier will result in all numbers associated with the carrier to be deleted.

DELETE https://api.plivo.com/v1/Account/{auth_id}/IncomingCarrier/{carrier_id}/

Arguments

None

Response

HTTP Status Code: 204