LOOKING UP RESOURCES (GET)

Single objects, lists and tabular data

Looking up existing resources will always use the HTTP GET verb.

Returning a Specific Resource

Example:

GET /ClassesOfService/50

{
  "status": "success",
  "message": "",
  "data": {
    "CosId": 50,
    "Cos": "Subscriber",
    "Options": "",
    "OptionsArray": 
    [
      "NFP",
      "ALIAS",
      "@AUTODIALER",
      "NX",
      "NM",
      "NB"
    ],
    "ExpireDate": "2020-02-09",
    "GmtOffset": 0,
    "CurrencyId": 0,
    "Currency": "",
    "LanguageId": 0,
    "Language": "",
    "RateScheduleId": 106,
    "RateSchedule": "SUBSCRIBER",
    "SalesGroupId": 0,
    "SalesGroup": "",
    "TaxGroupId": 0,
    "TaxGroup": "",
    "PublicCos": true
  }
}

Returning a List of Resources Using the format Option

In build 3.14.1.59 and greater, a new URL option $format= has been added, which allows the format of the data returned to be specified.

IMPORTANT: This option is only supported for a small number of resources at this time, and will be noted on the resource's documentation page if supported. If you would like support for this option for a specific resource, please contact IVR Technologies.

Where applicable, this option can be used in place of the $filter= option described further on in this page, however the functionality of the '$filter=' option will remain backward compatible.

The $format= parameter can have the following values:

For example, to return a list of SIM objects, you would use the following syntax:

GET ivrapi/MobileSims?$format=raw

In the future, a combination of $format and $filter= may be supported to return a filtered list in the specified format .

Returning a List of Resource Names

To lookup a list of resources names that will be used to populate a drop down control, omit any IDs.

Where supported, you can use the ?format=list option instead.

Lists are returned as Id + Name pairs.

For example, to return a list of Class Of Service entries:

Returning a List of Resource Objects

To look up a list of resources objects (where applicable),use the ?format=raw option.

Lists are returned as raw objects.

For example, to return a list of SIMs:

{
  "status": "success",
  "message": "",
  "data": 
  [
    {
      "MobileSimId": 26,
      "Iccid": "0011223344",
      "Pin1": "pin1",
      "Puk1": "puk1",
      "Pin2": "pin2",
      "Puk2": "puk2",
      "Enabled": true,
      "SimStatusType": "sstActive",
      "ActiveProfileId": 0,
      "ActiveProfileName": "",
      "DefaultProfileId": 1,
      "DefaultProfileName": "Test",
      "TerminatedDateTime": "",
      "NotificationSimRegistration": true,
      "NotificationNetworkRegistration": true,
      "NotificationBalanceCall": true,
      "NotificationBalanceSms": true,
      "NotificationBalanceMms": true,
      "NotificationBalanceData": true,
      "NotificationTopUp": true,
      "NotificationLowBalance": true,
      "NotificationVoicemail": true,
      "MultiImsiVersion": "1.0",
      "ZonaCasaVersion": "2.0",
      "AccountId": 3,
      "Account": "100",
      "AccountGroupId": 8,
      "AccountGroup": "Mobile",
      "Description": "Description",
      "StartDateTime": "2016-03-25",
      "EndDateTime": "2016-05-12",
      "Notes": "Here are some notes.",
      "LastUpdatedDateTime": "2016-03-21T20:46:00",
      "LastUpdatedBy": "sa"
    },
    {
      "MobileSimId": 2,
      "Iccid": "12345",
      "Pin1": "1324",
      "Puk1": "4321",
      "Pin2": "",
      "Puk2": "",
      "Enabled": true,
      "SimStatusType": "sstActive",
      "ActiveProfileId": 1,
      "ActiveProfileName": "Test",
      "DefaultProfileId": 1,
      "DefaultProfileName": "Test",
      "TerminatedDateTime": "",
      "NotificationSimRegistration": true,
      "NotificationNetworkRegistration": false,
      "NotificationBalanceCall": true,
      "NotificationBalanceSms": true,
      "NotificationBalanceMms": false,
      "NotificationBalanceData": true,
      "NotificationTopUp": true,
      "NotificationLowBalance": true,
      "NotificationVoicemail": true,
      "MultiImsiVersion": "",
      "ZonaCasaVersion": "",
      "AccountId": 5076,
      "Account": "SUBSCRIBER",
      "AccountGroupId": 7,
      "AccountGroup": "SYSTEM",
      "Description": "Test",
      "StartDateTime": "",
      "EndDateTime": "",
      "Notes": "",
      "LastUpdatedDateTime": "2017-04-11T13:10:00",
      "LastUpdatedBy": "sa"
    }
  ]
}

Returning a Table of Resources

To return a table of resources, that will be used to populate a grid, omit any IDs and specify the $filter= option. The data will be returned with two objects: an array of column definitions (to be used as the header of the grid control or table), and an array of data rows.

Where supported, you can use the ?format=grid option instead.

For details, please see Returning Tabular Data.

For example, to return a table of Class Of Service entries:

GET /ivrapi/ClassesOfService/$filter=

{
  "status": "success",
  "message": "",
  "data": 
  [
    {
      "columns": 
      [
        {
          "caption": "COS ID",
          "field": "COS_ID",
          "type": 3,
          "visible": false,
          "width": 8
        },
        {
          "caption": "COS",
          "field": "COS",
          "type": 1,
          "visible": true,
          "width": 20
        },
        {
          "caption": "Options",
          "field": "OPTIONS",
          "type": 1,
          "visible": true,
          "width": 25
        },
        {
          "caption": "Expire Date",
          "field": "EXPIRE_DATE",
          "type": 5,
          "visible": true,
          "width": 13
        },
        {
          "caption": "GMT Offset",
          "field": "GMT_OFFSET",
          "type": 4,
          "visible": true,
          "width": 12
        },
        {
          "caption": "Currency",
          "field": "CURRENCY",
          "type": 1,
          "visible": true,
          "width": 10
        },
        {
          "caption": "Language",
          "field": "LANGUAGE",
          "type": 1,
          "visible": true,
          "width": 10
        },
        {
          "caption": "Rate Schedule",
          "field": "RATE_SCHEDULE",
          "type": 1,
          "visible": true,
          "width": 23
        },
        {
          "caption": "Sales Group",
          "field": "SALES_GROUP",
          "type": 1,
          "visible": true,
          "width": 13
        },
        {
          "caption": "Tax Group",
          "field": "TAX_GROUP",
          "type": 1,
          "visible": true,
          "width": 11
        }
      ],
      "rows": 
      [
        {
          "COS_ID": 40,
          "COS": "Default",
          "OPTIONS": "",
          "EXPIRE_DATE": "2020-07-21",
          "GMT_OFFSET": 0,
          "CURRENCY": "",
          "LANGUAGE": "",
          "RATE_SCHEDULE": "Default Rate Schedule",
          "SALES_GROUP": "",
          "TAX_GROUP": ""
        },
        {
          "COS_ID": 51,
          "COS": "MNO",
          "OPTIONS": "NX·ACCESS_ALLOW_INBOUND·ANI_ASSIGNMENT",
          "EXPIRE_DATE": "2020-02-09",
          "GMT_OFFSET": 0,
          "CURRENCY": "",
          "LANGUAGE": "",
          "RATE_SCHEDULE": "MNO",
          "SALES_GROUP": "Bob",
          "TAX_GROUP": ""
        },
        {
          "COS_ID": 52,
          "COS": "MVNO",
          "OPTIONS": "NX·BILLING_ZERO_DURATION",
          "EXPIRE_DATE": "2019-02-09",
          "GMT_OFFSET": 0,
          "CURRENCY": "",
          "LANGUAGE": "",
          "RATE_SCHEDULE": "MVNO",
          "SALES_GROUP": "",
          "TAX_GROUP": ""
        },
        {
          "COS_ID": 50,
          "COS": "Subscriber",
          "OPTIONS": "NFP·ALIAS·@AUTODIALER·NX·NM·NB",
          "EXPIRE_DATE": "2020-02-09",
          "GMT_OFFSET": 0,
          "CURRENCY": "",
          "LANGUAGE": "",
          "RATE_SCHEDULE": "SUBSCRIBER",
          "SALES_GROUP": "",
          "TAX_GROUP": ""
        },
      ]
    }
  ]
}