All SIMs are validated before any tag is changed, for both single and bulk requests. If any SIM fails validation, the whole request is rejected with HTTP 400 and no tags are changed.
Edit Tags
Add or remove tags for one SIM or for SIMs in bulk.
Auth Scope
urn:grt:gemmContent-Type
application/jsonBase URL
https://gemmapi2.granitenet.com/v2/api/gemm/v1Uses and Requirements
Edit Tags API Response Behavior
The Edit Tags API responds synchronously or asynchronously, depending on the number of SIMs in the request:
| Request | Response |
|---|---|
| Exactly 1 SIM | Synchronous. The tags are updated immediately and the response contains the result. |
| 2 to 1000 SIMs | Asynchronous. The response contains only a transactionID. One callback is sent for each SIM, all with the same transactionID. |
Tag rules
- Each SIM must have at least one tag in
addTagsorremoveTags. - Each tag can be up to 100 characters and may contain only letters, numbers, spaces, colon (
:), underscore (_), hyphen (-), at (@) and period (.). - Each list can contain up to 10 tags, and tags in a list must be unique (case-insensitive).
- The same tag cannot appear in both
addTagsandremoveTags. - Single SIM only: a tag being added must not already exist on the SIM, and a tag being removed must already exist on the SIM.
- Single SIM only: a SIM can have at most 10 tags after the changes are applied.
- These two checks are not run for requests with two or more SIMs, so a bulk request is not rejected with
400for them.
Note
HTTP Status Codes
| Status | When |
|---|---|
200 | Single SIM: the tags were updated and the response contains the result. Two or more SIMs: the request was accepted, the response contains a transactionID and the result for each SIM is sent in a callback. |
400 | The request failed validation: no SIMs or more than 1,000, a SIM identifier is missing or has the wrong format, a SIM has no addTags or removeTags, a tag is invalid or repeated, the same tag is in addTags and removeTags, a SIM is not found, is not on your account or is still in Requested status, for a single SIM a tag to add already exists, a tag to remove does not exist or the SIM would have more than 10 tags, the macnum header is missing or malformed, or the body is not valid JSON. Two or more SIMs: the response lists each SIM with its error. |
401 | The bearer token is missing, invalid or expired, or you do not have access to the account in the macnum header. |
403 | The Write Tags feature is not enabled for your user, your token does not have a role allowed to call this endpoint, or (single SIM) the SIM belongs to an account you do not have access to or is not under the account in the macnum header. |
429 | Too many requests were sent in a short period. Wait briefly and retry. |
500 | An unexpected server error occurred. |
503 | The system is under scheduled maintenance. Retry after the maintenance window. |
504 | A dependent service did not respond in time. Retry the request. |
Available For
- ATT
- Granite Wireless - VzW
- T-Mobile
- Verizon
- Granite Multi Carrier SIM
- Verizon eSIM
- SIM360
Headers
| Header | Value |
|---|---|
Authorization | Bearer access-token |
Content-Type | application/json |
macnum | Macnum of the top level account for your organization. |
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sims | array of simInfo objects | Yes | NOTE: You can submit one or more SIMs in a request, up to a maximum of 1,000. |
simInfo | object | Yes | SIM information. |
iccid | string | Yes | 19-20 digits. |
tagItem | object | Yes | Container for tag operations, including addTags and removeTags. |
addTags | array of strings | Conditional | List of tags to add to the SIM, for example ["Test_Tag"]. |
removeTags | array of strings | Conditional | List of tags to remove from the SIM, for example ["UserTag"]. |
Request Examples
Responses
Sync Success Response (200 OK)
Sync Response Fields
| Parameter | Type | Description |
|---|---|---|
transactionID | string | A unique string saved for tracking purposes. |
result | object | Result status object. |
status | string | Result status: success or failure. |
message | string | Result message. |
Immediate Success Response (200 OK)
Response Fields
| Parameter | Type | Description |
|---|---|---|
transactionID | string | A unique string that associates the request with the results sent in callbacks. Mobility sends a separate callback for each SIM in the request, indicating whether the operation succeeded for that SIM. All callbacks have the same transactionID. |
Callback Success Response
Callback Response Fields
| Parameter | Type | Description |
|---|---|---|
requestType | string | Name of the requested action. For Edit Tags, the value is EditTags. |
transactionID | string | A unique string that associates the request with the results sent in callbacks. Mobility sends a separate callback for each SIM in the request, indicating whether the operation succeeded for that SIM. All callbacks have the same transactionID. |
simInfo | object | SIM information. |
iccid | string | 19-20 digits. |
msisdn | string | 10 digits. |
result | object | Result status object. |
status | string | Result status: success or failure. |
message | string | Result message. |
errors | object | List of errors. |
errorCode | string | Error code. |
errorMessage | string | Error message. |
callbackCount | integer | The number of times this callback message has been sent. |
maxCallbackThreshold | integer | The maximum number of times this callback message will be sent if it is not correctly acknowledged. |
Failure Responses
Immediate Error Message
Error Response Fields
| Parameter | Type | Description |
|---|---|---|
result | object | Result status object. |
status | string | Result status: success or failure. |
errors | object | List of errors. |
errorCode | string | Error code. |
errorMessage | string | Error message. |
Sync Failure Response: Single SIM (500)
When the tag update for a single SIM fails, the HTTP 500 response has the same shape as the sync success response, with no errors list.
Immediate Validation Error: Two or More SIMs (400)
When a request with two or more SIMs fails validation, the HTTP 400 response lists each SIM with its error.
Example Failure Callback: Bulk SIMs
Code Examples
Related Links
Last updated on