inventory Navigate to XML API
Add and update inventory API is designed for uploading new SIMs and Devices into the Telgoo5 system. This API supports both the addition and update of SIMs and Devices via a streamlined request process. Key Features: Bulk Operations: You can add or update up to 100 SIMs or Devices in a single API call. Model ID Requirements: SIMs: The model ID can be omitted when adding new SIMs. Devices: The model ID is mandatory when adding new Devices. Operation Types: Add: Use the type tag with the value "add" to insert new SIMs or Devices. Update: Use the type tag with the value "update" to modify existing SIMs or Devices. You can update Agent Assignment and status of the inventory item using this API. Status Updates: Utilize the status tag to change the status of a SIM or Device. Supported statuses include FREE, REMOVED, BAD, and USED. Agent Assignment: The assign_to tag allows for the reassignment of SIMs and Devices to different agents within the system. Any valid agent ID can be specified to update the agent chain. Usage Limits: Ensure not to exceed the maximum limit of 100 SIMs or Devices per request to maintain optimal performance and compliance with system constraints. This API facilitates efficient management and operational flexibility for SIMs and Devices within the Telgoo5 environment, enhancing overall system functionality and user experience.
Sample Request REST
{ "inventory": "[{'SIM': 7867860178607860001,'DEVICE': 786786178678601,'model':'2'}]", "carrier": "TMB", "status": "", "type": "add", "assign_to": "DevteamQA", "action": "add_and_update", "agent_id": "ewebsiteapi", "source": "WEBSITE", "request_name": "inventory" }
List of status code, description and resolution. | ||
---|---|---|
Status Code | Description | How to Resolve? |
RESTAPI000 | SUCCESS | SUCCESS |
RESTAPI001 | FAIL | Multiple errors like Invalid Token, Token already used, Token expire & Invalid Access!! |
RESTAPI101 | FAIL | Module required. |
RESTAPI102 | FAIL | Action required. |
RESTAPI103 | FAIL | Source Not Allowed. |
RESTAPI104 | FAIL | Invalid Agent ID or Password. |
RESTAPI105 | FAIL | Module does not exist. |
RESTAPI106 | FAIL | Action does not exist. |
RESTAPI107 | FAIL | Invalid company. |
RESTAPI108 | FAIL | Invalid method. |
RESTAPI109 | FAIL | Unauthorized Access. |
RESTAPI010 | FAIL | Multiple errors come in an array. |
Sample Response
{ "data": [ { "DESCRIPTION": "SUCCESS", "DEVICE": "786786178678601", "SIM": "7867860178607860001", "STATUSCODE": "00" } ], "msg_code": "RESTAPI000" }
Sample Fail Response: 1
{ "msg": "Invalid Token", "msg_code": "RESTAPI001", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ" }
Sample Fail Response: 2
{ "msg": "Invalid Access!!", "msg_code": "RESTAPI001", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ" }
Sample Fail Response: 3
{ "errors":["Source Not Allowed"] "msg": "Source Not Allowed", "msg_code": "RESTAPI103", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ" }
Sample Fail Response: 4
{ "errors":["Agent Id should not be blank"] "msg": "Agent Id should not be blank", "msg_code": "RESTAPI104", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ" }
Sample Fail Response: 5
{ "errors":["Invalid Agent Id"] "msg": "Invalid Agent Id", "msg_code": "RESTAPI104", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ" }
Sample Fail Response: 6
{ "msg": "Token already used", "msg_code": "RESTAPI001", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ" }
Sample Fail Response: 7
{ "msg": "Token expire", "msg_code": "RESTAPI001", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ" }
Sample Fail Response: 8
{ "errors":["Please enter Enrollment Id"] "msg": "Error occurred", "msg_code": "RESTAPI110", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ" }
All the status codes are listed under the status code sections. Please click here to go to the status code.