SIM Management
API Reference
Bar Service Config

Bar Service Config

This call allows setting the state of Bars and Services on a sim.

API Call Flow

To create a bar-service-config submission you'll need to call the Get Sim Services endpoint or Get Network Services which returns a list of available services for the sim / network specified. You can then build up a payload with the Bars / Services and valid values (from the Get Services response) and send it to the Submission endpoint.

Service Values

Setting the status of different Bars and Services can be counterintuitive, for a service of type Bar setting the value to false will enable the bar. However, for a service of type Service setting the value to false will disable the service. In the example below the Data bar is enabled (blocking data use on the sim) but the VoiceRoaming service is disabled (preventing Voice Roaming).

{ "name" : "data", "value": "false" },
{ "name" : "voiceRoaming", "value": "false" }

Bar Service Config Submission

Request

NameTypeDescriptionRestrictions
serialNumbersstring arrayserialNumbersRequired
servicesobject arrayAn array of Services corresponding to the SIMs you wish to updateAt least one

Services

NameTypeDescriptionRestrictions
namestringThe name of the service to changeRequired
valuestringThe value to set the service toRequired
curl --location 'https://api.cellhire.com/api/simSubmission/BarServiceConfig' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjRBMDlENTFBMDhEOEUxMTU0OTkyODFDN...' \
--data '{
  "serialNumbers":["01234567890"],
  "services": [
    { "name" : "admin", "value": "true" },
    { "name" : "data", "value": "false" }
  ]
}'

Get available Services for Sim

Request

curl --location 'https://api.cellhire.com/api/sim/{serialNumber}/services' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjRBMDlENTFBMDhEOEUxMTU0OTkyODFDN...' \

Response

NameTypeDescription
groupNamestringName of the service group
servicesobject arrayAn array of Services corresponding to the group

Services

NameTypeDescription
namestringThe name of the service
valuestringThe value the service is current set to
readOnlyboolWhether the service can be changed
typestringCan be Bar or Service, see Service Values
availableOptionsstring arrayAn array of valid values for this Service
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
[
    {
        "groupName": "main",
        "services": [
            {
                "optionValue": "true",
                "readOnly": false,
                "name": "admin",
                "type": "Bar",
                "availableOptions": [
                    "true",
                    "false",
                    null
                ]
            }
        ]
    }
]

Get available Services for network

Request

curl --location 'https://api.cellhire.com/api/network/{networkId}/services' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjRBMDlENTFBMDhEOEUxMTU0OTkyODFDN...' \

Response

NameTypeDescription
groupNamestringName of the service group
servicesobject arrayAn array of Services corresponding to the group

Services

NameTypeDescription
namestringThe name of the service
readOnlyboolWhether the service can be changed
typestringCan be Bar or Service, see Service Values
availableOptionsstring arrayAn array of valid values for this Service
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
[
    {
        "groupName": "main",
        "services": [
            {
                "readOnly": false,
                "name": "admin",
                "type": "Bar",
                "availableOptions": [
                    "true",
                    "false",
                    null
                ]
            }
        ]
    }
]

Get available Services for Network and Tariff

Request

curl --location 'https://api.cellhire.com/api/network/{networkId}/services?tariffNo={tariffNumber}' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjRBMDlENTFBMDhEOEUxMTU0OTkyODFDN...'

Response

NameTypeDescription
groupNamestringName of the service group
servicesobject arrayAn array of Services corresponding to the group

Services

NameTypeDescription
namestringThe name of the service
readOnlyboolWhether the service can be changed
typestringCan be Bar or Service, see Service Values
availableOptionsstring arrayAn array of valid values for this Service
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
[
    {
        "groupName": "main",
        "services": [
            {
                "readOnly": false,
                "name": "admin",
                "type": "Bar",
                "availableOptions": [
                    "true",
                    "false",
                    null
                ]
            }
        ]
    }
]