Service Numbers

The number endpoint allows clients to retrieve and manage the list of service numbers associated with a customer.

Server Side Paging

This API is implemented with server-side paging

GET /api/customer/:customer_id/number

Retrieve a list of service numbers owned by the given customer. Only service numbers directly related to the customer are provided. Service numbers owned by agents and/or resellers which are client customers of the given customer ID are not returned.

This request supports the following parameters:

Parameter Example Description
customer_id 3213 [URL parameter], [Required] The ID of the customer whose service numbers are to be retrieved.
sn 5400 [URL parameter], [Optional] The search term. This term will be used in filtering service numbers where the number includes the given search term within it.
fields profile_tags [URL parameter], [Optional] The list of fields to include which would normally be excluded. The only valid value for this parameters at this stage is profile_tags. When included, fields=profile_tags will trigger the inclusion of profile tags. As this is is a relatively costly operation, not including profile tags improves server performance.
paging fields The `number` API is designed with server-side paging enabled. All standard paging fields are supported.
sort fields The following sort fields are supported: sn

Response Content

The response will be a JSON array of objects, with each object consisting of the following information.

Key Type Description
call_plan_id String The unique of the currently scheduled flow, if there is one.
call_plan_name String The name of the currently scheduled flow, if there is one.
call_plan_version Integer The version of the currently active flow in effect, if there is one.
change_user String The name of the last user to change the service number data.
change_date Date The date at which the service number was last changed. The date will be provided as a string in ISO 8601 format.
customer_id Integer The unique ID of the customer to which this service number belongs.
effective_date Date The timestamp at which the currently active flow took effect. This will not include future dated scheduling and this field will not exist in the response if the service number has yet to have a flow scheduled. The date is provided as a string in ISO 8601 format.
id Integer The unique ID of the service number.
sn String The actual service number.
is_schedule_activated

In addition to the above fields one or more Profile Tag fields may also be provided, depending on system configuration. Profile tag fields are prefixed with pt_ and are drawn from the service number’s profile.

Profile tags are only returned if the fields parameter includes the value profile_tags.

While profile tags are site specific, the following profile tags are often available:

Key Type Description
pt_fci_country_code String The country code used in FCI requests for this number.
pt_fci_enabled Integer An integer representing true (1) or false (0). Whether FCI is enabled for this number.
pt_fci_service_code String The service code used in FCI requests for this number.
pt_language Integer The ID of the language to default to for this service number. The ID must match a language ID on the underlying OCNCC platform, the options for which are site specific.
pt_pin String A PIN code which may be used by callers to the OCNCC ACS Management Plan for altering flow details.
pt_divert_address_follow_me String The phone number to use when the follow me node is encountered for this service number.
pt_divert_address_follow_me_flag Integer Network type indicator that defaults to 0x02 (‘Private Network’).
pt_bar_payphone_callers Integer Indicate whether to allow payphone callers.
pt_toll_free_beeps_required Integer Number of tones to inform that the toll free number is being called.
pt_bar_cellphone_callers Integer Indicate whether to allow cellphone callers.

Examples

Request:

curl 'http://localhost/jarvis-agent/n2fe/api/customer/50203/number' -H 'Cookie: N2FE_CGISESSID=4876c530f3d7252330a95ea51007f252'

Response:

[
   {
      "pt_pin" : "123456",
      "change_user" : "SMF",
      "pt_fci_enabled" : null,
      "pt_bar_payphone_callers" : null,
      "pt_toll_free_beeps_required" : null,
      "effective_date" : "2018-04-03T03:26:34Z",
      "call_plan_id" : "190295",
      "id" : "109501",
      "is_schedule_activated" : "1",
      "pt_bar_cellphone_callers" : null,
      "pt_language" : 1,
      "call_plan_version" : "9",
      "change_date" : "20180320045636",
      "pt_fci_service_code" : null,
      "call_plan_name" : "new flow",
      "sn" : "0800222555",
      "pt_divert_address_follow_me" : null,
      "customer_id" : "50203",
      "pt_fci_country_code" : null
   },
   {
      "change_date" : "20180328232031",
      "pt_fci_service_code" : null,
      "call_plan_name" : "First Flow",
      "sn" : "0800522322",
      "pt_divert_address_follow_me" : null,
      "customer_id" : "50203",
      "pt_fci_country_code" : null,
      "pt_pin" : "123456",
      "change_user" : "SMF",
      "pt_fci_enabled" : null,
      "pt_toll_free_beeps_required" : null,
      "pt_bar_payphone_callers" : null,
      "call_plan_id" : "189886",
      "effective_date" : "2018-04-04T01:05:25Z",
      "id" : "109491",
      "is_schedule_activated" : "1",
      "pt_bar_cellphone_callers" : null,
      "pt_language" : 1,
      "call_plan_version" : "124"
   }
]

GET /api/customer/:customer_id/number/:service_number_id

Retrieve details for a single service number as configured in the underlying OCNCC system. The currently authenticated user must have access to the service number, and the service number must be owned by the given customer, otherwise the details will not be returned.

This request supports the following parameters:

Parameter Example Description
customer_id 3213 [URL parameter], [Required] The ID of the customer whose announcements are to be retrieved.
service_number_id 1421511 [URL parameter], [Required] This must be the service number ID, not the service number itself.

Response Content

The response will be a JSON object with the same content as the objects returned by the search query api/customer/:customer_id/number

Examples

Request:

curl 'http://localhost/jarvis-agent/n2fe/api/customer/50203/number/109501' -H 'Cookie: N2FE_CGISESSID=4876c530f3d7252330a95ea51007f252'

Response:

{
   "id" : "109501",
   "effective_date" : "2018-04-03T03:26:34Z",
   "customer_id" : "50203",
   "sn" : "0800222555",
   "pt_toll_free_beeps_required" : null,
   "pt_bar_payphone_callers" : null,
   "call_plan_id" : "190295",
   "pt_fci_service_code" : null,
   "pt_divert_address_follow_me" : null,
   "call_plan_version" : "9",
   "is_schedule_activated" : "1",
   "pt_language" : 1,
   "pt_bar_cellphone_callers" : null,
   "pt_pin" : "123456",
   "change_date" : "20180320045636",
   "pt_fci_country_code" : null,
   "pt_fci_enabled" : null,
   "call_plan_name" : "new flow",
   "change_user" : "SMF"
}

PUT /api/customer/:customer_id/number/:service_number_id

Update the profile of a customer’s service number. This updates the profile tags as provided by the query methods - i.e. those fields prefixed by pt_.

Parameter Example Description
customer_id 3213 [URL parameter], [Required] The ID of the customer whose announcements are to be retrieved.
sn 1421511 [URL parameter], [Required] This must be the service number ID, not the service number itself.

The content of the PUT request must be a JSON object with all the PT tags provided by the query request. no fields should be excluded unless they are to be deleted and if a tag should be kept, but empty, then the response should include that tag with null as its value.

To remove a tag completely from the service number profile, do not include it in the update response.

Response Content

The response will be a JSON object indicating the success or failure of the update.

Examples

File sn.json:

{
   "pt_fci_enabled" : null,
   "pt_language" : 1,
   "pt_bar_cellphone_callers" : null,
   "pt_divert_address_follow_me_flag" : 1,
   "pt_divert_address_follow_me" : "0215551515",
   "pt_pin" : null,
   "pt_fci_service_code" : null,
   "pt_fci_country_code" : null
}

Request:

curl -T sn.json -H 'Content-Type: application/json;charset=utf-8' 'http://localhost/jarvis-agent/n2fe/api/customer/1351/number/1421511' \
     -H 'Cookie: N2FE_CGISESSID=4876c530f3d7252330a95ea51007f252'

Response:

{
   "username" : "su",
   "success" : 1,
   "modified" : 1,
   "group_list" : "ACS_BOSS,CCS Superuser",
   "logged_in" : "1",
   "error_string" : ""
}