Device APIs
Click an API to expand/collapse it.
- Description
- Fetches a device by its UDID.
- Request Endpoint
- GET https://<Example api server address>/device/by/{udid}
- Parameters
-
Parameter |
Type |
Use |
Description |
udid |
String |
Required |
UDID of the device. |
- cURL syntax
-
curl --include \
'https://core.dev.Example.net/api/device/by/udid'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"id": "7ac20225-3e36-4fb3-8daa-bace45034df4",
"deleted": false,
"description": "Old Device",
"deviceStatus": "NORMAL",
"manufacturer": "Apple",
"model": "iPhone 5",
"os": "iOS 9",
"udid": "2083718938012321038243",
"simStateHashCode": null,
"simCardState": null,
"deletedUdid": null,
"deletedBy": null,
"deletedOn": null,
"name": null,
"brand": null,
"androidID": null,
"advertiserID": null,
"operator": null,
"country": null,
"language": null,
"screenWidthInPixels": null,
"screenHeightInPixels": null,
"screenWidthInInches": null,
"screenHeightInInches": null
},
"detail": null,
"error": false,
"message": "Fetching device detail successful"
}
Return to top
- Description
- Device information could be fetched to verify the SIM card status along with hashcode. If the status and hashcode are null, or status is "NOT_PRESENT", it can be assumed that the device does not have a SIM card.
- Request Endpoint
- GET https://<Example api server address>/device/sim/state/change/{UDID}
- Parameters
-
Parameter |
Type |
Use |
Description |
UDID |
String |
Required |
UDID of the device. |
- cURL syntax
-
curl --include \
'https://core.dev.Example.net/api/device/sim/state/change/UDID'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"id": "4538ad4a-a5b2-45ad-9e61-7d92e6285031",
"updatedBy": "",
"description": "new manufacturer",
"deviceStatus": "NORMAL",
"manufacturer": "manu1",
"model": "Samsung",
"os": "Android",
"udid": "4547889Ud",
"simStateHashCode": "hash2",
"simCardState": "SIM_PRESENT"
},
"detail": null,
"error": false,
"message": "Sim hashcode fetched successfully."
}
Return to top
- Description
-
- When user logs in, the SIM card status will reflect (after PIN verification).
- The Hash code will be sent from mobile client and stored in the DB against the device or user.
- When the user logs out the SIM card status will be removed. Upon logout of a user on a device, this information would no longer be relevant to store and could be deleted, so multiple users should not be associated with the same SIM data for a particular device at the same time. The Mobile Client should reference the Serial Number and Subscriber ID from the SIM card and possibly generate a reproducible hash we can store in the back-end for comparison. We will also need to account for a "not present" state for non-SIM devices, and ones with the SIM removed. So, we c
- This service accepts hashcode generated at the Mobile client, Sim operation status (CREATE / UPDATE / DELETE ), and device udid. On CREATE/UPDATE, the hashcode will be associated to the device along with the status "SIM_PRESENT".
- On delete, the hash code will be removed for the device along with the sim card status modification made to "SIM_REMOVED". Deletion hashcode is not required to pass.
- Request Endpoint
- POST https://<Example api server address>/device/sim/state/change
- Parameters
-
None.
- cURL syntax
-
curl --include \
--request POST \
--header "Content-Type: application/json" \
--data-binary "{
\"simCardOperation\" : \"CREATE\",
\"udid\" : \"4547889Ud\",
\"simStateHashCode\" : \"hash2\"
}" \
'https://core.dev.Example.net/api/device/sim/state/change'
- POST body attributes (JSON)
-
Attribute |
Type |
Use |
Description |
simCardOperation |
String |
Required |
CREATE/UPDATE/DELETE. |
udid
String |
Required |
UDID of the device. |
simStateHashCode |
String |
Optional |
Generated hashcode at the mobile client side. |
- POST body
-
Headers: Content-Type: application/json
{
"simCardOperation": "CREATE",
"udid": "4547889Ud",
"simStateHashCode": "hash2"
}
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"id": "4538ad4a-a5b2-45ad-9e61-7d92e6285031",
"updatedBy": "",
"description": "new manufacturer",
"deviceStatus": "NORMAL",
"manufacturer": "manu1",
"model": "Samsung",
"os": "Android",
"udid": "4547889Ud",
"simStateHashCode": "hash2",
"simCardState": "SIM_PRESENT"
},
"detail": null,
"error": false,
"message": "On State change hashcode created successfully"
}
Return to top