DIDWW API V3

Introduction

About the DIDWW API

The DIDWW API provides a simple yet powerful interface that allows you to fully integrate your own applications with DIDWW services. An extensive set of actions may be performed using this API, such as ordering and configuring phone numbers, setting capacity, creating SIP trunks and retrieving CDRs and other operational data. As such, this interface is the ideal tool for building alternative dashboards, developing mobile applications and automating front and back-end applications.

The DIDWW API is a fully compliant implementation of the JSON API specification, which defines how an application should request that resources be fetched or modified, and how a server should respond to those requests. This REST (Representational State Transfer) interface provides an easy-to-use set of HTTP endpoints that let you access our services using GET, PUT, POST, PATCH and DELETE methods.

THIS DOCUMENT ASSUMES THAT YOU ARE FAMILIAR WITH WEB PROGRAMMING CONCEPTS, WEB DATA FORMATS AND WITH THE JSON API SPECIFICATION. ADDITIONAL INFORMATION ABOUT JSON IS AVAILABLE ON THEIR OFFICIAL WEB SITE.

API Keys

To use the DIDWW API in either the sandbox or production environment, you must register and receive an API key which will be used by your app.

To receive your production API key

  • Sign into your DIDWW account at https://my.didww.com and access the “API access settings” on the API page. If you do not have an account with DIDWW, please register for free.
  • Click on “Send API security key to email” and you will receive your private key at your registered email address.

You must include this key following the Api-Key prefix in your API requests as shown in the example below:

curl -H 'Accept: application/vnd.api+json' \
     -H 'Api-Key: 4D41E00J6KMXABS' \
     'https://api.didww.com/v3/countries'

To receive your sandbox API key

  • Sign into your DIDWW sandbox account at https://my-sandbox.didww.com and access the “API access settings” on the API page. If you do not have an account with DIDWW, please register for free.
  • Click on “Send API security key to email” and you will receive your private key at your registered email address.

You must include this key following the Api-Key prefix in your API requests as shown in the example below:

curl -H 'Accept: application/vnd.api+json' \
     -H 'Api-Key: 4D41E00J6KMXABS' \
     'https://api.didww.com/v3/countries'

Environments and Endpoints

DIDWW maintains both a sandbox and a production environment for the API.

The sandbox allows you to develop your application outside the production environment and therefore does not affect critical data. Operating your application in the sandbox is essentially the same as operating in the production environment, and all aspects of the API may be tested. However, no actual transactions take place that modify the DIDWW number inventory or cause charges to be incurred. This environment is important for testing the functionality and logic of your application before deploying to production or releasing to customers.

The endpoints are as follows:

Sandbox environment

https://sandbox-api.didww.com/v3/

Production environment

https://api.didww.com/v3/

API Reference

API Call Summary

The DIDWW API allows you perform an extensive set of actions such as querying the DID coverage and inventory, ordering and configuring phone numbers and services, setting capacity and creating SIP trunks by using the following methods:

  • GET - Fetch data, where the data can be a collection or resources or an individual resource
  • POST - Create a new resource
  • PATCH - Update an existing resource
  • DELETE - Remove an existing resource
API call Method/s Details
balance GET Return the prepaid balance as well as the available credit on your account
cities GET Return a list of cities included in the current DIDWW inventory, or return the details of a specific city
countries GET Return a list of countries included in the current DIDWW inventory, or return the details of a specific country
dids GET, PATCH Return a list of all of the DIDs owned by this account or the details for a single DID, or modify the settings for a single DID owned by this account
did_groups GET Return a list of DID Groups, which is essentially a list of the current DIDWW coverage. DID Groups are phone numbers that share a common city or area code.
did_group_types GET Return a list of the various types of DIDs supported by DIDWW (for example, mobile, toll-free, SMS)
export GET, POST Return call detail records (CDRs) or create a CDR for export
orders GET, POST, DELETE Return a list of the orders previously placed in this account, create a new order, or delete an order
regions GET Return a list of regions (for example, states within the USA) included in the current DIDWW inventory
trunks GET, POST, PATCH, DELETE Return a list of all of the trunks configured by this account, create a new trunk, modify the settings of an existing trunk, or delete a trunk
trunk_groups GET, POST, PATCH, DELETE Return the details of a trunk group, create a new trunk group, modify trunk group settings, or delete a trunk group

Fetching data

When using methods that return data, the fetched data may be sorted, filtered and paginated. In addition, related resources (parent, children, or related objects) may be fetched by using the “include” parameter.

Note that all text is case-sensitive, and white-space characters should not be used.

Sorting

Used for sorting the fields returned by the request, with a comma (“,”) separating the included fields.

Note: If the sorting option is not used, then by default the fetched data is sorted according to the ID number (such as country ID, order ID, CDR ID) assigned to the primary response data by DIDWW.

For example, to sort the list of cities according to their country, include the sort option “country_id”.

GET https://api.didww.com/cities?sort=country_id HTTP/1.1
Accept: application/vnd.api+json
Note: Dot-separated sort fields can be used to request sorting based on relationship attributes. For example, a sort field of country.name could be used to request that the primary data be sorted based upon the name attribute of the country relationship.

Endpoints support multiple sort fields by allowing comma-separated sort fields ordered by priority.

GET https://api.didww.com/cities?sort=country.name,name HTTP/1.1
Accept: application/vnd.api+json
Note that inserting a minus sign (-) at the beginning of any sort option results in reverse sorting.
GET https://api.didww.com/cities?sort=-country_id,name HTTP/1.1
Accept: application/vnd.api+json

The above example will return the cities sorted by newly added countries (sorted by the ID numbers allocated to the supported countries in descending order). Cities with same country_id will be sorted according to their names, in ascending alphabetical order.

Note: This section applies to any endpoint that responds with a resource collection as primary data, regardless of the request type.

Pagination

To paginate the primary data, supply pagination links in the top-level links object.

The following keys used for pagination links:

  • first: the first page of data
  • last: the last page of data
  • prev: the previous page of data
  • next: the next page of data

The page query parameter is reserved for pagination, for example query parameters such as page[number] and page[size]

page[size] defines the maximum number of individual entries (such as cities, countries or DIDs) that are returned in the data.

GET /cities?page[size]=10 HTTP/1.1
Accept: application/vnd.api+json

page[number] relates to the page[size] parameter and defines the page number of the returned data. For example, if the page[size] is set to 10 and the page[number] is set to 3, entry numbers 21 to 30 will be returned in the data. If the page[number] is not defined, page number 0 is returned.

GET https://api.didww.com/cities?page[number]=3&page[size]=10 HTTP/1.1
Accept: application/vnd.api+json
Note: This section applies to any endpoint that responds with a resource collection as primary data, regardless of the request type.

Filtering

The filtering system is highly flexible and allows you to create complex queries by combining multiple conditions. Resource filtering can be achieved by providing parameters which start with filter. For example, to only fetch cities within a specified country ID, include the filter option “country_id”.

GET https://api.didww.com/cities?filter[country_id]=1 HTTP/1.1
Accept: application/vnd.api+json

Multiple parameters may be included as filters. For example, to fetch cities within specified country and region IDs, include the filter options “country_id” and “region_id”.

GET https://api.didww.com/cities?filter[country_id]=1&filter[region_id]=7 HTTP/1.1
Accept: application/vnd.api+json

Inclusion of Related Resources

Side-loading allows you to retrieve related records as part of a single request, and to define which related resources should be returned. Includes are specified with the include parameter. The response will include a top-level object relationships with associated data under the appropriate resource key.

GET https://api.didww.com/dids?include=trunk HTTP/1.1
Accept: application/vnd.api+json

Multiple related resources may be returned by adding several include parameters to a single URL.

GET https://api.didww.com/dids?include=trunk,did_group HTTP/1.1
Accept: application/vnd.api+json

Includes may also be applied to relations of included objects.

GET https://api.didww.com/dids?include=trunk.trunk_group HTTP/1.1
Accept: application/vnd.api+json

Headers

Client Responsibilities

Clients MUST send all JSON API data in request documents with the header

Content-Type: application/vnd.api+json without any media type parameters.

Clients that include the JSON API media type in their Accept header MUST specify the media type there at least once without any media type parameters.

Server Responsibilities

Servers MUST send all JSON API data in response documents with the header

Content-Type: application/vnd.api+json without any media type parameters.

Servers MUST respond with a 415 Unsupported Media Type status code if a request specifies the header

Content-Type: application/vnd.api+json with any media type parameters.

Servers MUST respond with a 406 Not Acceptable status code if a request’s Accept header contains the JSON API media type and all instances of that media type are modified with media type parameters.

JSONAPI spec

Title Optional Description
Accept No application/vnd.api+json
Content-Type No application/vnd.api+json
Api-Key No authorization header

Assigning of Related Resources

Creating/Updating Resources with relationships

Updating To-One Relationships

A server responds to PATCH, POST requests to a URL from a to-one relationship link as described below.

The PATCH request include a top-level member named data containing one of:

a resource identifier object corresponding to the new related resource.

null, to remove the relationship.

For example, the following request updates the Trunk of an DID:

PATCH https://api.didww.com/dids/1 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json

{
  "data": {
    "type": "dids",
    "id": "1",
    "relationships": {
      "trunk": {
        "data": { "type": "trunks", "id": "456" }
      }
    }
  }
}

And the following request clears the trunk of the DID:

PATCH https://api.didww.com/dids/1 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json

{
  "data": {
    "type": "dids",
    "id": "1",
    "relationships": {
      "trunk": {
        "data": null
      }
    }
  }
}

If the relationship is updated successfully then the server returns a successful response.

Updating To-Many Relationships

A server responds to PATCH, POST requests to a URL from a to-many relationship link as described below.

For all request types, the body contain a data member whose value is an empty array or an array of resource identifier objects.

If a client makes a PATCH request to a URL from a to-many relationship link, the server can either completely replace every member of the relationship, return an appropriate error response if some resources can not be found or accessed, or return a 403 Forbidden response if complete replacement is not allowed by the server.

For example, the following request replaces every trunk for an trunk group:

PATCH https://api.didww.com/trunk_groups/1 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json

{
  "data": {
    "id": "1",
    "type": "trunk_groups",
    "relationships": {
      "trunks": {
        "data": [
          { "type": "trunks", "id": "456"},
          { "type": "trunks", "id": "457" }
        ]
      }
    }
  }
}

And the following request clears every trunk for an trunk group:

PATCH https://api.didww.com/trunk_groups/1 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json

{
  "data": {
    "id": "1",
    "type": "trunk_groups",
    "relationships": {
      "trunks": {
        "data": []
      }
    }
  }
}

If a client makes a POST request to a URL from a relationship link, the server adds the specified members to the relationship unless they are already present. If a given type and id is already in the relationship, the server does not add it again.

If all of the specified resources can be added to, or are already present in, the relationship then the server returns a successful response.

API Calls - Fetching Coverage

Country

GET /countries/{id}

Get County

Description

Returns a country for a given country ID number. Note that a unique identification number is allocated to each country included in the DIDWW coverage.

Request

URI Parameters

id
required
Type: String
Description: unique ID number for the country

Response

Response Body

Code Success Description
200 Yes Country Object
404 No Not Found
401 No Unauthorized

Request:

GET https://api.didww.com/countries/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "countries",
    "attributes": {
      "name": "United Kingdom",
      "prefix": "44",
      "iso": "GB"
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /countries

Get Countries

Description

Returns a list of all the countries included in the current coverage list. By default, the returned countries are sorted according to their allocated ID numbers.

Request

URI Parameters

filters[<filter_name>]
optional
Type: String
Description: jsonapi filters
sort
optional
Type: String
Description: jsonapi sorting

Filters

Filter Name Type Allow Blank Allow Array Description
id String No Yes A filter on the list based on the id field.
name String Yes Yes Country name
prefix String Yes Yes Country prefix
iso String Yes Yes Country ISO

Sorting

Value Description
id sort by "id" field
name sort by "name" field
prefix sort by "prefix" field
iso sort by "iso" field

Response

Response Body

Code Success Description
200 Yes list of Country Objects
401 No Unauthorized

Request:

GET https://api.didww.com/countries HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "456",
      "type": "countries",
      "attributes": {
        "name": "United Kingdom",
        "prefix": "44",
        "iso": "GB"
      }
    },
    {
      "id": "457",
      "type": "countries",
      "attributes": {
        "name": "United States",
        "prefix": "1",
        "iso": "US"
      }
    }
  ]
}

Country Object

Description

Country Object attributes

Attributes

name
Type: String
Description: Country name
prefix
Type: String
Description: Country prefix (country calling code)
iso
Type: String
Description: Country ISO code

Region

GET /regions/{id}

Get Region

Description

Returns a single Region

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Region
includes
optional
Type: String
Description: jsonapi includes

Includes

Value Description
country Country Object

Examples

Example name Description
Sample 1 Simple request
Sample 2 Request with country include

Response

Response Body

Code Success Description
200 Yes Region Object
404 No Not Found
401 No Unauthorized

Requests:

GET https://api.didww.com/regions/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "regions",
    "attributes": {
      "name": "Alberta"
    },
    "relationships": {
      "country": {
        "links": {
          "self": "https://api.didww.com/v3/regions/123/relationships/country",
          "related": "https://api.didww.com/v3/regions/123/country"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET https://api.didww.com/regions/123?include=country HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "regions",
    "attributes": {
      "name": "Alberta"
    },
    "relationships": {
      "country": {
        "links": {
          "self": "https://api.didww.com/v3/regions/123/relationships/country",
          "related": "https://api.didww.com/v3/regions/123/country"
        },
        "data": {
          "type": "countries",
          "id": "38"
        }
      }
    }
  },
  "included": [
    {
      "id": "38",
      "type": "countries",
      "attributes": {
        "name": "Canada",
        "prefix": "1",
        "iso": "CA"
      }
    }
  ]
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /regions

Get Regions

Description

Returns a collection of Regions

Request

URI Parameters

filters[<filter_name>]
optional
Type: Integer
Description: jsonapi filters
includes
optional
Type: String
Description: jsonapi includes
sort
optional
Type: String
Description: jsonapi sorting

Includes

Value Description
country Country Object

Filters

Filter Name Type Allow Blank Allow Array Description
id String No Yes A filter on the list based on the id field.
name String Yes Yes A filter on the list based on the name field.
country.id Integer Yes Yes A filter on the list based on the "country.id" field.

Sorting

Value Description
id sort by "id" field
name sort by "name" field

Examples

Example name Description
Sample 1 Simple request
Sample 2 Request with country include

Response

Response Body

Code Success Description
200 Yes list of Region Objects
401 No Unauthorized

Requests:

GET https://api.didww.com/regions HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "123",
      "type": "regions",
      "attributes": {
        "name": "Texas"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/regions/123/relationships/country",
            "related": "https://api.didww.com/v3/regions/123/country"
          }
        }
      }
    },
    {
      "id": "124",
      "type": "regions",
      "attributes": {
        "name": "Rhode Island"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/regions/124/relationships/country",
            "related": "https://api.didww.com/v3/regions/124/country"
          }
        }
      }
    }
  ]
}
GET https://api.didww.com/regions?include=country HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "123",
      "type": "regions",
      "attributes": {
        "name": "Texas"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/regions/123/relationships/country",
            "related": "https://api.didww.com/v3/regions/123/country"
          },
          "data": {
            "type": "countries",
            "id": "456"
          }
        }
      }
    },
    {
      "id": "124",
      "type": "regions",
      "attributes": {
        "name": "Rhode Island"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/regions/124/relationships/country",
            "related": "https://api.didww.com/v3/regions/124/country"
          },
          "data": {
            "type": "countries",
            "id": "456"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "456",
      "type": "countries",
      "attributes": {
        "name": "United States",
        "prefix": "1",
        "iso": "US"
      }
    }
  ]
}

Region Object

Description

Region Object attributes

Attributes

name
Type: String
Description: Region name

City

GET /cities/{id}

Get City

Description

Returns a city for a given city ID number. Note that a unique identification number is allocated to each city included in the DIDWW coverage.

Request

URI Parameters

id
required
Type: String
Description: unique ID number for the city
includes
optional
Type: String
Description: jsonapi includes

Includes

Value Description
country Country Object
region Region Object

Examples

Example name Description
Sample 1 Simple request
Sample 2 Request with country include

Response

Response Body

Code Success Description
200 Yes City Object
404 No Not Found
401 No Unauthorized

Requests:

GET https://api.didww.com/cities/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "cities",
    "attributes": {
      "name": "London"
    },
    "relationships": {
      "country": {
        "links": {
          "self": "https://api.didww.com/v3/cities/123/relationships/country",
          "related": "https://api.didww.com/v3/cities/123/country"
        }
      },
      "region": {
        "links": {
          "self": "https://api.didww.com/v3/cities/123/relationships/region",
          "related": "https://api.didww.com/v3/cities/123/region"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET https://api.didww.com/cities/123?include=country HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "cities",
    "attributes": {
      "name": "London"
    },
    "relationships": {
      "country": {
        "links": {
          "self": "https://api.didww.com/v3/cities/123/relationships/country",
          "related": "https://api.didww.com/v3/cities/123/country"
        },
        "data": {
          "type": "countries",
          "id": "456"
        }
      },
      "region": {
        "links": {
          "self": "https://api.didww.com/v3/cities/123/relationships/region",
          "related": "https://api.didww.com/v3/cities/123/region"
        }
      }
    }
  },
  "included": [
    {
      "id": "456",
      "type": "countries",
      "attributes": {
        "name": "United Kingdom",
        "prefix": "44",
        "iso": "GB"
      }
    }
  ]
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /cities

Get Cities

Description

Returns a list of all the cities included in the current coverage list. By default, the returned cities are sorted according to their allocated ID numbers.

Request

URI Parameters

filters[<filter_name>]
optional
Type: String, Integer
Description: jsonapi filters
includes
optional
Type: String
Description: jsonapi includes
sort
optional
Type: String
Description: jsonapi sorting

Includes

Value Description
country Country Object
region Region Object

Filters

Filter Name Type Allow Blank Allow Array Description
id String No Yes A filter on the list based on the id field.
name String Yes Yes A filter on the list based on the name field.
country.id Integer Yes Yes A filter on the list based on the "country.id" field.
region.id Integer Yes Yes A filter on the list based on the "region.id" field.

Sorting

Value Description
id sort by "id" field
name sort by "name" field

Examples

Example name Description
Sample 1 Simple request
Sample 2 Request with country include

Response

Response Body

Code Success Description
200 Yes list of City Objects
401 No Unauthorized

Requests:

GET https://api.didww.com/cities HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "123",
      "type": "cities",
      "attributes": {
        "name": "London"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/cities/123/relationships/country",
            "related": "https://api.didww.com/v3/cities/123/country"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/cities/123/relationships/region",
            "related": "https://api.didww.com/v3/cities/123/region"
          }
        }
      }
    },
    {
      "id": "456",
      "type": "cities",
      "attributes": {
        "name": "New York"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/cities/456/relationships/country",
            "related": "https://api.didww.com/v3/cities/456/country"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/cities/456/relationships/region",
            "related": "https://api.didww.com/v3/cities/456/region"
          }
        }
      }
    }
  ],
  "meta": {
    "total_records": 2
  },
  "links": {
    "first": "https://api.didww.com/v3/cities?&page%5Bnumber%5D=1&page%5Bsize%5D=1000",
    "next": "https://api.didww.com/v3/cities?&page%5Bnumber%5D=1&page%5Bsize%5D=1000"
  }
}
GET https://api.didww.com/cities?include=country HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "123",
      "type": "cities",
      "attributes": {
        "name": "London"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/cities/123/relationships/country",
            "related": "https://api.didww.com/v3/cities/123/country"
          },
          "data": {
            "type": "countries",
            "id": "456"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/cities/123/relationships/region",
            "related": "https://api.didww.com/v3/cities/123/region"
          }
        }
      }
    },
    {
      "id": "124",
      "type": "cities",
      "attributes": {
        "name": "New York"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/cities/124/relationships/country",
            "related": "https://api.didww.com/v3/cities/124/country"
          },
          "data": {
            "type": "countries",
            "id": "457"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/cities/124/relationships/region",
            "related": "https://api.didww.com/v3/cities/124/region"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "456",
      "type": "countries",
      "attributes": {
        "name": "United Kingdom",
        "prefix": "44",
        "iso": "GB"
      }
    },
    {
      "id": "457",
      "type": "countries",
      "attributes": {
        "name": "United States",
        "prefix": "1",
        "iso": "US"
      }
    }
  ],
  "meta": {
    "total_records": 2
  },
  "links": {
    "first": "https://api.didww.com/v3/cities?include=country&page%5Bnumber%5D=1&page%5Bsize%5D=1000",
    "next": "https://api.didww.com/v3/cities?include=country&page%5Bnumber%5D=1&page%5Bsize%5D=1000"
  }
}

City Object

Description

City Object definition

Attributes

name
Type: String
Description: City name

DID Group Type

GET /did_group_types/{id}

Get DID Group Type

Description

Returns a single DID Group Type. A DID Group Type defines a broad category of DID services supported by DIDWW (for example, mobile, local and toll-free).

Request

URI Parameters

id
required
Type: String
Description: Unique ID number of a DID Group Type

Response

Response Body

Code Success Description
200 Yes DID Group Type Object
404 No Not Found
401 No Unauthorized

Request:

GET https://api.didww.com/did_group_types/1 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "1",
    "type": "did_group_types",
    "attributes": {
      "name": "Local"
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 1 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /did_group_types

Get DID Group Types

Description

Returns a list of DID Group Types. A DID Group Type defines a broad category of DID services supported by DIDWW (for example, mobile, local and toll-free).

Request

URI Parameters

filters[<filter_name>]
optional
Type: Integer
Description: jsonapi filters
sort
optional
Type: String
Description: jsonapi sorting

Filters

Filter Name Type Allow Blank Allow Array Description
id String No Yes A filter on the list based on the id field.
name String Yes Yes A filter on the list based on the name field.

Sorting

Value Description
id sort by "id" field
name sort by "name" field

Response

Response Body

Code Success Description
200 Yes list of DID Group Type Objects
401 No Unauthorized

Request:

GET https://api.didww.com/did_group_types HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "1",
      "type": "did_group_types",
      "attributes": {
        "name": "Local"
      }
    },
    {
      "id": "2",
      "type": "did_group_types",
      "attributes": {
        "name": "National"
      }
    },
    {
      "id": "3",
      "type": "did_group_types",
      "attributes": {
        "name": "Toll-free"
      }
    },
    {
      "id": "4",
      "type": "did_group_types",
      "attributes": {
        "name": "Mobile"
      }
    },
    {
      "id": "5",
      "type": "did_group_types",
      "attributes": {
        "name": "Shared Cost"
      }
    },
    {
      "id": "6",
      "type": "did_group_types",
      "attributes": {
        "name": "Global"
      }
    }
  ],
  "meta": {
    "total_records": 6
  },
  "links": {
    "first": "https://api.didww.comv3/did_group_types?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "https://api.didww.com/v3/did_group_types?page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

DID Group Type Object

Description

DID Object attributes

Attributes

name
Type: String
Description: DID Group Type name, such as "Local", "Mobile" or "Toll-free".

DID Group

GET /did_groups/{id}

Get DID Group

Description

Returns single DID Group. DID Groups are phone numbers that share a common city or area code.

Request

URI Parameters

id
required
Type: String
Description: Unique ID number of the DID Group
includes
optional
Type: String
Description: jsonapi includes

Includes

Value Description
country Country Object
city City Object
region Region Object
did_group_type DID Group Type Object
stock_keeping_units list of Stock Keeping Unit Objects

Examples

Example name Description
Sample 1 Simple request
Sample 2 Request with country, city, region, did_group_type, stock_keeping_units includes

Response

Response Body

Code Success Description
200 Yes DID Group Object
404 No Not Found
401 No Unauthorized

Requests:

GET https://api.didww.com/did_groups/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "did_groups",
    "links": {
      "self": "https://api.didww.com/v3/did_groups/123"
    },
    "attributes": {
      "prefix": "77",
      "local_prefix": "",
      "features": [
        "voice",
        "sms"
      ],
      "is_metered": false,
      "area_name": "National",
      "allow_additional_channels": true
    },
    "relationships": {
      "country": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/country",
          "related": "https://api.didww.com/v3/did_groups/123/country"
        }
      },
      "city": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/city",
          "related": "https://api.didww.com/v3/did_groups/123/city"
        }
      },
      "did_group_type": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/did_group_type",
          "related": "https://api.didww.com/v3/did_groups/123/did_group_type"
        }
      },
      "region": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/region",
          "related": "https://api.didww.com/v3/did_groups/123/region"
        }
      },
      "stock_keeping_units": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/stock_keeping_units",
          "related": "https://api.didww.com/v3/did_groups/123/stock_keeping_units"
        }
      }
    },
    "meta": {
      "needs_registration": false,
      "is_available": true,
      "restrictions": null
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET https://api.didww.com/did_groups/123?include=country,city,region,did_group_type,stock_keeping_units HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "did_groups",
    "links": {
      "self": "https://api.didww.com/v3/did_groups/123"
    },
    "attributes": {
      "prefix": "77",
      "local_prefix": "",
      "features": [
        "voice",
        "sms"
      ],
      "is_metered": false,
      "area_name": "National",
      "allow_additional_channels": true
    },
    "relationships": {
      "country": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/country",
          "related": "https://api.didww.com/v3/did_groups/123/country"
        },
        "data": {
          "type": "countries",
          "id": "100"
        }
      },
      "city": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/city",
          "related": "https://api.didww.com/v3/did_groups/123/city"
        },
        "data": null
      },
      "did_group_type": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/did_group_type",
          "related": "https://api.didww.com/v3/did_groups/123/did_group_type"
        },
        "data": {
          "type": "did_group_types",
          "id": "2"
        }
      },
      "region": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/region",
          "related": "https://api.didww.com/v3/did_groups/123/region"
        },
        "data": null
      },
      "stock_keeping_units": {
        "links": {
          "self": "https://api.didww.com/v3/did_groups/123/relationships/stock_keeping_units",
          "related": "https://api.didww.com/v3/did_groups/123/stock_keeping_units"
        },
        "data": [
          {
            "type": "stock_keeping_units",
            "id": "2000"
          },
          {
            "type": "stock_keeping_units",
            "id": "2001"
          }
        ]
      }
    },
    "meta": {
      "needs_registration": false,
      "is_available": true,
      "restrictions": null
    }
  },
  "included": [
    {
      "id": "100",
      "type": "countries",
      "attributes": {
        "name": "Israel",
        "prefix": "972",
        "iso": "IL"
      }
    },
    {
      "id": "2",
      "type": "did_group_types",
      "attributes": {
        "name": "National"
      }
    },
    {
      "id": "2000",
      "type": "stock_keeping_units",
      "attributes": {
        "setup_price": "0.0",
        "monthly_price": "2.06",
        "channels_included_count": 0
      }
    },
    {
      "id": "2001",
      "type": "stock_keeping_units",
      "attributes": {
        "setup_price": "0.0",
        "monthly_price": "7.0",
        "channels_included_count": 2
      }
    }
  ]
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /did_groups

Get DID Groups

Description

Returns a list of DID Groups, which is essentially a list of the current DIDWW coverage. DID Groups are phone numbers that share a common city or area code.

Request

URI Parameters

filters[<filter_name>]
optional
Type: Integer, String, Boolean
Description: jsonapi filters
includes
optional
Type: String
Description: jsonapi includes
sort
optional
Type: String
Description: jsonapi sorting

Includes

Value Description
country Country Object
city City Object
region Region Object
did_group_type DID Group Type Object
stock_keeping_units list of Stock Keeping Unit Objects

Filters

Filter Name Type Allow Blank Allow Array Description
id String No Yes A filter on the list based on the id field.
prefix String Yes Yes A filter on the list based on the prefix field.
local_prefix String Yes Yes A filter on the list based on the local_prefix field.
area_name String Yes Yes A filter on the list based on the area_name field.
is_metered Boolean No No A filter on the list based on the is_metered field.
allow_additional_channels Boolean No No A filter on the list based on the allow_additional_channels field.
features String No Yes A filter on the list based on the features field. Can be one/several/all of "voice", "t38", "sms". example: "voice,sms"
needs_registration Boolean No No A filter on the list based on the needs_registration field.
is_available Boolean No No A filter on the list based on the is_available field.
country.id Integer Yes Yes A filter on the list based on the "country.id" field.
region.id Integer Yes Yes A filter on the list based on the "region.id" field.
city.id Integer Yes Yes A filter on the list based on the "city.id" field.
did_group_type.id Integer Yes Yes A filter on the list based on the "did_group_type.id" field.

Sorting

Value Description
id sort by "id" field
country.name sort by "country.name" field
did_group_type.name sort by "did_group_type.name" field
prefix sort by "prefix" field
local_prefix sort by "local_prefix" field
is_metered sort by "is_metered" field
area_name sort by "area_name" field
allow_additional_channels sort by "allow_additional_channels" field

Examples

Example name Description
Sample 1 Simple request
Sample 2 Request with country, city, region, did_group_type, stock_keeping_units includes

Response

Response Body

Code Success Description
200 Yes list of DID Group Objects
401 No Unauthorized

Requests:

GET https://api.didww.com/did_groups HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "123",
      "type": "did_groups",
      "links": {
        "self": "https://api.didww.com/v3/did_groups/123"
      },
      "attributes": {
        "prefix": "77",
        "local_prefix": "",
        "features": [
          "voice",
          "sms"
        ],
        "is_metered": false,
        "area_name": "National",
        "allow_additional_channels": true
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/country",
            "related": "https://api.didww.com/v3/did_groups/123/country"
          }
        },
        "city": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/city",
            "related": "https://api.didww.com/v3/did_groups/123/city"
          }
        },
        "did_group_type": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/did_group_type",
            "related": "https://api.didww.com/v3/did_groups/123/did_group_type"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/region",
            "related": "https://api.didww.com/v3/did_groups/123/region"
          }
        },
        "stock_keeping_units": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/stock_keeping_units",
            "related": "https://api.didww.com/v3/did_groups/123/stock_keeping_units"
          }
        }
      },
      "meta": {
        "needs_registration": false,
        "is_available": true,
        "restrictions": null
      }
    },
    {
      "id": "124",
      "type": "did_groups",
      "links": {
        "self": "https://api.didww.com/v3/did_groups/124"
      },
      "attributes": {
        "prefix": "3",
        "local_prefix": "",
        "features": [
          "voice"
        ],
        "is_metered": false,
        "area_name": "Tel Aviv",
        "allow_additional_channels": true
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/country",
            "related": "https://api.didww.com/v3/did_groups/124/country"
          }
        },
        "city": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/city",
            "related": "https://api.didww.com/v3/did_groups/124/city"
          }
        },
        "did_group_type": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/did_group_type",
            "related": "https://api.didww.com/v3/did_groups/124/did_group_type"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/region",
            "related": "https://api.didww.com/v3/did_groups/124/region"
          }
        },
        "stock_keeping_units": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/stock_keeping_units",
            "related": "https://api.didww.com/v3/did_groups/124/stock_keeping_units"
          }
        }
      },
      "meta": {
        "needs_registration": false,
        "is_available": true,
        "restrictions": null
      }
    }
  ],
  "meta": {
    "total_records": 2
  },
  "links": {
    "first": "https://api.didww.com/v3/did_groups?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "next": "https://api.didww.com/v3/did_groups?page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}
GET https://api.didww.com/did_groups?include=country,city,region,did_group_type,stock_keeping_units HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "123",
      "type": "did_groups",
      "links": {
        "self": "https://api.didww.com/v3/did_groups/123"
      },
      "attributes": {
        "prefix": "77",
        "local_prefix": "",
        "features": [
          "voice",
          "sms"
        ],
        "is_metered": false,
        "area_name": "National",
        "allow_additional_channels": true
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/country",
            "related": "https://api.didww.com/v3/did_groups/123/country"
          },
          "data": {
            "type": "countries",
            "id": "100"
          }
        },
        "city": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/city",
            "related": "https://api.didww.com/v3/did_groups/123/city"
          },
          "data": null
        },
        "did_group_type": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/did_group_type",
            "related": "https://api.didww.com/v3/did_groups/123/did_group_type"
          },
          "data": {
            "type": "did_group_types",
            "id": "2"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/region",
            "related": "https://api.didww.com/v3/did_groups/123/region"
          },
          "data": null
        },
        "stock_keeping_units": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/123/relationships/stock_keeping_units",
            "related": "https://api.didww.com/v3/did_groups/123/stock_keeping_units"
          },
          "data": [
            {
              "type": "stock_keeping_units",
              "id": "2000"
            },
            {
              "type": "stock_keeping_units",
              "id": "2001"
            }
          ]
        }
      },
      "meta": {
        "needs_registration": false,
        "is_available": true,
        "restrictions": null
      }
    },
    {
      "id": "124",
      "type": "did_groups",
      "links": {
        "self": "https://api.didww.com/v3/did_groups/124"
      },
      "attributes": {
        "prefix": "3",
        "local_prefix": "",
        "features": [
          "voice"
        ],
        "is_metered": false,
        "area_name": "Tel Aviv",
        "allow_additional_channels": true
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/country",
            "related": "https://api.didww.com/v3/did_groups/124/country"
          },
          "data": {
            "type": "countries",
            "id": "100"
          }
        },
        "city": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/city",
            "related": "https://api.didww.com/v3/did_groups/124/city"
          },
          "data": {
            "type": "cities",
            "id": "182"
          }
        },
        "did_group_type": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/did_group_type",
            "related": "https://api.didww.com/v3/did_groups/124/did_group_type"
          },
          "data": {
            "type": "did_group_types",
            "id": "1"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/region",
            "related": "https://api.didww.com/v3/did_groups/124/region"
          },
          "data": null
        },
        "stock_keeping_units": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/124/relationships/stock_keeping_units",
            "related": "https://api.didww.com/v3/did_groups/124/stock_keeping_units"
          },
          "data": [
            {
              "type": "stock_keeping_units",
              "id": "2000"
            },
            {
              "type": "stock_keeping_units",
              "id": "2002"
            }
          ]
        }
      },
      "meta": {
        "needs_registration": false,
        "is_available": true,
        "restrictions": null
      }
    }
  ],
  "included": [
    {
      "id": "100",
      "type": "countries",
      "attributes": {
        "name": "Israel",
        "prefix": "972",
        "iso": "IL"
      }
    },
    {
      "id": "2",
      "type": "did_group_types",
      "attributes": {
        "name": "National"
      }
    },
    {
      "id": "1",
      "type": "did_group_types",
      "attributes": {
        "name": "Local"
      }
    },
    {
      "id": "2000",
      "type": "stock_keeping_units",
      "attributes": {
        "setup_price": "0.0",
        "monthly_price": "2.06",
        "channels_included_count": 0
      }
    },
    {
      "id": "2001",
      "type": "stock_keeping_units",
      "attributes": {
        "setup_price": "0.0",
        "monthly_price": "7.0",
        "channels_included_count": 2
      }
    },
    {
      "id": "2002",
      "type": "stock_keeping_units",
      "attributes": {
        "setup_price": "0.0",
        "monthly_price": "2.06",
        "channels_included_count": 0
      }
    },
    {
      "id": "2003",
      "type": "stock_keeping_units",
      "attributes": {
        "setup_price": "0.0",
        "monthly_price": "7.0",
        "channels_included_count": 2
      }
    },
    {
      "id": "182",
      "type": "cities",
      "attributes": {
        "name": "Tel Aviv"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/cities/182/relationships/country",
            "related": "https://api.didww.com/v3/cities/182/country"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/cities/182/relationships/region",
            "related": "https://api.didww.com/v3/cities/182/region"
          }
        }
      }
    }
  ],
  "meta": {
    "total_records": 2
  },
  "links": {
    "first": "https://api.didww.com/v3/did_groups?include=country%2Ccity%2Cregion%2Cdid_group_type%2Cstock_keeping_units&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "next": "https://api.didww.com/v3/did_groups?include=country%2Ccity%2Cregion%2Cdid_group_type%2Cstock_keeping_units&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

DID Group Object

Description

DID Object attributes and meta attributes.

Meta attributes aren’t available through includes

Attributes

area_name
Type: String
Description: DID Group area name. This will be the name of the city, or a designation applicable to the area code such as "National".
prefix
Type: String
Description: DID Group prefix (city or area calling code)
local_prefix
Type: String
Description: DID Group local prefix
features
Type: Array of strings
Description: Features available for the DID Group, including voice, sms and t38. A DID Group may have multiple features.
is_metered
Type: Boolean
Description: Defines if the DID Group supports metered services (per-minute billing).
allow_additional_channels
Type: Boolean
Description: Defines if channel capacity may be added to this DID Group.

Meta attributes

needs_registration
Type: Boolean
Description: Defines if end-user registration is required for this DID Group.
is_available
Type: Boolean
Description: Defines if numbers in this DID Group are currently in stock.
restrictions
Type: String
Description: Describes possible restrictions for the DID Group, such as "End User Registration is Required".

API Calls - Managing Your Inventory and Services

Balance

GET /balance

Get Balance

Description

Returns the prepaid balance as well as the available credit on your account.

Response

Response Body

Code Success Description
200 Yes Balance Object
401 No Unauthorized

Request:

GET https://api.didww.com/balance HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "john.doe@example.com",
    "type": "balances",
    "attributes": {
      "balance": "50.00",
      "credit": "10.00",
      "total_balance": "60.00"
    }
  }
}

Balance Object

Description

JSONAPI object that represents the user’s balance and has following attributes

Attributes

Balance Attributes

balance
Type: String
Description: Prepaid balance
credit
Type: String
Description: Available credit
total_balance
Type: String
Description: The net balance (balance + credit)

Order

GET /orders/{id}

Get Order

Description

Returns a single Order

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Order

Response

Response Body

Code Success Description
200 Yes Order Object
404 No Not Found
401 No Unauthorized

Request:

GET https://api.didww.com/orders/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "orders",
    "attributes": {
      "amount": "15.0",
      "status": "Completed",
      "created_at": "2017-06-25T08:21:41.795Z",
      "description": "DID",
      "items": [
        {
          "type": "did_order_items",
          "attributes": {
            "qty": 1,
            "setup_price": "0.0",
            "monthly_price": "15.0",
            "did_group_id": 223
          }
        }
      ]
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /orders

Get Orders

Description

Returns a collection of Orders

Request

URI Parameters

filters[<filter_name>]
optional
Type: Integer
Description: jsonapi filters
sort
optional
Type: String
Description: jsonapi sorting

Filters

Filter Name Type Allow Blank Allow Array Description
id String No Yes A filter on the list based on the id field.
status Array[String] Yes Yes A filter on the list based on the status field.
created_at_gteq DateTime No No A filter on the list based on the created_at_gteq.
created_at_lteq DateTime No No A filter on the list based on the created_at_lteq.

Sorting

Value Description
id sort by "id" field
status sort by "status" field
amount sort by "amount" field
created_at sort by "created_at" field
description sort by "description" field

Response

Response Body

Code Success Description
200 Yes list of Order Objects
401 No Unauthorized

Request:

GET https://api.didww.com/orders HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "data": {
        "id": "123",
        "type": "orders",
        "attributes": {
          "amount": "15.0",
          "status": "Completed",
          "created_at": "2017-06-25T08:21:41.795Z",
          "description": "DID",
          "items": [
            {
              "type": "did_order_items",
              "attributes": {
                "qty": 1,
                "setup_price": "0.0",
                "monthly_price": "15.0",
                "did_group_id": 223
              }
            }
          ]
        }
      }
    },
    {
      "data": {
        "id": "124",
        "type": "orders",
        "attributes": {
          "amount": "15.0",
          "status": "Completed",
          "created_at": "2017-06-25T08:21:41.795Z",
          "description": "DID",
          "items": [
            {
              "type": "did_order_items",
              "attributes": {
                "qty": 1,
                "setup_price": "0.0",
                "monthly_price": "15.0",
                "did_group_id": 223
              }
            }
          ]
        }
      }
    }
  ]
}
POST /orders

Create Order

Description

Creates Order

Request

Body

allow_back_ordering
optional
Type: Boolean
Description: Allowing back ordering
items
required
Type: Array<CreateOrderItem>
Description: Order items array

Order Item

type
required
Type: String
Description: Item object type: "did_order_items"
attributes
required
Type: OrderItemAttributes
Description: Order Item Attributes object

Order Item Attributes

qty
required
Type: Integer
Description: Quantity of services
sku_id
required
Type: Integer
Description: Stock Keeping Unit ID.

Examples

Example name Description
Sample 1 Order with allow_back_ordering equal "true"
Sample 2 Order with allow_back_ordering equal "false"

Response

Response Body

Code Success Description
200 Yes Order Object
404 No Not Found
401 No Unauthorized

Requests:

POST https://api.didww.com/orders HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "orders",
    "attributes": {
      "allow_back_ordering": true,
      "items": [
        {
          "type": "did_order_items",
          "attributes": {
            "qty": 15,
            "sku_id": 456
          }
        }
      ]
    }
  }
}

Responses:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "orders",
    "attributes": {
      "amount": "79.2",
      "status": "Pending",
      "created_at": "2017-06-25T14:56:31.513Z",
      "description": "DID",
      "items": [
        {
          "type": "did_order_items",
          "attributes": {
            "qty": 15,
            "setup_price": "5.00",
            "monthly_price": "5.00",
            "did_group_id": 457
          }
        }
      ]
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "is invalid",
      "detail": "items/0/sku_id - is invalid",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/items/0/sku_id"
      },
      "status": "422"
    }
  ]
}
POST https://api.didww.com/orders HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "orders",
    "attributes": {
      "allow_back_ordering": false,
      "items": [
        {
          "type": "did_order_items",
          "attributes": {
            "qty": 15,
            "sku_id": 456
          }
        }
      ]
    }
  }
}

Responses:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "orders",
    "attributes": {
      "amount": "79.2",
      "status": "Pending",
      "created_at": "2017-06-25T14:56:31.513Z",
      "description": "DID",
      "items": [
        {
          "type": "did_order_items",
          "attributes": {
            "qty": 15,
            "setup_price": "5.00",
            "monthly_price": "5.00",
            "did_group_id": 457
          }
        }
      ]
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "exceeds available DIDs count",
      "detail": "items/0/qty - exceeds available DIDs count",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/items/0/qty"
      },
      "status": "422"
    }
  ]
}
DELETE /orders/{id}

Delete Order

Description

Deletes Order

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Order

Request:

DELETE https://api.didww.com/orders/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 202 Deleted
Content-Type: application/vnd.api+json

No content
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Order not pending",
      "detail": "base - Order not pending",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/base"
      },
      "status": "422"
    }
  ]
}

Order Object

Description

Order Object attributes

Attributes

amount
Type: Integer
Description: Order Amount
status
Type: Enum
Description: Order status. One of "Pending", "Completed", "Canceled".
description
Type: String
Description: Order description
created_at
Type: DateTime
Description: Order created at DateTime
items
Type: Array<OrderItem>
Description: Order items array

Order Item

type
required
Type: String
Description: Item object type: "did_order_items"
attributes
Type: OrderItemAttributes
Description: Order Item Attributes object

Order Item Attributes

qty
Type: Integer
Description: Quantity of services
setup_price
Type: String
Description: Setup price for service.
monthly_price
Type: String
Description: Monthly price for service.
did_group_id
Type: Integer
Description: DID Group ID.

DID

GET /dids/{id}

Get DID

Description

Returns a single DID owned by your account.

Request

URI Parameters

id
required
Type: String
Description: Unique ID number allocated to this DID
includes
optional
Type: String
Description: jsonapi includes

Includes

Value Description
order Order Object
trunk Trunk Object
trunk.trunk_group Trunk Group Object
trunk_group Trunk Group Object
did_group DID Group Object
did_group.country Country Object
did_group.city City Object
did_group.region Region Object
did_group.did_group_type DID Group Type Object
did_group.stock_keeping_units Stock Keeping Unit Object

Examples

Example name Description
Sample 1 Simple request
Sample 2 Request with did_group include

Response

Response Body

Code Success Description
200 Yes DID Object
404 No Not Found
401 No Unauthorized

Requests:

GET https://api.didww.com/dids/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "dids",
    "attributes": {
      "blocked": false,
      "capacity_limit": 1,
      "description": "string",
      "terminated": false,
      "awaiting_registration": false,
      "number": "437xxxxxxxxx",
      "expires_at": "2017-06-25T08:21:41.795Z",
      "channels_included_count": 2,
      "pending_removal": false
    },
    "relationships": {
      "did_group": {
        "links": {
          "self": "https://api.didww.com/v3/dids/123/relationships/did_group",
          "related": "https://api.didww.com/v3/dids/123/did_group"
        }
      },
      "order": {
        "links": {
          "self": "https://api.didww.com/v3/dids/123/relationships/order",
          "related": "https://api.didww.com/v3/dids/123/order"
        }
      },
      "trunk": {
        "links": {
          "self": "https://api.didww.com/v3/dids/123/relationships/trunk",
          "related": "https://api.didww.com/v3/dids/123/trunk"
        }
      },
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/dids/123/relationships/trunk_group",
          "related": "https://api.didww.com/v3/dids/123/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET https://api.didww.com/dids/123?include=did_group HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "dids",
    "attributes": {
      "blocked": false,
      "capacity_limit": 1,
      "description": "string",
      "terminated": false,
      "awaiting_registration": false,
      "number": "437xxxxxxxxx",
      "expires_at": "2017-06-25T08:21:41.795Z",
      "channels_included_count": 2,
      "pending_removal": false
    },
    "relationships": {
      "did_group": {
        "links": {
          "self": "https://api.didww.com/v3/dids/123/relationships/did_group",
          "related": "https://api.didww.com/v3/dids/123/did_group"
        },
        "data": {
          "type": "did_groups",
          "id": "175"
        }
      },
      "order": {
        "links": {
          "self": "https://api.didww.com/v3/dids/123/relationships/order",
          "related": "https://api.didww.com/v3/dids/123/order"
        }
      },
      "trunk": {
        "links": {
          "self": "https://api.didww.com/v3/dids/123/relationships/trunk",
          "related": "https://api.didww.com/v3/dids/123/trunk"
        }
      },
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/dids/123/relationships/trunk_group",
          "related": "https://api.didww.com/v3/dids/123/trunk_group"
        }
      }
    },
    "included": [
      {
        "id": "456",
        "type": "did_groups",
        "links": {
          "self": "https://api.didww.com/v3/did_groups/456"
        },
        "attributes": {
          "prefix": "721",
          "local_prefix": "",
          "features": [
            "voice"
          ],
          "is_metered": false,
          "area_name": "National",
          "allow_additional_channels": true
        },
        "relationships": {
          "country": {
            "links": {
              "self": "https://api.didww.com/v3/did_groups/456/relationships/country",
              "related": "https://api.didww.com/v3/did_groups/456/country"
            }
          },
          "city": {
            "links": {
              "self": "https://api.didww.com/v3/did_groups/456/relationships/city",
              "related": "https://api.didww.com/v3/did_groups/456/city"
            }
          },
          "did_group_type": {
            "links": {
              "self": "https://api.didww.com/v3/did_groups/456/relationships/did_group_type",
              "related": "https://api.didww.com/v3/did_groups/456/did_group_type"
            }
          },
          "region": {
            "links": {
              "self": "https://api.didww.com/v3/did_groups/456/relationships/region",
              "related": "https://api.didww.com/v3/did_groups/456/region"
            }
          },
          "stock_keeping_units": {
            "links": {
              "self": "https://api.didww.com/v3/did_groups/456/relationships/stock_keeping_units",
              "related": "https://api.didww.com/v3/did_groups/456/stock_keeping_units"
            }
          }
        }
      }
    ]
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /dids

Get DIDs

Description

Returns a list of DIDs owned by your account.

Request

URI Parameters

filters[<filter_name>]
optional
Type: Integer, String, Boolean
Description: jsonapi filters
includes
optional
Type: String
Description: jsonapi includes
sort
optional
Type: String
Description: jsonapi sorting

Includes

Value Description
order Order Object
trunk Trunk Object
trunk.trunk_group Trunk Group Object
trunk_group Trunk Group Object
did_group DID Group Object
did_group.country Country Object
did_group.city City Object
did_group.region Region Object
did_group.did_group_type DID Group Type Object
did_group.stock_keeping_units Stock Keeping Unit Object

Filters

Filter Name Type Allow Blank Allow Array Description
number String Yes Yes A filter on the list based on the DID number field.
description Integer Yes Yes A filter on the list based on the description field.
terminated Boolean No No A filter on the list based on the terminated field.
awaiting_registration Boolean No No A filter on the list based on the awaiting_registration field.
pending_removal Boolean No No A filter on the list based on the pending_removal field.
did_group.id Boolean Yes Yes A filter on the list based on the ID field of did_group relationship.
country.id Boolean Yes Yes A filter on the list based on the ID field of country relationship.
region.id Boolean Yes Yes A filter on the list based on the ID field of region relationship.
city.id Boolean Yes Yes A filter on the list based on the ID field of region relationship.

Sorting

Value Description
id sort by 'id' field
blocked sort by 'blocked' field
pending sort by 'pending' field
awaiting_registration sort by 'awaiting_registration' field
capacity_limit sort by 'capacity_limit' field
description sort by 'description' field
terminated sort by 'terminated' field
number sort by 'number' field
expires_at sort by 'expires_at' field
channels_included_count sort by 'channels_included_count' field

Examples

Example name Description
Sample 1 Simple request
Sample 2 Request with did_group include

Response

Response Body

Code Success Description
200 Yes list of DIDs Objects
401 No Unauthorized

Requests:

GET https://api.didww.com/dids HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "data": {
        "id": "123",
        "type": "dids",
        "attributes": {
          "blocked": false,
          "capacity_limit": 1,
          "description": "string",
          "terminated": false,
          "awaiting_registration": false,
          "number": "437xxxxxxxxx",
          "expires_at": "2017-06-25T08:21:41.795Z",
          "channels_included_count": 2,
          "pending_removal": false
        },
        "relationships": {
          "did_group": {
            "links": {
              "self": "https://api.didww.com/v3/dids/123/relationships/did_group",
              "related": "https://api.didww.com/v3/dids/123/did_group"
            }
          },
          "order": {
            "links": {
              "self": "https://api.didww.com/v3/dids/123/relationships/order",
              "related": "https://api.didww.com/v3/dids/123/order"
            }
          },
          "trunk": {
            "links": {
              "self": "https://api.didww.com/v3/dids/123/relationships/trunk",
              "related": "https://api.didww.com/v3/dids/123/trunk"
            }
          },
          "trunk_group": {
            "links": {
              "self": "https://api.didww.com/v3/dids/123/relationships/trunk_group",
              "related": "https://api.didww.com/v3/dids/123/trunk_group"
            }
          }
        }
      }
    },
    {
      "data": {
        "id": "124",
        "type": "dids",
        "attributes": {
          "blocked": false,
          "capacity_limit": 1,
          "description": "string",
          "terminated": false,
          "awaiting_registration": false,
          "number": "437xxxxxxxxx",
          "expires_at": "2017-06-25T08:21:41.795Z",
          "channels_included_count": 2,
          "pending_removal": false
        },
        "relationships": {
          "did_group": {
            "links": {
              "self": "https://api.didww.com/v3/dids/124/relationships/did_group",
              "related": "https://api.didww.com/v3/dids/124/did_group"
            }
          },
          "order": {
            "links": {
              "self": "https://api.didww.com/v3/dids/124/relationships/order",
              "related": "https://api.didww.com/v3/dids/124/order"
            }
          },
          "trunk": {
            "links": {
              "self": "https://api.didww.com/v3/dids/124/relationships/trunk",
              "related": "https://api.didww.com/v3/dids/124/trunk"
            }
          },
          "trunk_group": {
            "links": {
              "self": "https://api.didww.com/v3/dids/124/relationships/trunk_group",
              "related": "https://api.didww.com/v3/dids/124/trunk_group"
            }
          }
        }
      }
    }
  ],
  "meta": {
    "total_records": 2
  },
  "links": {
    "first": "https://api.didww.com/v3/dids&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "https://api.didww.com/v3/dids&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}
GET https://api.didww.com/dids?include=did_group HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "data": {
        "id": "123",
        "type": "dids",
        "attributes": {
          "blocked": false,
          "capacity_limit": 1,
          "description": "string",
          "terminated": false,
          "awaiting_registration": false,
          "number": "437xxxxxxxxx",
          "expires_at": "2017-06-25T08:21:41.795Z",
          "channels_included_count": 2,
          "pending_removal": false
        },
        "relationships": {
          "did_group": {
            "links": {
              "self": "https://api.didww.com/v3/dids/123/relationships/did_group",
              "related": "https://api.didww.com/v3/dids/123/did_group"
            },
            "data": {
              "type": "did_groups",
              "id": "456"
            }
          },
          "order": {
            "links": {
              "self": "https://api.didww.com/v3/dids/123/relationships/order",
              "related": "https://api.didww.com/v3/dids/123/order"
            }
          },
          "trunk": {
            "links": {
              "self": "https://api.didww.com/v3/dids/123/relationships/trunk",
              "related": "https://api.didww.com/v3/dids/123/trunk"
            }
          },
          "trunk_group": {
            "links": {
              "self": "https://api.didww.com/v3/dids/123/relationships/trunk_group",
              "related": "https://api.didww.com/v3/dids/123/trunk_group"
            }
          }
        }
      }
    },
    {
      "data": {
        "id": "124",
        "type": "dids",
        "attributes": {
          "blocked": false,
          "capacity_limit": 1,
          "description": "string",
          "terminated": false,
          "awaiting_registration": false,
          "number": "437xxxxxxxxx",
          "expires_at": "2017-06-25T08:21:41.795Z",
          "channels_included_count": 2,
          "pending_removal": false
        },
        "relationships": {
          "did_group": {
            "links": {
              "self": "https://api.didww.com/v3/dids/124/relationships/did_group",
              "related": "https://api.didww.com/v3/dids/124/did_group"
            },
            "data": {
              "type": "did_groups",
              "id": "457"
            }
          },
          "order": {
            "links": {
              "self": "https://api.didww.com/v3/dids/124/relationships/order",
              "related": "https://api.didww.com/v3/dids/124/order"
            }
          },
          "trunk": {
            "links": {
              "self": "https://api.didww.com/v3/dids/124/relationships/trunk",
              "related": "https://api.didww.com/v3/dids/124/trunk"
            }
          },
          "trunk_group": {
            "links": {
              "self": "https://api.didww.com/v3/dids/124/relationships/trunk_group",
              "related": "https://api.didww.com/v3/dids/124/trunk_group"
            }
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "456",
      "type": "did_groups",
      "links": {
        "self": "https://api.didww.com/v3/did_groups/456"
      },
      "attributes": {
        "prefix": "720",
        "local_prefix": "",
        "features": [
          "voice"
        ],
        "is_metered": false,
        "area_name": "National",
        "allow_additional_channels": true
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/456/relationships/country",
            "related": "https://api.didww.com/v3/did_groups/456/country"
          }
        },
        "city": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/456/relationships/city",
            "related": "https://api.didww.com/v3/did_groups/456/city"
          }
        },
        "did_group_type": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/456/relationships/did_group_type",
            "related": "https://api.didww.com/v3/did_groups/456/did_group_type"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/456/relationships/region",
            "related": "https://api.didww.com/v3/did_groups/456/region"
          }
        },
        "stock_keeping_units": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/456/relationships/stock_keeping_units",
            "related": "https://api.didww.com/v3/did_groups/456/stock_keeping_units"
          }
        }
      }
    },
    {
      "id": "457",
      "type": "did_groups",
      "links": {
        "self": "https://api.didww.com/v3/did_groups/457"
      },
      "attributes": {
        "prefix": "11",
        "local_prefix": "",
        "features": [
          "voice"
        ],
        "is_metered": false,
        "area_name": "Mobile",
        "allow_additional_channels": true
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/457/relationships/country",
            "related": "https://api.didww.com/v3/did_groups/457/country"
          }
        },
        "city": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/457/relationships/city",
            "related": "https://api.didww.com/v3/did_groups/457/city"
          }
        },
        "did_group_type": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/457/relationships/did_group_type",
            "related": "https://api.didww.com/v3/did_groups/457/did_group_type"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/457/relationships/region",
            "related": "https://api.didww.com/v3/did_groups/457/region"
          }
        },
        "stock_keeping_units": {
          "links": {
            "self": "https://api.didww.com/v3/did_groups/457/relationships/stock_keeping_units",
            "related": "https://api.didww.com/v3/did_groups/457/stock_keeping_units"
          }
        }
      }
    }
  ],
  "meta": {
    "total_records": 2
  },
  "links": {
    "first": "https://api.didww.com/v3/dids?include=did_group&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "https://api.didww.com/v3/dids?include=did_group&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}
PATCH /dids/{id}

Update DID

Description

Update the settings of a single DID owned by your account.

Request

URI Parameters

id
required
Type: String
Description: Unique ID number allocated to this DID
includes
optional
Type: String
Description: jsonapi includes

Includes

Value Description
trunk Trunk Object

Examples

Example name Description
Sample 1 Simple resource patch
Sample 2 Assign Trunk to DID
Sample 3 Assign Trunk Group to DID

Response

Response Body

Code Success Description
200 Yes DID Object
404 No Not Found
401 No Unauthorized

Requests:

PATCH https://api.didww.com/dids/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "123",
    "type": "dids",
    "attributes": {
      "terminated": false,
      "pending_removal": false,
      "description": "string",
      "capacity_limit": 1
    }
  }
}

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "dids",
    "attributes": {
      "blocked": false,
      "capacity_limit": 1,
      "description": "string",
      "terminated": false,
      "awaiting_registration": false,
      "number": "437xxxxxxxxx",
      "expires_at": "2017-06-25T08:21:41.795Z",
      "channels_included_count": 2,
      "pending_removal": false
    }
  },
  "relationships": {
    "did_group": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/did_group",
        "related": "https://api.didww.com/v3/dids/123/did_group"
      }
    },
    "order": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/order",
        "related": "https://api.didww.com/v3/dids/123/order"
      }
    },
    "trunk": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/trunk",
        "related": "https://api.didww.com/v3/dids/123/trunk"
      }
    },
    "trunk_group": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/trunk_group",
        "related": "https://api.didww.com/v3/dids/123/trunk_group"
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "must be less than or equal to 32767",
      "detail": "capacity_limit - must be less than or equal to 32767",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/capacity_limit"
      },
      "status": "422"
    }
  ]
}
PATCH https://api.didww.com/dids/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "123",
    "type": "dids",
    "relationships": {
      "trunk": {
        "data": {
          "type": "trunks",
          "id": "223"
        }
      }
    }
  }
}

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "dids",
    "attributes": {
      "blocked": false,
      "capacity_limit": 1,
      "description": "string",
      "terminated": false,
      "awaiting_registration": false,
      "number": "437xxxxxxxxx",
      "expires_at": "2017-06-25T08:21:41.795Z",
      "channels_included_count": 2,
      "pending_removal": false
    }
  },
  "relationships": {
    "did_group": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/did_group",
        "related": "https://api.didww.com/v3/dids/123/did_group"
      }
    },
    "order": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/order",
        "related": "https://api.didww.com/v3/dids/123/order"
      }
    },
    "trunk": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/trunk",
        "related": "https://api.didww.com/v3/dids/123/trunk"
      }
    },
    "trunk_group": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/trunk_group",
        "related": "https://api.didww.com/v3/dids/123/trunk_group"
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "should exist",
      "detail": "users_mapping_id - should exist",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/users_mapping_id"
      },
      "status": "422"
    }
  ]
}
PATCH https://api.didww.com/dids/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "123",
    "type": "dids",
    "relationships": {
      "trunk_group": {
        "data": {
          "type": "trunk_groups",
          "id": "223"
        }
      }
    }
  }
}

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "dids",
    "attributes": {
      "blocked": false,
      "capacity_limit": 1,
      "description": "string",
      "terminated": false,
      "awaiting_registration": false,
      "number": "437xxxxxxxxx",
      "expires_at": "2017-06-25T08:21:41.795Z",
      "channels_included_count": 2,
      "pending_removal": false
    }
  },
  "relationships": {
    "did_group": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/did_group",
        "related": "https://api.didww.com/v3/dids/123/did_group"
      }
    },
    "order": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/order",
        "related": "https://api.didww.com/v3/dids/123/order"
      }
    },
    "trunk": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/trunk",
        "related": "https://api.didww.com/v3/dids/123/trunk"
      }
    },
    "trunk_group": {
      "links": {
        "self": "https://api.didww.com/v3/dids/123/relationships/trunk_group",
        "related": "https://api.didww.com/v3/dids/123/trunk_group"
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "should exist",
      "detail": "users_mapping_id - should exist",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/users_mapping_id"
      },
      "status": "422"
    }
  ]
}

DID Object

Description

DID Object attributes

Attributes

blocked
Type: Boolean
Description: Identifier for a blocked DID. Blocked DIDs are numbers that have expired, have been cancelled or have been suspended by DIDWW.
awaiting_registration
Type: Boolean
Description: Identifier for a DID that is awaiting registration.
terminated
Type: Boolean
Description: Identifier for terminated DIDs that will be removed from service at the end of the billing cycle.
pending_removal
Type: Boolean
Description: Identifier for DIDs that are pending removal from your account.
description
Type: String
Description: DID custom description
number
Type: String
Description: The actual DID number in the format [country code][area code][subscriber number].
capacity_limit
Type: Integer
Description: The capacity limit (maximum number of simultaneous calls) for this DID.
channels_included_count
Type: Integer
Description: The number of channels included with this DID.
expires_at
Type: DateTime
Description: DateTime when the DID expired or will expire. DateTime is in the ISO 8601 format "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", where "SSS" are milliseconds and 'Z' denotes Zulu time (UTC).

Trunk

GET /trunks/{id}

Get Trunk

Description

You can get several type of trunks: SIP, PSTN, H323, IAX2.

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Trunk
includes
optional
Type: String
Description: jsonapi includes

Includes

Value Description
trunk_group Trunk Group Object

Examples

Example name Description
Sample 1 Request for SIP trunk
Sample 2 Request for PSTN trunk
Sample 3 Request for IAX2 trunk
Sample 4 Request for H323 trunk
Sample 5 Request for PSTN trunk with trunk_group include

Response

Body

Code Success Description
200 Yes Trunk Object
404 No Not Found
401 No Unauthorized

Requests:

GET https://api.didww.com/trunks/1 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "1",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 10,
      "weight": 2,
      "name": "Office",
      "cli_format": "e164",
      "cli_prefix": "+",
      "description": null,
      "ringing_timeout": 30,
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "username",
          "host": "example.com",
          "port": null,
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": true,
          "auth_enabled": true,
          "auth_user": "username",
          "auth_password": "password",
          "auth_from_user": "Office",
          "auth_from_domain": "example.com",
          "sst_enabled": false,
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_accept_501": true,
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": false,
          "rtp_timeout": 30,
          "force_symmetric_rtp": false,
          "symmetric_rtp_ignore_rtcp": false,
          "rerouting_disconnect_code_ids": [
            58,
            59,
            1505
          ],
          "sst_session_expires": null,
          "sst_refresh_method_id": 1
        }
      },
      "preferred_server": "Europe"
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/1/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/1/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 1 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET https://api.didww.com/trunks/2 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "2",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 5,
      "weight": 65535,
      "name": "Office Mobile",
      "cli_format": "e164",
      "cli_prefix": null,
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "pstn_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx"
        }
      },
      "preferred_server": null
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/2/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/2/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 2 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET https://api.didww.com/trunks/3 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "3",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 9,
      "weight": 65535,
      "name": "Office IAX2",
      "cli_format": "e164",
      "cli_prefix": "+1",
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "iax2_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx",
          "host": "example.com",
          "port": null,
          "auth_user": "username",
          "auth_password": "password",
          "codec_ids": [
            9,
            6
          ]
        }
      },
      "preferred_server": "USA"
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/3/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/3/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 4 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET https://api.didww.com/trunks/4 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "4",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 18,
      "weight": 65535,
      "name": "Office H323",
      "cli_format": "e164",
      "cli_prefix": "+1",
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "h323_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx",
          "host": "example.com",
          "port": null,
          "codec_ids": [
            9,
            6
          ]
        }
      },
      "preferred_server": "USA"
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/4/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/4/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 4 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET https://api.didww.com/trunks/2?include=trunk_group HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "2",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 5,
      "weight": 65535,
      "name": "Office Mobile",
      "cli_format": "e164",
      "cli_prefix": null,
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "pstn_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx"
        }
      },
      "preferred_server": null
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/2/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/2/trunk_group"
        },
        "data": {
          "type": "trunk_groups",
          "id": "100"
        }
      }
    }
  },
  "included": [
    {
      "id": "100",
      "type": "trunk_groups",
      "links": {
        "self": "https://api.didww.com/v3/trunk_groups/100"
      },
      "attributes": {
        "created_at": "2017-06-25T14:56:31.513Z",
        "updated_at": "2017-06-25T14:56:31.513Z",
        "name": "Common Group",
        "capacity_limit": 69
      },
      "relationships": {
        "trunks": {
          "links": {
            "self": "https://api.didww.com/v3/trunk_groups/100/relationships/trunks",
            "related": "https://api.didww.com/v3/trunk_groups/100/trunks"
          }
        }
      },
      "meta": {
        "trunks_count": 1
      }
    }
  ]
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 2 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /trunks

Get Trunks

Description

Returns Collection of Trunks

Request

URI Parameters

filters[<filter_name>]
optional
Type: Integer
Description: jsonapi filters
sort
optional
Type: String
Description: jsonapi sorting

Filters

Filter Name Type Allow Blank Allow Array Description
id String No Yes A filter on the list based on the "id" field.
name String Yes Yes A filter on the list based on the "name" field.
configuration.type String Yes Yes A filter on the list based on the type name of configuration.

Sorting

Value Description
id sort by "id" field
name sort by "name" field
priority sort by "priority" field
capacity_limit sort by "capacity_limit" field
weight sort by "weight" field
cli_format sort by "cli_format" field
cli_prefix sort by "cli_prefix" field
description sort by "description" field
ringing_timeout sort by "ringing_timeout" field

Request:

GET https://api.didww.com/trunks HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "1",
      "type": "trunks",
      "attributes": {
        "priority": 1,
        "capacity_limit": 10,
        "weight": 2,
        "name": "Office",
        "cli_format": "e164",
        "cli_prefix": "+",
        "description": null,
        "ringing_timeout": 30,
        "configuration": {
          "type": "sip_configurations",
          "attributes": {
            "username": "username",
            "host": "example.com",
            "port": null,
            "codec_ids": [
              9,
              7
            ],
            "rx_dtmf_format_id": 1,
            "tx_dtmf_format_id": 1,
            "resolve_ruri": true,
            "auth_enabled": true,
            "auth_user": "username",
            "auth_password": "password",
            "auth_from_user": "Office",
            "auth_from_domain": "example.com",
            "sst_enabled": false,
            "sst_min_timer": 600,
            "sst_max_timer": 900,
            "sst_accept_501": true,
            "sip_timer_b": 8000,
            "dns_srv_failover_timer": 2000,
            "rtp_ping": false,
            "rtp_timeout": 30,
            "force_symmetric_rtp": false,
            "symmetric_rtp_ignore_rtcp": false,
            "rerouting_disconnect_code_ids": [
              58,
              59,
              1505
            ],
            "sst_session_expires": null,
            "sst_refresh_method_id": 1
          }
        },
        "preferred_server": "Europe"
      },
      "relationships": {
        "trunk_group": {
          "links": {
            "self": "https://api.didww.com/v3/trunks/1/relationships/trunk_group",
            "related": "https://api.didww.com/v3/trunks/1/trunk_group"
          }
        }
      }
    },
    {
      "id": "2",
      "type": "trunks",
      "attributes": {
        "priority": 1,
        "capacity_limit": 5,
        "weight": 65535,
        "name": "Office Mobile",
        "cli_format": "e164",
        "cli_prefix": null,
        "description": null,
        "ringing_timeout": null,
        "configuration": {
          "type": "pstn_configurations",
          "attributes": {
            "dst": "1xxxxxxxxx"
          }
        },
        "preferred_server": null
      },
      "relationships": {
        "trunk_group": {
          "links": {
            "self": "https://api.didww.com/v3/trunks/2/relationships/trunk_group",
            "related": "https://api.didww.com/v3/trunks/2/trunk_group"
          }
        }
      }
    }
  ],
  "meta": {
    "total_records": 2
  },
  "links": {
    "first": "https://api.didww.com/v3/trunks?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "https://api.didww.com/v3/trunks?page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}
POST /trunks

Create Trunk

Description

A trunk can be created by making a POST request to the /trunks endpoint.

You can create several type of trunks: SIP, PSTN, H323, IAX2.

Request

Body Parameters

type
Type: String
Description: trunks
attributes
required
Type: object
Nullable: No
Description: Trunk configuration complex object

Data Attributes

priority
required
Type: Integer
Nullable: No
Description: The priority of this target host. DIDWW will attempt to contact the target trunk with the lowest-numbered priority; target trunk with the same priority will be tried in an order defined by the weight field. The range is 0-65535. See RFC 2782 for more details
weight
required
Type: Integer
Nullable: No
Description: A trunk selection mechanism. The weight field specifies a relative weight for entries with the same priority. Larger weights will be given a proportionately higher probability of being selected. The range of this number is 0-65535. In the presence of records containing weights greater than 0, records with weight 0 will have a very small chance of being selected. See RFC 2782 for more details
capacity_limit
required
Type: Integer
Nullable: No
Description: Maximum number of simultaneous calls for the trunk
ringing_timeout
required
Type: Integer
Nullable: No
Description: After which it will be end transaction with internal disconnect code 'Ringing timeout' if the call was not connected.
name
required
Type: String
Nullable: No
Description: Friendly name of the trunk
cli_format
required
Type: String
Nullable: No
Description:
RAW - Do not alter CLI (default)
164 - Attempt to convert CLI to E.164 format
Local - Attempt to convert CLI to Localized format
* CLI format conversion may not work correctly for phone calls originating from outside the country of that specific DID"
cli_prefix
required
Type: String
Nullable: No
Description: You may prefix the CLI with an optional '+' sign followed by up to 6 characters, including digits and '#'
description
optional
Type: String
Nullable: No
Description: Optional description of trunk
preferred_server
optional
Type: String
Nullable: No
Description: Preferred server for your voice route. In general, you should choose the server that is the closest to your location ["LOCAL", "USA", "DE"] or omit.
configuration
Type: one of
sip_configurations
pstn_configurations
iax2_configurations
h323_configurations
Description: Trunk configuration complex object

Attributes Configuration

type
required
Type: sip_configurations
Nullable: No
Description: SIP configuration complex object
attributes
required
Type: sip_configuration_attrbutes
Nullable: No
Description: SIP configuration attributes object
type
required
Type: pstn_configurations
Nullable: No
Description: PSTN configuration complex object
attributes
required
Type: pstn_configuration_attrbutes
Nullable: No
Description: PSTN configuration attributes object
type
required
Type: iax2_configurations
Nullable: No
Description: IAX2 configuration complex object
attributes
required
Type: iax2_configuration_attrbutes
Nullable: No
Description: IAX2 configuration attributes object
type
required
Type: h323_configurations
Nullable: No
Description: H323 configuration complex object
attributes
required
Type: h323_configuration_attrbutes
Nullable: No
Description: H323 configuration attributes object

Configuration Attributes

username
optional
Type: String
Nullable: No
Description: User part of R-URI in INVITE request.You also may use "{DID}" pattern which will be replaced by called DID number in E164 format. For example, you can set Username to "+{DID}"; if you wish to have it in +E164 format
host
optional
Type: String
Nullable: No
Description: Host part of R-URI in INVITE request
auth_user
optional
Type: String
Nullable: No
Description: Optional authorization user for the SIP server
auth_password
optional
Type: String
Nullable: No
Description: Optional authorization password for the SIP server
auth_from_user
optional
Type: String
Nullable: No
Description: Specify user in a "from" field instead of CallerID (overrides CallerID). Some equipment require "from"; to be equivalent to "Auth user";
auth_from_domain
optional
Type: String
Nullable: No
Description: Sets default "from" domain in SIP messages. Some equipment may require specific "From" Domain
sst_refresh_method_id
optional
Type: Integer
Nullable: No
Description: SIP method which will be used for session update.
See RFC 4028for more details.
Possible values:
1 - Invite
2 - Update
3 - Update fallback Invite
sip_timer_b
optional
Type: Integer
Nullable: No
Description: INVITE transaction timeout (Default 8000ms). See RFC 3261 Section 17.1.1.2 for more details
dns_srv_failover_timer
optional
Type: Integer
Nullable: No
Description: Invite transaction timeout for each of gateways with DNS SRV rerouting (Default 2000ms)
rtp_ping
optional
Type: Integer
Nullable: No
Description: Use RTP PING when connecting a call. After establishing the call, DIDWW will send empty RTP packet "RTP PING". It is neccessary if both parties operate in Symmetric RTP / Comedia mode and expect the other party to start sending RTP first.
rtp_timeout
optional
Type: Integer
Nullable: No
Description: Disconnect call if the RTP packets do not arrive within the specified time
sst_min_timer
optional
Type: Integer
Nullable: No
Description: Minimal SIP Session timer value (Default 600 seconds). See RFC 4028 for more details
sst_max_timer
optional
Type: Integer
Nullable: No
Description: Maximal SIP Session timer value (Default 900 seconds). See RFC 4028 for more details
sst_session_expires
optional
Type: Integer
Nullable: No
Description: Session-Expires header value. Optional, should be in range sst_min_timer ... sst_max_timer.
See RFC 4028 for more details
port
optional
Type: Integer
Nullable: No
Description: Port part of R-URI in INVITE request (is not mandatory).If port is null, SRV record will be resolved (or A record if SRV is unavailable)
rx_dtmf_format_id
optional
Type: Integer
Nullable: No
Description: The method id for receiving DTMF signals from customer equipment
Possible values:
1 - RFC 2833
2 - SIP INFO application/dtmf-relay OR application/dtmf
3 - RFC 2833 OR SIP INFO
tx_dtmf_format_id
optional
Type: Integer
Nullable: No
Description: The method of sending DTMF signals to customer equipment
Possible values:
1 - Disable sending
2 - RFC 2833
3 - SIP INFO application/dtmf-relay
4 - SIP INFO application/dtmf
force_symmetric_rtp
optional
Type: Boolean
Nullable: No
Description: Forced to work in Symmetric RTP / COMEDIA mode
symmetric_rtp_ignore_rtcp
optional
Type: Boolean
Nullable: No
Description: Avoid switching RTP session based on RTCP packet while working in Symmetric RTP / COMEDIA. Only RTP packets will be considered
sst_enabled
optional
Type: Boolean
Nullable: No
Description: Enable SIP Session timers customization. SIP session timers are used to make sure that a session (dialog) is still alive, even though there may have been a long time since the last in-dialog message. If the other end is not responding, the dialog will be hung up automatically. SIP session timers need to be supported by all end points for it to work. It's a SIP extension, standardized by the IETF. See RFC 4028 for more details
sst_accept_501
optional
Type: Boolean
Nullable: No
Description: Do not drop the call after receiving SIP 501 response for non-critical messages
auth_enabled
optional
Type: Boolean
Nullable: No
Description: Enable authorization for the SIP server
resolve_ruri
optional
Type: Boolean
Nullable: No
Description: Replace host part of the R-URI by resolved IP address
rerouting_disconnect_code_ids
optional
Type: Array
Nullable: No
Description: Rerouting disconnect codes
codec_ids
optional
Type: Array
Nullable: No
Description: Codecs
dst
optional
Type: String
Nullable: No
Description: Phone number's
dst
optional
Type: String
Nullable: No
Description: Phone number's
host
optional
Type: String
Nullable: No
Description: Destination server
port
optional
Type: String
Nullable: No
Description: Destination port
auth_user
optional
Type: String
Nullable: No
Description: Optional authorization user
auth_password
optional
Type: String
Nullable: No
Description: Optional authorization password
codec_ids
optional
Type: Array
Nullable: No
Description:
dst
optional
Type: String
Nullable: No
Description: Phone number's
host
optional
Type: String
Nullable: No
Description: Destination server
port
optional
Type: String
Nullable: No
Description: Destination port
codec_ids
optional
Type: Array
Nullable: No
Description:

Examples

Example name Description
Sample 1 Create SIP trunk
Sample 2 Create PSTN trunk
Sample 3 Create IAX2 trunk
Sample 4 Create H323 trunk

Response

Body

Code Success Description
201 Yes Trunk Object
422 No Unprocessable Entity
401 No Unauthorized

Requests:

POST https://api.didww.com/trunks HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "trunks",
    "attributes": {
      "priority": "1",
      "weight": "2",
      "capacity_limit": 10,
      "ringing_timeout": 30,
      "name": "Office",
      "cli_format": "e164",
      "cli_prefix": "+",
      "description": "custom description",
      "preferred_server": "USA",
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "username",
          "host": "example.com",
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": "true",
          "auth_enabled": true,
          "auth_user": "username",
          "auth_password": "password",
          "auth_from_user": "Office",
          "auth_from_domain": "example.com",
          "sst_enabled": "false",
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_refresh_method_id": 1,
          "sst_accept_501": "true",
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": "false",
          "rtp_timeout": 30,
          "force_symmetric_rtp": "false",
          "symmetric_rtp_ignore_rtcp": "false",
          "rerouting_disconnect_code_ids": [
            58,
            59
          ],
          "port": 5060
        }
      }
    }
  }
}

Responses:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "1",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 10,
      "weight": 2,
      "name": "Office",
      "cli_format": "e164",
      "cli_prefix": "+",
      "description": "custom description",
      "ringing_timeout": 30,
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "username",
          "host": "example.com",
          "port": 5060,
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": true,
          "auth_enabled": true,
          "auth_user": "username",
          "auth_password": "password",
          "auth_from_user": "Office",
          "auth_from_domain": "example.com",
          "sst_enabled": false,
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_accept_501": true,
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": false,
          "rtp_timeout": 30,
          "force_symmetric_rtp": false,
          "symmetric_rtp_ignore_rtcp": false,
          "rerouting_disconnect_code_ids": [
            58,
            59
          ],
          "sst_session_expires": null,
          "sst_refresh_method_id": 1
        }
      },
      "preferred_server": "USA"
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/1/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/1/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "has already been taken",
      "detail": "name - has already been taken",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}
POST https://api.didww.com/trunks HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "trunks",
    "attributes": {
      "name": "Office Mobile",
      "capacity_limit": 5,
      "configuration": {
        "type": "pstn_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx"
        }
      }
    }
  }
}

Responses:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "2",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 5,
      "weight": 65535,
      "name": "Office Mobile",
      "cli_format": "e164",
      "cli_prefix": null,
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "pstn_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx"
        }
      },
      "preferred_server": null
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/2/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/2/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "has already been taken",
      "detail": "name - has already been taken",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}
POST https://api.didww.com/trunks HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "trunks",
    "attributes": {
      "name": "Office IAX2",
      "capacity_limit": 9,
      "preferred_server": "USA",
      "cli_format": "e164",
      "cli_prefix": "+1",
      "configuration": {
        "type": "iax2_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx",
          "host": "example.com",
          "auth_user": "username",
          "auth_password": "password",
          "codec_ids": [
            9,
            6
          ]
        }
      }
    }
  }
}

Responses:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "3",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 9,
      "weight": 65535,
      "name": "Office IAX2",
      "cli_format": "e164",
      "cli_prefix": "+1",
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "iax2_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx",
          "host": "example.com",
          "port": null,
          "auth_user": "username",
          "auth_password": "password",
          "codec_ids": [
            9,
            6
          ]
        }
      },
      "preferred_server": "USA"
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/3/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/3/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "has already been taken",
      "detail": "name - has already been taken",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}
POST https://api.didww.com/trunks HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "trunks",
    "attributes": {
      "name": "Office H323",
      "capacity_limit": 18,
      "preferred_server": "USA",
      "cli_format": "e164",
      "cli_prefix": "+1",
      "configuration": {
        "type": "h323_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx",
          "host": "example.com",
          "codec_ids": [
            9,
            6
          ]
        }
      }
    }
  }
}

Responses:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "4",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 18,
      "weight": 65535,
      "name": "Office H323",
      "cli_format": "e164",
      "cli_prefix": "+1",
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "h323_configurations",
        "attributes": {
          "dst": "1xxxxxxxxx",
          "host": "example.com",
          "port": null,
          "codec_ids": [
            9,
            6
          ]
        }
      },
      "preferred_server": "USA"
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/4/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/4/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "has already been taken",
      "detail": "name - has already been taken",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}
PATCH /trunks/{id}

Update Trunk

Description

Updates Trunk

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Trunk

Data Attributes

priority
Type: Integer
Nullable: No
Description: The priority of this target host. DIDWW will attempt to contact the target trunk with the lowest-numbered priority; target trunk with the same priority will be tried in an order defined by the weight field. The range is 0-65535. See RFC 2782 for more details
weight
Type: Integer
Nullable: No
Description: A trunk selection mechanism. The weight field specifies a relative weight for entries with the same priority. Larger weights will be given a proportionately higher probability of being selected. The range of this number is 0-65535. In the presence of records containing weights greater than 0, records with weight 0 will have a very small chance of being selected. See RFC 2782 for more details
capacity_limit
Type: Integer
Nullable: No
Description: Maximum number of simultaneous calls for the trunk
ringing_timeout
Type: Integer
Nullable: No
Description: After which it will be end transaction with internal disconnect code 'Ringing timeout' if the call was not connected.
name
Type: String
Nullable: No
Description: Friendly name of the trunk
cli_format
Type: String
Nullable: No
Description:
RAW - Do not alter CLI (default)
164 - Attempt to convert CLI to E.164 format
Local - Attempt to convert CLI to Localized format
* CLI format conversion may not work correctly for phone calls originating from outside the country of that specific DID"
cli_prefix
Type: String
Nullable: No
Description: You may prefix the CLI with an optional '+' sign followed by up to 6 characters, including digits and '#'
description
Type: String
Nullable: No
Description: Optional description of trunk
preferred_server
Type: String
Nullable: No
Description: Preferred server for your voice route. In general, you should choose the server that is the closest to your location ["LOCAL", "USA", "DE"] or omit.
configuration
Type: one of
sip_configurations
pstn_configurations
iax2_configurations
h323_configurations
Description: Trunk configuration complex object

Attributes Configuration

type
Type: sip_configurations
Nullable: No
Description: SIP configuration complex object
attributes
Type: sip_configuration_attrbutes
Nullable: No
Description: SIP configuration attributes object
type
Type: pstn_configurations
Nullable: No
Description: PSTN configuration complex object
attributes
Type: pstn_configuration_attrbutes
Nullable: No
Description: PSTN configuration attributes object
type
Type: iax2_configurations
Nullable: No
Description: IAX2 configuration complex object
attributes
Type: iax2_configuration_attrbutes
Nullable: No
Description: IAX2 configuration attributes object
type
Type: h323_configurations
Nullable: No
Description: H323 configuration complex object
attributes
Type: h323_configuration_attrbutes
Nullable: No
Description: H323 configuration attributes object

Configuration Attributes

username
Type: String
Nullable: No
Description: User part of R-URI in INVITE request.You also may use "{DID}" pattern which will be replaced by called DID number in E164 format. For example, you can set Username to "+{DID}"; if you wish to have it in +E164 format
host
Type: String
Nullable: No
Description: Host part of R-URI in INVITE request
auth_user
Type: String
Nullable: No
Description: Optional authorization user for the SIP server
auth_password
Type: String
Nullable: No
Description: Optional authorization password for the SIP server
auth_from_user
Type: String
Nullable: No
Description: Specify user in a "from" field instead of CallerID (overrides CallerID). Some equipment require "from"; to be equivalent to "Auth user";
auth_from_domain
Type: String
Nullable: No
Description: Sets default "from" domain in SIP messages. Some equipment may require specific "From" Domain
sst_refresh_method_id
Type: Integer
Nullable: No
Description: SIP method which will be used for session update.
See RFC 4028for more details.
Possible values:
1 - Invite
2 - Update
3 - Update fallback Invite
sip_timer_b
Type: Integer
Nullable: No
Description: INVITE transaction timeout (Default 8000ms). See RFC 3261 Section 17.1.1.2 for more details
dns_srv_failover_timer
Type: Integer
Nullable: No
Description: Invite transaction timeout for each of gateways with DNS SRV rerouting (Default 2000ms)
rtp_ping
Type: Integer
Nullable: No
Description: Use RTP PING when connecting a call. After establishing the call, DIDWW will send empty RTP packet "RTP PING". It is neccessary if both parties operate in Symmetric RTP / Comedia mode and expect the other party to start sending RTP first.
rtp_timeout
Type: Integer
Nullable: No
Description: Disconnect call if the RTP packets do not arrive within the specified time
sst_min_timer
Type: Integer
Nullable: No
Description: Minimal SIP Session timer value (Default 600 seconds). See RFC 4028 for more details
sst_max_timer
Type: Integer
Nullable: No
Description: Maximal SIP Session timer value (Default 900 seconds). See RFC 4028 for more details
sst_session_expires
Type: Integer
Nullable: No
Description: Session-Expires header value. Optional, should be in range sst_min_timer ... sst_max_timer.
See RFC 4028 for more details
port
Type: Integer
Nullable: No
Description: Port part of R-URI in INVITE request (is not mandatory).If port is null, SRV record will be resolved (or A record if SRV is unavailable)
rx_dtmf_format_id
Type: Integer
Nullable: No
Description: The method id for receiving DTMF signals from customer equipment
Possible values:
1 - RFC 2833
2 - SIP INFO application/dtmf-relay OR application/dtmf
3 - RFC 2833 OR SIP INFO
tx_dtmf_format_id
Type: Integer
Nullable: No
Description: The method of sending DTMF signals to customer equipment
Possible values:
1 - Disable sending
2 - RFC 2833
3 - SIP INFO application/dtmf-relay
4 - SIP INFO application/dtmf
force_symmetric_rtp
Type: Boolean
Nullable: No
Description: Forced to work in Symmetric RTP / COMEDIA mode
symmetric_rtp_ignore_rtcp
Type: Boolean
Nullable: No
Description: Avoid switching RTP session based on RTCP packet while working in Symmetric RTP / COMEDIA. Only RTP packets will be considered
sst_enabled
Type: Boolean
Nullable: No
Description: Enable SIP Session timers customization. SIP session timers are used to make sure that a session (dialog) is still alive, even though there may have been a long time since the last in-dialog message. If the other end is not responding, the dialog will be hung up automatically. SIP session timers need to be supported by all end points for it to work. It's a SIP extension, standardized by the IETF. See RFC 4028 for more details
sst_accept_501
Type: Boolean
Nullable: No
Description: Do not drop the call after receiving SIP 501 response for non-critical messages
auth_enabled
Type: Boolean
Nullable: No
Description: Enable authorization for the SIP server
resolve_ruri
Type: Boolean
Nullable: No
Description: Replace host part of the R-URI by resolved IP address
rerouting_disconnect_code_ids
Type: Array
Nullable: No
Description: Rerouting disconnect codes
codec_ids
Type: Array
Nullable: No
Description: Codecs
dst
Type: String
Nullable: No
Description: Phone number's
dst
Type: String
Nullable: No
Description: Phone number's
host
Type: String
Nullable: No
Description: Destination server
port
Type: String
Nullable: No
Description: Destination port
auth_user
Type: String
Nullable: No
Description: Optional authorization user
auth_password
Type: String
Nullable: No
Description: Optional authorization password
codec_ids
Type: Array
Nullable: No
Description:
dst
Type: String
Nullable: No
Description: Phone number's
host
Type: String
Nullable: No
Description: Destination server
port
Type: String
Nullable: No
Description: Destination port
codec_ids
Type: Array
Nullable: No
Description:

Examples

Example name Description
Sample 1 Update SIP trunk
Sample 2 Update PSTN trunk
Sample 3 Update IAX2 trunk
Sample 4 Update H323 trunk

Response

Body

Code Success Description
200 Yes Trunk Object
404 No Not Found
401 No Unauthorized

Requests:

PATCH https://api.didww.com/trunks/{id} HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "1",
    "type": "trunks",
    "attributes": {
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "new_username"
        }
      }
    }
  }
}

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "1",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 10,
      "weight": 2,
      "name": "Office",
      "cli_format": "e164",
      "cli_prefix": "+",
      "description": "custom description",
      "ringing_timeout": 30,
      "configuration": {
        "type": "sip_configurations",
        "attributes": {
          "username": "new_username",
          "host": "example.com",
          "port": 5060,
          "codec_ids": [
            9,
            7
          ],
          "rx_dtmf_format_id": 1,
          "tx_dtmf_format_id": 1,
          "resolve_ruri": true,
          "auth_enabled": true,
          "auth_user": "username",
          "auth_password": "password",
          "auth_from_user": "Office",
          "auth_from_domain": "example.com",
          "sst_enabled": false,
          "sst_min_timer": 600,
          "sst_max_timer": 900,
          "sst_accept_501": true,
          "sip_timer_b": 8000,
          "dns_srv_failover_timer": 2000,
          "rtp_ping": false,
          "rtp_timeout": 30,
          "force_symmetric_rtp": false,
          "symmetric_rtp_ignore_rtcp": false,
          "rerouting_disconnect_code_ids": [
            58,
            59
          ],
          "sst_session_expires": null,
          "sst_refresh_method_id": 1
        }
      },
      "preferred_server": "USA"
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/1/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/1/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "string",
      "details": "string",
      "status": "string",
      "href": "string",
      "path": "string",
      "code": 0,
      "id": 0,
      "links": {
        "self": "string",
        "related": "string"
      }
    }
  ]
}
PATCH https://api.didww.com/trunks/{id} HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "2",
    "type": "trunks",
    "attributes": {
      "configuration": {
        "type": "pstn_configurations",
        "attributes": {
          "dst": "7xxxxxxxx"
        }
      }
    }
  }
}

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "2",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 5,
      "weight": 65535,
      "name": "Office Mobile",
      "cli_format": "e164",
      "cli_prefix": null,
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "pstn_configurations",
        "attributes": {
          "dst": "7xxxxxxxx"
        }
      },
      "preferred_server": null
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/2/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/2/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "string",
      "details": "string",
      "status": "string",
      "href": "string",
      "path": "string",
      "code": 0,
      "id": 0,
      "links": {
        "self": "string",
        "related": "string"
      }
    }
  ]
}
PATCH https://api.didww.com/trunks/{id} HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "3",
    "type": "trunks",
    "attributes": {
      "configuration": {
        "type": "iax2_configurations",
        "attributes": {
          "dst": "7xxxxxxxx"
        }
      }
    }
  }
}

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "3",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 9,
      "weight": 65535,
      "name": "Office IAX2",
      "cli_format": "e164",
      "cli_prefix": "+1",
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "iax2_configurations",
        "attributes": {
          "dst": "7xxxxxxxx",
          "host": "example.com",
          "port": null,
          "auth_user": "username",
          "auth_password": "password",
          "codec_ids": [
            9,
            6
          ]
        }
      },
      "preferred_server": "USA"
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/3/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/3/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "string",
      "details": "string",
      "status": "string",
      "href": "string",
      "path": "string",
      "code": 0,
      "id": 0,
      "links": {
        "self": "string",
        "related": "string"
      }
    }
  ]
}
PATCH https://api.didww.com/trunks/{id} HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "4",
    "type": "trunks",
    "attributes": {
      "configuration": {
        "type": "h323_configurations",
        "attributes": {
          "dst": "7xxxxxxxx"
        }
      }
    }
  }
}

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "4",
    "type": "trunks",
    "attributes": {
      "priority": 1,
      "capacity_limit": 18,
      "weight": 65535,
      "name": "Office H323 API",
      "cli_format": "e164",
      "cli_prefix": "+1",
      "description": null,
      "ringing_timeout": null,
      "configuration": {
        "type": "h323_configurations",
        "attributes": {
          "dst": "7xxxxxxxx",
          "host": "example.com",
          "port": null,
          "codec_ids": [
            9,
            6
          ]
        }
      },
      "preferred_server": "USA"
    },
    "relationships": {
      "trunk_group": {
        "links": {
          "self": "https://api.didww.com/v3/trunks/4/relationships/trunk_group",
          "related": "https://api.didww.com/v3/trunks/4/trunk_group"
        }
      }
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "string",
      "details": "string",
      "status": "string",
      "href": "string",
      "path": "string",
      "code": 0,
      "id": 0,
      "links": {
        "self": "string",
        "related": "string"
      }
    }
  ]
}
DELETE /trunks/{id}

Delete Trunk

Description

Removes Trunk

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Trunk

Request:

DELETE https://api.didww.com/trunks/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 202 Deleted
Content-Type: application/vnd.api+json

No content
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}

Trunk Object

Description

json api object with type trunks You can get several type of trunks: SIP, PSTN, H323, IAX2.

Attributes

Trunk Object Attributes

priority
Type: Integer
Description: The priority of this target host. DIDWW will attempt to contact the target trunk with the lowest-numbered priority; target trunk with the same priority will be tried in an order defined by the weight field. The range is 0-65535. See RFC 2782 for more details
weight
Type: Integer
Description: A trunk selection mechanism. The weight field specifies a relative weight for entries with the same priority. Larger weights will be given a proportionately higher probability of being selected. The range of this number is 0-65535. In the presence of records containing weights greater than 0, records with weight 0 will have a very small chance of being selected. See RFC 2782 for more details
capacity_limit
Type: Integer
Description: Maximum number of simultaneous calls for the trunk
ringing_timeout
Type: Integer
Description: After which it will be end transaction with internal disconnect code 'Ringing timeout' if the call was not connected.
name
Type: String
Description: Friendly name of the trunk
cli_format
Type: String
Description:
RAW - Do not alter CLI (default)
164 - Attempt to convert CLI to E.164 format
Local - Attempt to convert CLI to Localized format
* CLI format conversion may not work correctly for phone calls originating from outside the country of that specific DID
cli_prefix
Type: String
Description: You may prefix the CLI with an optional '+' sign followed by up to 6 characters, including digits and '#'
description
Type: String
Description: Optional description of trunk
preferred_server
Type: String
Description: Preferred server for your voice route. In general, you should choose the server that is the closest to your location ["LOCAL", "USA", "DE"] or omit.
configuration
Type: one of
sip_configurations
pstn_configurations
iax2_configurations
h323_configurations
Description: Trunk configuration complex object

Attributes Configuration

type
Type: sip_configurations
Description: SIP configuration complex object
attributes
Type: sip_configuration_attrbutes
Description: SIP configuration attributes object
type
Type: pstn_configurations
Description: PSTN configuration complex object
attributes
Type: pstn_configuration_attrbutes
Description: PSTN configuration attributes object
type
Type: iax2_configurations
Description: IAX2 configuration complex object
attributes
Type: iax2_configuration_attrbutes
Description: IAX2 configuration attributes object
type
Type: h323_configurations
Description: H323 configuration complex object
attributes
Type: h323_configuration_attrbutes
Description: H323 configuration attributes object

Configuration Attributes

username
Type: String
Description: User part of R-URI in INVITE request.You also may use "{DID}" pattern which will be replaced by called DID number in E164 format. For example, you can set Username to "+{DID}"; if you wish to have it in +E164 format
host
Type: String
Description: Host part of R-URI in INVITE request
auth_user
Type: String
Description: Optional authorization user for the SIP server
auth_password
Type: String
Description: Optional authorization password for the SIP server
auth_from_user
Type: String
Description: Specify user in a "from" field instead of CallerID (overrides CallerID). Some equipment require "from"; to be equivalent to "Auth user";
auth_from_domain
Type: String
Description: Sets default "from" domain in SIP messages. Some equipment may require specific "From" Domain
sst_refresh_method_id
Type: Integer
Description: SIP method which will be used for session update.
See RFC 4028for more details.
Possible values:
1 - Invite
2 - Update
3 - Update fallback Invite
sip_timer_b
Type: Integer
Description: INVITE transaction timeout (Default 8000ms). See RFC 3261 Section 17.1.1.2 for more details
dns_srv_failover_timer
Type: Integer
Description: Invite transaction timeout for each of gateways with DNS SRV rerouting (Default 2000ms)
rtp_ping
Type: Integer
Description: Use RTP PING when connecting a call. After establishing the call, DIDWW will send empty RTP packet "RTP PING". It is neccessary if both parties operate in Symmetric RTP / Comedia mode and expect the other party to start sending RTP first.
rtp_timeout
Type: Integer
Description: Disconnect call if the RTP packets do not arrive within the specified time
sst_min_timer
Type: Integer
Description: Minimal SIP Session timer value (Default 600 seconds). See RFC 4028 for more details
sst_max_timer
Type: Integer
Description: Maximal SIP Session timer value (Default 900 seconds). See RFC 4028 for more details
sst_session_expires
Type: Integer
Description: Session-Expires header value. Optional, should be in range sst_min_timer ... sst_max_timer.
See RFC 4028 for more details
port
Type: Integer
Description: Port part of R-URI in INVITE request (is not mandatory).If port is null, SRV record will be resolved (or A record if SRV is unavailable)
rx_dtmf_format_id
Type: Integer
Description: The method id for receiving DTMF signals from customer equipment
Possible values:
1 - RFC 2833
2 - SIP INFO application/dtmf-relay OR application/dtmf
3 - RFC 2833 OR SIP INFO
tx_dtmf_format_id
Type: Integer
Description: The method of sending DTMF signals to customer equipment
Possible values:
1 - Disable sending
2 - RFC 2833
3 - SIP INFO application/dtmf-relay
4 - SIP INFO application/dtmf
force_symmetric_rtp
Type: Boolean
Description: Forced to work in Symmetric RTP / COMEDIA mode
symmetric_rtp_ignore_rtcp
Type: Boolean
Description: Avoid switching RTP session based on RTCP packet while working in Symmetric RTP / COMEDIA. Only RTP packets will be considered
sst_enabled
Type: Boolean
Description: Enable SIP Session timers customization. SIP session timers are used to make sure that a session (dialog) is still alive, even though there may have been a long time since the last in-dialog message. If the other end is not responding, the dialog will be hung up automatically. SIP session timers need to be supported by all end points for it to work. It's a SIP extension, standardized by the IETF. See RFC 4028 for more details
sst_accept_501
Type: Boolean
Description: Do not drop the call after receiving SIP 501 response for non-critical messages
auth_enabled
Type: Boolean
Description: Enable authorization for the SIP server
resolve_ruri
Type: Boolean
Description: Replace host part of the R-URI by resolved IP address
rerouting_disconnect_code_ids
Type: Array
Description: Rerouting disconnect codes
codec_ids
Type: Array
Description: Codecs
dst
Type: String
Description: Phone number's
dst
Type: String
Description: Phone number's
host
Type: String
Description: Destination server
port
Type: String
Description: Destination port
auth_user
Type: String
Description: Optional authorization user
auth_password
Type: String
Description: Optional authorization password
codec_ids
Type: Array
Description:
dst
Type: String
Description: Phone number's
host
Type: String
Description: Destination server
port
Type: String
Description: Destination port
codec_ids
Type: Array
Description:

Codecs

Codec ID Codec name
6 telephone-event
7 G723
8 G729
9 PCMU
10 PCMA
12 speex
13 GSM
14 G726-32
15 G721
16 G726-24
17 G726-40
18 G726-16
19 L16

Rerouting disconnect codes

ID Code Description
56 400 Bad Request
57 401 Unauthorized
58 402 Payment Required
59 403 Forbidden
60 404 Not Found
64 408 Request Timeout
65 409 Conflict
66 410 Gone
67 412 Conditional Request Failed
68 413 Request Entity Too Large
69 414 Request-URI Too Long
70 415 Unsupported Media Type
71 416 Unsupported URI Scheme
72 417 Unknown Resource-Priority
73 420 Bad Extension
74 421 Extension Required
75 422 Session Interval Too Small
76 423 Interval Too Brief
77 424 Bad Location Information
78 428 Use Identity Header
79 429 Provide Referrer Identity
80 433 Anonymity Disallowed
81 436 Bad Identity-Info
82 437 Unsupported Certificate
83 438 Invalid Identity Header
84 480 Temporarily Unavailable
86 482 Loop Detected
87 483 Too Many Hops
88 484 Address Incomplete
89 485 Ambiguous
90 486 Busy Here
91 487 Request Terminated
92 488 Not Acceptable Here
96 494 Security Agreement Required
97 500 Server Internal Error
98 501 Not Implemented
99 502 Bad Gateway
100 503 Service Unavailable
101 504 Server Time-out
102 505 Version Not Supported
103 513 Message Too Large
104 580 Precondition Failure
105 600 Busy Everywhere
106 603 Decline
107 604 Does Not Exist Anywhere
108 606 Not Acceptable
1505 Ringing timeout

Trunk Group

GET /trunk_groups/{id}

Get Trunk Group

Description

Returns a single Trunk Groups

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Trunk Group
includes
optional
Type: String
Description: jsonapi includes

Includes

Value Description
trunks list of Trunk Objects

Examples

Example name Description
Sample 1 Request for Trunk Group
Sample 2 Request for Trunk Group with included trunks

Response

Code Success Description
200 Yes Trunk Group Object
404 No Not Found
401 No Unauthorized

Requests:

GET https://api.didww.com/trunk_groups/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/trunk_groups/123"
    },
    "attributes": {
      "created_at": "2017-06-25T14:56:31.513Z",
      "updated_at": "2017-06-25T14:56:31.513Z",
      "name": "Common Group",
      "capacity_limit": 69
    },
    "relationships": {
      "trunks": {
        "links": {
          "self": "https://api.didww.com/v3/trunk_groups/123/relationships/trunks",
          "related": "https://api.didww.com/v3/trunk_groups/123/trunks"
        }
      }
    },
    "meta": {
      "trunks_count": 1
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET https://api.didww.com/trunk_groups/123?include=trunks HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/trunk_groups/123"
    },
    "attributes": {
      "created_at": "2017-06-25T14:56:31.513Z",
      "updated_at": "2017-06-25T14:56:31.513Z",
      "name": "Common Group",
      "capacity_limit": 69
    },
    "relationships": {
      "trunks": {
        "links": {
          "self": "https://api.didww.com/v3/trunk_groups/123/relationships/trunks",
          "related": "https://api.didww.com/v3/trunk_groups/123/trunks"
        },
        "data": [
          {
            "type": "trunks",
            "id": "456"
          }
        ]
      }
    },
    "meta": {
      "trunks_count": 1
    }
  },
  "included": [
    {
      "id": "456",
      "type": "trunks",
      "attributes": {
        "priority": 1,
        "capacity_limit": 5,
        "weight": 65535,
        "name": "Office Mobile",
        "cli_format": "e164",
        "cli_prefix": null,
        "description": null,
        "ringing_timeout": null,
        "configuration": {
          "type": "pstn_configurations",
          "attributes": {
            "dst": "1xxxxxxxxx"
          }
        },
        "preferred_server": null
      },
      "relationships": {
        "trunk_group": {
          "links": {
            "self": "https://api.didww.com/v3/trunks/396233/relationships/trunk_group",
            "related": "https://api.didww.com/v3/trunks/396233/trunk_group"
          }
        }
      }
    }
  ]
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /trunk_groups

Get Trunk Groups

Description

Returns a collection of Trunk Groups

Request

URI Parameters

includes
optional
Type: String
Description: jsonapi includes
sort
optional
Type: String
Description: jsonapi sorting

Includes

Value Description
trunks list of Trunk Objects

Sorting

Value Description
id sort by "id" field
name sort by "name" field
created_at sort by "created_at" field
updated_at sort by "updated_at" field
capacity_limit sort by "capacity_limit" field

Examples

Example name Description
Sample 1 Request for Trunk Group collection
Sample 2 Request for Trunk Group collection with included trunks

Response

Code Success Description
200 Yes list of Trunk Group Objects
401 No Unauthorized

Requests:

GET https://api.didww.com/trunk_groups HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "123",
      "type": "trunk_groups",
      "links": {
        "self": "https://api.didww.com/v3/trunk_groups/123"
      },
      "attributes": {
        "created_at": "2017-06-25T14:56:31.513Z",
        "updated_at": "2017-06-25T14:56:31.513Z",
        "name": "Common Group",
        "capacity_limit": 69
      },
      "relationships": {
        "trunks": {
          "links": {
            "self": "https://api.didww.com/v3/trunk_groups/123/relationships/trunks",
            "related": "https://api.didww.com/v3/trunk_groups/123/trunks"
          }
        }
      },
      "meta": {
        "trunks_count": 1
      }
    },
    {
      "id": "124",
      "type": "trunk_groups",
      "links": {
        "self": "https://api.didww.com/v3/trunk_groups/124"
      },
      "attributes": {
        "created_at": "2017-06-25T14:56:31.513Z",
        "updated_at": "2017-06-25T14:56:31.513Z",
        "name": "Custom Group",
        "capacity_limit": 50
      },
      "relationships": {
        "trunks": {
          "links": {
            "self": "https://api.didww.com/v3/trunk_groups/124/relationships/trunks",
            "related": "https://api.didww.com/v3/trunk_groups/124/trunks"
          }
        }
      },
      "meta": {
        "trunks_count": 0
      }
    }
  ],
  "meta": {
    "total_records": 2
  },
  "links": {
    "first": "https://api.didww.com/v3/trunk_groups?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "https://api.didww.com/v3/trunk_groups?page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}
GET https://api.didww.com/trunk_groups?include=trunks HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "123",
      "type": "trunk_groups",
      "links": {
        "self": "https://api.didww.com/v3/trunk_groups/123"
      },
      "attributes": {
        "created_at": "2017-06-25T14:56:31.513Z",
        "updated_at": "2017-06-25T14:56:31.513Z",
        "name": "Common Group",
        "capacity_limit": 69
      },
      "relationships": {
        "trunks": {
          "links": {
            "self": "https://api.didww.com/v3/trunk_groups/123/relationships/trunks",
            "related": "https://api.didww.com/v3/trunk_groups/123/trunks"
          },
          "data": [
            {
              "type": "trunks",
              "id": "456"
            }
          ]
        }
      },
      "meta": {
        "trunks_count": 1
      }
    },
    {
      "id": "124",
      "type": "trunk_groups",
      "links": {
        "self": "https://api.didww.com/v3/trunk_groups/124"
      },
      "attributes": {
        "created_at": "2017-06-25T14:56:31.513Z",
        "updated_at": "2017-06-25T14:56:31.513Z",
        "name": "Custom Group",
        "capacity_limit": 50
      },
      "relationships": {
        "trunks": {
          "links": {
            "self": "https://api.didww.com/v3/trunk_groups/124/relationships/trunks",
            "related": "https://api.didww.com/v3/trunk_groups/124/trunks"
          },
          "data": [

          ]
        }
      },
      "meta": {
        "trunks_count": 0
      }
    }
  ],
  "included": [
    {
      "id": "456",
      "type": "trunks",
      "attributes": {
        "priority": 1,
        "capacity_limit": 5,
        "weight": 65535,
        "name": "Office Mobile",
        "cli_format": "e164",
        "cli_prefix": null,
        "description": null,
        "ringing_timeout": null,
        "configuration": {
          "type": "pstn_configurations",
          "attributes": {
            "dst": "1xxxxxxxxx"
          }
        },
        "preferred_server": null
      },
      "relationships": {
        "trunk_group": {
          "links": {
            "self": "https://api.didww.com/v3/trunks/456/relationships/trunk_group",
            "related": "https://api.didww.com/v3/trunks/456/trunk_group"
          }
        }
      }
    }
  ],
  "meta": {
    "total_records": 2
  },
  "links": {
    "first": "https://api.didww.com/v3/trunk_groups?include=trunks&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "https://api.didww.com/v3/trunk_groups?include=trunks&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}
POST /trunk_groups

Create Trunk Group

Description

Creates Trunk Group

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Trunk Group
includes
optional
Type: String
Description: jsonapi includes

Request Body Object Attributes

name
required
Type: String
Nullable: false
Description: unique name of Trunk Group
capacity_limit
optional
Type: Integer
Nullable: false
Description: maximum number of simultaneous calls for the Trunk Group

Request Body Object Relationships

Title Type Description
trunks to-many linkage for included trunks

Examples

Example name Description
Sample 1 Simple create
Sample 2 Create Trunk Group and assign trunks
Sample 3 Create Trunk Group, assign trunks and include them in response

Response

Code Success Description
201 Yes Trunk Group Object
422 No Unprocessible Entity
401 No Unauthorized

Requests:

POST https://api.didww.com/trunk_groups HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "trunk_groups",
    "attributes": {
      "name": "Main group",
      "capacity_limit": 100
    }
  }
}

Responses:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/trunk_groups/123"
    },
    "attributes": {
      "created_at": "2017-06-25T14:56:31.513Z",
      "updated_at": "2017-06-25T14:56:31.513Z",
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "trunks": {
        "links": {
          "self": "https://api.didww.com/v3/trunk_groups/123/relationships/trunks",
          "related": "https://api.didww.com/v3/trunk_groups/123/trunks"
        }
      }
    },
    "meta": {
      "trunks_count": 0
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "should exist",
      "detail": "name - already exist",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}
POST https://api.didww.com/trunk_groups HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "trunk_groups",
    "attributes": {
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "trunks": {
        "data": [
          {
            "type": "trunks",
            "id": "456"
          },
          {
            "type": "trunks",
            "id": "457"
          },
          {
            "type": "trunks",
            "id": "458"
          }
        ]
      }
    }
  }
}

Responses:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/trunk_groups/123"
    },
    "attributes": {
      "created_at": "2017-06-25T14:56:31.513Z",
      "updated_at": "2017-06-25T14:56:31.513Z",
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "trunks": {
        "links": {
          "self": "https://api.didww.com/v3/trunk_groups/123/relationships/trunks",
          "related": "https://api.didww.com/v3/trunk_groups/123/trunks"
        }
      }
    },
    "meta": {
      "trunks_count": 3
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "should exist",
      "detail": "name - already exist",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}
POST https://api.didww.com/trunk_groups?include=trunks HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "trunk_groups",
    "attributes": {
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "trunks": {
        "data": [
          {
            "type": "trunks",
            "id": "456"
          },
          {
            "type": "trunks",
            "id": "457"
          }
        ]
      }
    }
  }
}

Responses:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/trunk_groups/123"
    },
    "attributes": {
      "created_at": "2017-08-16T14:04:36.013Z",
      "updated_at": "2017-08-16T14:04:36.013Z",
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "trunks": {
        "links": {
          "self": "https://api.didww.com/v3/trunk_groups/123/relationships/trunks",
          "related": "https://api.didww.com/v3/trunk_groups/123/trunks"
        },
        "data": [
          {
            "type": "trunks",
            "id": "456"
          },
          {
            "type": "trunks",
            "id": "457"
          }
        ]
      }
    },
    "meta": {
      "trunks_count": 2
    }
  },
  "included": [
    {
      "data": {
        "id": "456",
        "type": "trunks",
        "attributes": {
          "priority": 1,
          "capacity_limit": 9,
          "weight": 65535,
          "name": "Office IAX2",
          "cli_format": "e164",
          "cli_prefix": "+1",
          "description": null,
          "ringing_timeout": null,
          "configuration": {
            "type": "iax2_configurations",
            "attributes": {
              "dst": "1xxxxxxxxx",
              "host": "example.com",
              "port": null,
              "auth_user": "username",
              "auth_password": "password",
              "codec_ids": [
                9,
                6
              ]
            }
          },
          "preferred_server": "USA"
        },
        "relationships": {
          "trunk_group": {
            "links": {
              "self": "https://api.didww.com/v3/trunks/456/relationships/trunk_group",
              "related": "https://api.didww.com/v3/trunks/456/trunk_group"
            }
          }
        }
      }
    },
    {
      "data": {
        "id": "457",
        "type": "trunks",
        "attributes": {
          "priority": 1,
          "capacity_limit": 18,
          "weight": 65535,
          "name": "Office H323",
          "cli_format": "e164",
          "cli_prefix": "+1",
          "description": null,
          "ringing_timeout": null,
          "configuration": {
            "type": "h323_configurations",
            "attributes": {
              "dst": "1xxxxxxxxx",
              "host": "example.com",
              "port": null,
              "codec_ids": [
                9,
                6
              ]
            }
          },
          "preferred_server": "USA"
        },
        "relationships": {
          "trunk_group": {
            "links": {
              "self": "https://api.didww.com/v3/trunks/457/relationships/trunk_group",
              "related": "https://api.didww.com/v3/trunks/457/trunk_group"
            }
          }
        }
      }
    }
  ]
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "should exist",
      "detail": "name - already exist",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}
PATCH /trunk_groups/{id}

Update Trunk Group

Description

Updates Trunk Group

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Trunk Group
includes
optional
Type: String
Description: jsonapi includes

Request Body Object Attributes

name
Type: String
Nullable: false
Description: unique name of Trunk Group
capacity_limit
Type: Integer
Nullable: false
Description: maximum number of simultaneous calls for the Trunk Group

Request Body Object Relationships

Title Type Description
trunks to-many linkage for included trunks

Examples

Example name Description
Sample 1 Simple update
Sample 2 Update trunk group with removing trunks

Response

Code Success Description
200 Yes Trunk Group Object
422 No Unprocessible Entity
401 No Unauthorized

Requests:

PATCH https://api.didww.com/trunk_groups/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "123",
    "type": "trunk_groups",
    "attributes": {
      "name": "Renamed group",
      "capacity_limit": 1
    }
  }
}

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/trunk_groups/123"
    },
    "attributes": {
      "created_at": "2017-06-25T14:56:31.513Z",
      "updated_at": "2017-06-25T14:56:31.513Z",
      "name": "Renamed group",
      "capacity_limit": 1
    },
    "relationships": {
      "trunks": {
        "links": {
          "self": "https://api.didww.com/v3/trunk_groups/123/relationships/trunks",
          "related": "https://api.didww.com/v3/trunk_groups/123/trunks"
        }
      }
    },
    "meta": {
      "trunks_count": 1
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "should exist",
      "detail": "name - already exist",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}
PATCH https://api.didww.com/trunk_groups/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "123",
    "type": "trunk_groups",
    "relationships": {
      "trunks": {
        "data": [

        ]
      }
    }
  }
}

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/trunk_groups/123"
    },
    "attributes": {
      "created_at": "2017-06-25T14:56:31.513Z",
      "updated_at": "2017-06-25T14:56:31.513Z",
      "name": "Common Group",
      "capacity_limit": 69
    },
    "relationships": {
      "trunks": {
        "links": {
          "self": "https://api.didww.com/v3/trunk_groups/123/relationships/trunks",
          "related": "https://api.didww.com/v3/trunk_groups/123/trunks"
        }
      }
    },
    "meta": {
      "trunks_count": 0
    }
  }
}
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "should exist",
      "detail": "name - already exist",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}
DELETE /trunk_groups/{id}

Delete Trunk Group

Description

Deletes Trunk Group

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of Trunk Group

Response

Code Success Description
204 Yes Deleted
401 No Unauthorized

Request:

DELETE https://api.didww.com/trunk_groups/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 202 Deleted
Content-Type: application/vnd.api+json

No content
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}

Trunk Group Object

Description

Trunk Group Object attributes

Attributes

name
Type: String
Description: Trunk Group name
capacity_limit
Type: Integer
Description: maximum number of simultaneous calls for the trunk

API calls - Processes

Export

GET /cdr_exports/{id}

Get CDR Export

Description

Returns a single CDR Export

Request

URI Parameters

id
required
Type: String
Description: unique ID identifier of CDR Export

Response

Response Body

Code Success Description
200 Yes CDR Export Object
404 No Not Found
401 No Unauthorized

Request:

GET https://api.didww.com/cdr_exports/123 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Responses:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "cdr_exports",
    "attributes": {
      "filters": {
        "year": "2017",
        "month": "3"
      },
      "status": "Completed",
      "created_at": "2017-06-25T14:56:31.513Z",
      "url": "https://api.didww.com/v3/cdr_exports/a4f6b765-f20c-45c7-98d2-80c2f3a41517.csv"
    }
  }
}
HTTP/1.1 404 Not Found
Content-Type: application/vnd.api+json

{
  "errors": [
    {
      "title": "Record not found",
      "detail": "The record identified by 123 could not be found.",
      "code": "404",
      "status": "404"
    }
  ]
}
GET /cdr_exports

Get CDR Exports

Description

Returns a collection of CDR Exports

Request

URI Parameters

sort
optional
Type: String
Description: jsonapi sorting

Sorting

Value Description
id sort by "id" field
status sort by "status" field
created_at sort by "created_at" field

Response

Body

Code Success Description
200 Yes list of CDR Export Objects
401 No Unauthorized

Request:

GET https://api.didww.com/cdr_exports HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "123",
      "type": "cdr_exports",
      "attributes": {
        "filters": {
          "year": "2017",
          "month": "3"
        },
        "status": "Completed",
        "created_at": "2017-06-25T14:56:31.513Z",
        "url": "https://api.didww.com/v3/cdr_exports/a4f6b765-f20c-45c7-98d2-80c2f3a41517.csv"
      }
    },
    {
      "id": "124",
      "type": "cdr_exports",
      "attributes": {
        "filters": {
          "year": "2017",
          "month": "4"
        },
        "status": "Processing",
        "created_at": "2017-06-26T14:56:31.513Z",
        "url": null
      }
    },
    {
      "id": "125",
      "type": "cdr_exports",
      "attributes": {
        "filters": {
          "year": "2017",
          "month": "5"
        },
        "status": "Pending",
        "created_at": "2017-06-26T14:56:31.513Z",
        "url": null
      }
    }
  ],
  "meta": {
    "total_records": 3
  }
}
GET /cdr_exports/{filename}.csv

Get csv file of CDR Export

Description

Returns a single csv file for corresponding CDR Export

Request

URI Parameters

filename
required
Type: String
Description: unique filename of completed CDR Export

Response

Response Body

Code Success Description
200 Yes Responds with CSV file
404 No Not Found (without body)
401 No Unauthorized

Request:

GET https://api.didww.com/cdr_exports/a4f6b765-f20c-45c7-98d2-80c2f3a41517.csv HTTP/1.1
Accept: text/csv
Api-Key: [API token]

Response:

HTTP/1.1 200 OK
Content-Type: text/csv

Date/Time (UTC),Source,DID,Destination,Duration (secs),Disconnect Initiator,Disconnect Code,Response,TollFree Amount (USD),Termination Amount (USD),Metered Channels Amount (USD),Customer ID,Sell Amount (Points)
2017-06-26 01:11:42,4,97286259404,sip:test@example.com,0,Destination,404,Not Found,0.000,0.000,0.000,,0.000
2017-06-17 08:50:47,"",97286259413,iax:324@34234234,54,Origination,200,Bye,0.000,0.000,0.003,,0.000
2017-06-12 14:23:25,"",97286259407,iax:324@34234234,16,Origination,200,Bye,0.000,0.000,0.003,,0.000
2017-06-05 12:58:41,4,97286259404,sip:test@example.com,0,Destination,404,Not Found,0.000,0.000,0.000,,0.000
2017-06-01 07:57:43,4,97286259414,iax:324@34234234,57,Origination,200,Bye,0.000,0.000,0.003,,0.000
POST /cdr_exports

Create CDR Export

Description

Creates a single CDR Export. DIDWW performs deletion of CDR Export in 1 month after completion.

Request

Request Body Object Attributes

filters
true
Type: CDR Export Filters Object
Nullable: false
Description: Filters

Response

Response Body

Code Success Description
201 Yes CDR Export Object
422 No Unprocessable Entity
401 No Unauthorized

Request:

POST https://api.didww.com/cdr_exports HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "cdr_exports",
    "attributes": {
      "filters": {
        "year": "2017",
        "month": "5",
        "did_number": "123456789"
      }
    }
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "cdr_exports",
    "attributes": {
      "filters": {
        "year": "2017",
        "month": "5",
        "did_number": "123456789"
      },
      "status": "Pending",
      "created_at": "2017-06-25T14:56:31.513Z",
      "url": null
    }
  }
}

CDR Export Object

Description

CDR Export attributes

Attributes

filters
Type: CDR Export Filters Object
Nullable: No
Description: Filters
status
Type: String
Nullable: false
Description: status can be "Pending", "Processing" or "Completed"
created_at
Type: DateTime
Nullable: false
Description: timestamp when export request was created
url
Type: String
Nullable: true
Description: url of csv file for downloading. available only when status is "Completed"

CDR Export Filters Object

Description

CDR Export Filters keys

Attributes

year
true
Type: Integer
Nullable: false
Description: year of CDR timestamp
month
true
Type: Integer
Nullable: false
Description: month of CDR timestamp
did_number
false
Type: String
Nullable: false
Description: filters CDRs by DID number

Common Definitions

Stock Keeping Unit Object

Description

Stock Keeping Unit

Attributes

setup_price
Type: String
Description: price for Order creation
monthly_price
Type: String
Description: monthly price for order renew
channels_included_count
Type: Integer
Description: included channels capacity for each DID

Validation Error Object

Description

JSONAPI validation error

Attributes

Validation Error

title
Type: String
Nullable: No
Description: short error description
detail
Type: String
Nullable: No
Description: detailed error description
code
Type: String
Nullable: No
Description: will be 100
source/pointer
Type: status
Nullable: No
Description: path to error attribute/relationship in request payload

Not Found Error Object

Description

JSONAPI object not found

Attributes

Error Not Found

title
Type: String
Nullable: No
Description: Record Not Found
detail
Type: String
Nullable: No
Description: The record identified by {id} could not be found.
code
Type: String
Nullable: No
Description: 404
status
Type: String
Nullable: No
Description: 404