Number Portability Query

Retrieve Number Portability Query

GET /api/v1/tenants/(string: tenant_id)/services/number_portability_query/

Retrieve the settings of a Tenant’s Number Portability Query.

Authorization rights: minimum Tenant Admin.

Example request:

GET /api/v1/tenants/foo/services/number_portability_query/ HTTP/1.1
Host: example.com

{}

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "enableForOutgoingCalls": true,
   "enableForIncomingCalls": true,
   "enableForNetworkCallsOnly": false,
   "digitPatterns": []
}

Example request with not includeDigitPatterns:

GET /api/v1/tenants/foo/services/number_portability_query/ HTTP/1.1
Host: example.com

{
  "includeDigitPatterns": false
}
Request JSON Object:
  • includeDigitPatterns (boolean) – (optional) indicates to include digit patterns. Default value is true. The following parameters are only applicable if this is true.

  • insensitiveDigitPatternContains (string) – (optional) See insensitiveDigitPatternContains from Search criteria.

  • insensitiveDigitPatternEquals (string) – (optional) See insensitiveDigitPatternEquals from Search criteria.

  • insensitiveDigitPatternStarts (string) – (optional) See insensitiveDigitPatternStarts from Search criteria.

  • responseSizeLimit (integer) – (optional) indicates the response size limit for pagination.

Example response with not includeDigitPatterns:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "enableForOutgoingCalls": true,
   "enableForIncomingCalls": true,
   "enableForNetworkCallsOnly": false
}
Request JSON Object:
  • enableForOutgoingCalls (boolean) – indicates if it’s enabled for outgoing calls.

  • enableForIncomingCalls (boolean) – indicates if it’s enabled for incoming calls.

  • enableForNetworkCallsOnly (boolean) – indicates if it’s enabled for network calls only.

  • digitPatterns (array) – (conditional) an array of digit patterns. Returned only if requested by using includeDigitPatterns.

Status Codes:

Most frequent error:

  • 2 (INVALID_PARAMETERS) : some digit patterns provided are not valid

Modify Number Portability Query

PUT /api/v1/tenants/(string: tenant_id)/services/number_portability_query/

Modify number portability query settings.

Authorization rights: minimum Tenant Admin.

Example request:

PUT /api/v1/tenants/foo/services/number_portability_query/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "enableForOutgoingCalls": true,
   "enableForIncomingCalls": false,
   "enableForNetworkCallsOnly": true
}
Request JSON Object:
  • enableForOutgoingCalls (boolean) – indicates if is enabled for outgoing calls.

  • enableForIncomingCalls (boolean) – indicates if is enabled for incoming calls.

  • enableForNetworkCallsOnly (boolean) – indicates if is enabled for network calls only.

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "enableForOutgoingCalls": true,
   "enableForIncomingCalls": false,
   "enableForNetworkCallsOnly": true
}
Response JSON Object:
  • enableForOutgoingCalls (boolean) – indicates if is enabled for outgoing calls.

  • enableForIncomingCalls (boolean) – indicates if is enabled for incoming calls.

  • enableForNetworkCallsOnly (boolean) – indicates if is enabled for network calls only.

Status Codes:

Add Number Portability Query Digit Pattern List

POST /api/v1/tenants/(string: tenant_id)/services/number_portability_query/

Add one or more digit patterns. It is accepted a patterns in string format or a list of patterns.

Authorization rights: minimum Tenant Admin.

Example request with digitPatterns array:

POST /api/v1/tenants/foo/services/number_portability_query/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "digitPatterns": [
      "555???",
      "1"
   ]
}
Request JSON Object:
  • digitPatterns (array) – the list of digit patterns in string format.

Example response with digitPatterns array:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "digitPatterns": [
      "555???",
      "1"
   ]
}
Response JSON Object:
  • digitPatterns (array) – the list of digit patterns in string format.

Example request with digitPatterns string:

POST /api/v1/tenants/foo/services/number_portability_query/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "digitPatterns": "+32$"
}
Request JSON Object:
  • digitPatterns (string) – the digit pattern.

Example response with digitPatterns string:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "digitPatterns": "+32$"
}
Response JSON Object:
  • digitPatterns (string) – the digit pattern.

Status Codes:
  • 201 Created – no error

  • 400 Bad Request – full error. This could cover two cases: error reported during the validation of the data (in that case it is following the usual error structure Error messages) or at least one digit pattern already exists.

Most frequent validation errors:

  • 2 (INVALID_PARAMETERS): some digit patterns provided are not valid.

Delete Number Portability Query Digit Pattern List

DELETE /api/v1/tenants/(string: tenant)/services/number_portability_query/

Delete one or more digit patterns. It is accepted a patterns in string format or a list of patterns.

Authorization rights: minimum Tenant Admin.

Example request with digitPatterns array:

DELETE /api/v1/tenants/foo/services/number_portability_query/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "digitPatterns": [
      "555???",
      "1"
   ]
}
Response JSON Object:
  • digitPatterns (array) – the list of digit patterns in string format.

Example response with digitPatterns array:

HTTP/1.1 200 OK
Content-Type: "application/json"

{}
Status Codes:

Example request with digitPatterns string:

DELETE /api/v1/tenants/foo/services/number_portability_query/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "digitPatterns": "+32$"
}
Response JSON Object:
  • digitPatterns (string) – the digit pattern.

Example response with digitPatterns string:

HTTP/1.1 200 OK
Content-Type: "application/json"

{}
Status Codes: