You can submit 1 SIM per request, or up to 1,000 when bulk Change IP is enabled for your account.
Change IP
Changes the IP type of the service for one or more SIMs.
Auth Scope
urn:grt:gemmContent-Type
application/jsonBase URL
https://gemmapi2.granitenet.com/v2/api/gemm/v1Uses and Requirements
Mobility sends an asynchronous SubscriberService callback for each SIM in the request when the IP type change is applied, or if the change fails.
Note
HTTP Status Codes
| Status | When |
|---|---|
200 | The request was accepted and a transactionID was returned. The IP change is applied asynchronously and the result for each SIM is sent later in a callback. |
400 | Validation failed (for example, an ICCID that is not 19-20 digits, duplicate ICCIDs, more SIMs than allowed (1, or up to 1,000 when bulk Change IP is enabled for your account), or a networkApn or carrierSubnet that is too long or has invalid characters), or a SIM is not eligible: it was not found, is not under the macnum account, is not Activated or Suspended, is not a Granite Multi Carrier SIM, or the SIMs are on different carriers. Also returned when the networkApn or carrierSubnet does not exist for your account, or, for a single SIM, when the SIM already has the requested dynamic IP or APN. No SIM is processed. |
401 | The bearer token is missing, invalid or expired, or you do not have access to the account in the macnum header. |
403 | Change IP is not enabled for your account, your token's role does not allow this action, or the SIM belongs to an account you do not have access to or that 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
- Granite Multi Carrier SIM
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 | The SIMs whose IP type you want to change, specified by simInfo objects. You can submit 1 SIM per request, or up to 1,000 when bulk Change IP is enabled for your account. |
simInfo | object | Yes | SIM information. |
iccid | string | Yes | 19-20 digits. An F is allowed as the 20th character. |
networkApn | string | Conditional | The name of the APN to apply to the SIMs, for example Test APN. |
carrierSubnet | string | No | The IP range for the specified networkApn, for example 10.2.3.1/12. The IP range must already exist in the system for that APN. |
Request Examples
Request to change the IP to Private Static:
Request to change the IP to Public Static:
Request to change the IP to Public Dynamic (Removing APN):
Responses
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 that matched the request, showing whether the operation succeeded for that SIM and containing any requested information. All callbacks for the request have the same transactionID. |
Callback Success Response
Callback Response Fields
| Parameter | Type | Description |
|---|---|---|
requestType | string | Name of the requested action. For Change IP, the value is ChangeIP. |
transactionID | string | A unique string that associates the request with the results sent in callbacks. Mobility sends a separate callback for each SIM that matched the request, showing whether the operation succeeded for that SIM and containing any requested information. All callbacks for the request have the same transactionID. |
simInfo | object | SIM information. |
iccid | string | 19-20 digits. |
msisdn | string | 10 digits. |
ipAddress | string | The IP address returned by the carrier for a static IP. |
result | object | An object containing the result status. |
status | string | Result status: success or failure. |
message | string | Result message. |
errors | object | A list of error objects, if any. |
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 | An object containing the result status. |
status | string | Result status: success or failure. |
errors | object | A list of error objects, if any. |
errorCode | string | Error code. |
errorMessage | string | Error message. |
SIM Eligibility Error (HTTP 400)
When a SIM is not eligible (for example, it was not found, is not Activated or Suspended, is not a Granite Multi Carrier SIM, or the SIMs are on different carriers), the response is HTTP 400 with a per-SIM validation body instead of the format above. validationErrorInfo gives the overall message, and data.simCardDetails lists each SIM with its error in status.
Example Async Error Message
Error Response Fields
| Parameter | Type | Description |
|---|---|---|
requestType | string | Name of the requested action. For Change IP, the value is ChangeIP. |
simInfo | object | SIM information. |
iccid | string | 19-20 digits. |
msisdn | string | 10 digits. |
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. |
transactionID | string | A unique string that associates the request with the results sent in callbacks. |
result | object | An object containing the result status. |
status | string | Result status: success or failure. |
errors | object | A list of error objects, if any. |
errorCode | string | Error code. |
errorMessage | string | Error message. |
Code Examples
Related Links
Last updated on