Get Device Details
Description
Returns detailed information about a specified device.
Resource URL
GET rws/api/v{apiVersion}/devices/{iccid}
Request Parameters
Parameter | Description |
---|---|
apiVersion |
The version number for this API. The current version for all functions is 1. |
iccid | The ICCID of the device you want information about. |
Response Parameters
Return Value | Description |
---|---|
iccid | The ICCID of the device. |
imsi | The device IMSI. |
msisdn | The device MSISDN or phone number. |
imei | The device IMEI. |
status | The device SIM status. For a list of valid values, see SIM Status Values. |
ratePlan | The name of the rate plan associated with the device. |
communicationPlan | The name of the communication plan associated with the device. |
customer | The name of the customer (generally an enterprise or business unit), if any, associated with this device. |
endConsumerId | The ID of the person, if any, associated with this device. |
dateActivated | The date when the device was first activated. See Date Formats for more details. |
dateUpdated | The date when the last device information update occurred. See Date Formats for more details. |
dateShipped | The date when the device SIM was transferred from the operator inventory into the enterprise account. See Date Formats for more details. |
accountId | The ID of the enterprise account associated with the device. |
fixedIPAddress |
The IPv4 address assigned to the device. This field may be null if the device communication plan uses dynamic IP addresses or if the device uses an IPv6 address instead. |
fixedIpv6Address | The IPv6 address assigned to the device. This field may be null if the device communication plan uses dynamic IP addresses or if the device uses an IPv4 address instead. |
operatorCustom1-5 | Values for any custom device fields the operator has created in Control Center. This information is applicable to users with operator roles only. |
accountCustom1-10 | Values for any custom device fields the enterprise has created in Control Center. This information is applicable to users with account roles only. |
customerCustom1-5 | Values for any custom device fields the customer has created in Control Center. This information is applicable to users with customer roles only. |
simNotes | Information the operator has added about the device. |
deviceID | Optional identifier that an account or customer can give to a device. |
modemID | Identifies the modem used by the device to transmit data. |
globalSIMType | For enterprises taking advantage of Control Center's Global SIM feature, this value indicates whether the device is using a primary SIM from the lead operator or a virtual subscription from a partner operator. |
Request Example
Make sure to use your own user credentials. See Authentication for information about creating an authorization header.
curl -X GET --header "Accept: application/json" --header "Authorization: Basic <YOUR-ENCRYPTED-CREDENTIALS>" "https://rws-jpotest.jasper.com/rws/api/v1/devices/8988216716970004975"
Response Example
{
"iccid": "8988216716970004975",
"imsi": "901161697004975",
"msisdn": "882351697004975",
"imei": "",
"status": "ACTIVATED",
"ratePlan": "hphlr rp1",
"communicationPlan": "CP_Basic_ON",
"customer": null,
"endConsumerId": null,
"dateActivated": "2016-06-29 00:21:33.339+0000",
"dateAdded": "2014-07-22 23:31:46.571+0000",
"dateUpdated": "2016-07-06 22:04:04.380+0000",
"dateShipped": "2016-06-27 07:00:00.000+0000",
"accountId": "100020620",
"fixedIPAddress": null,
"fixedIpv6Address": null,
"accountCustom1": "78",
"accountCustom2": "",
"accountCustom3": "",
"accountCustom4": "",
"accountCustom5": "",
"accountCustom6": "",
"accountCustom7": "",
"accountCustom8": "",
"accountCustom9": "",
"accountCustom10": "",
"simNotes": null,
"deviceID": null,
"modemID": "2221",
"globalSimType": ""
}
Code Samples
Make sure to use the Control Center sandbox URL and your own user credentials.
var request = require('request');
var body = [];
request.get('https://<your-base-URL>/rws/api/v1/devices/8988216716970004975').auth('username', 'password', false)
.on('error', function(error){
console.log('Error:', error);
})
.on('response', function(response) {
console.log(response.statusCode); // return statusCode
console.log(response.headers['content-type']); // return contentType
})
.on('data',function(chunk){
body.push(chunk);
})
.on('end',function(){
body = Buffer.concat(body).toString();
console.log(body);
});
import requests
import json
import base64
import pprint
cobrandURL=input("Cobrand URL: ")
url = 'https://'+cobrandURL+'/rws/api/v1/devices/'+input("iccid: ")
myResponse = requests.get(url,auth=(input("username: "),input("api_key: ")))
# For successful API call, response code will be 200 (OK)
if(myResponse.ok):
# Loading the response data into a dict variable
# json.loads takes in only binary or string variables so using content to fetch binary content
# Loads (Load String) takes a Json file and converts into python data structure (dict or list, depending on JSON)
jData = json.loads(myResponse.content)
pp=pprint.PrettyPrinter(indent=4)
pp.pprint(jData)
else:
# If response code is not ok (200), print the resulting http error code with description
print("Failure")
myResponse.raise_for_status()
#!/usr/bin/ruby -w
require 'rest-client'
require 'json'
url = 'https://<your-base-URL>/rws/api/v1/devices/89011704252318147060'
response = RestClient::Request.execute(
method: :get,
url: url,
user: 'username',
password: 'password',
:headers => {:accept => :json}
)
puts JSON.pretty_generate(JSON.parse(response))
Errors
Error Code | HTTP Code | Error Message |
---|---|---|
10000001 | 401 |
Invalid credentials. Description: Control Center uses this error message when the API credentials are invalid or when the IP address is not within the allowed range. |
10000024 | 400 | Invalid apiVersion. |
20000001 | 404 | Resource not found - Invalid ICCID. |
30000001 | 500 | Unknown server error. |