APIs CMO API Platforms Guidelines STC Specific Guidelines

Update

Field Name: VIN

  • Description:
    The VIN field is a unique identifier assigned to each vehicle.
  • Update Logic:
    VIN update is the asynchronous operation. The update body should target “productCharacteristic” entry with a query productCharacteristic[?(@.name=='VIN')].value. The operation returns a monitor to track the status of the update operation.
    It is possible to update both the status and the VIN field in a single request, but the monitor response will only display the status update.
  • Example:

Update VIN

To update the VIN, you need to send the following JSON payload:

  • Copy & paste
  • Output
# Replace <cmo_api_url> below with the CMO API URL 
# (click chain/copy icon in Application Management UI to copy API_URL to clipboard)
# API_URL = BaseURL(including version) + TenantName
$API_URL=<cmo_api_url>
$ACCESS_TOKEN=<access_token>
$VIN_VALUE=<vin_string>
$ICCID=<sim_iccid>

curl --location --request PATCH '$API_URL/product/STC-$ICCID' \
--header 'Content-Type: application/json-patch-query+json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--data-raw '[
    {
        "op": "replace",
        "path": "productCharacteristic[?(@.name=='\''VIN'\'')].value",
        "value": "$VIN_VALUE"
    }
]'
{
  "id": "<sim_iccid>-1737640000-monitor",
  "href": "<cmo_api_url>/monitor/<sim_iccid>-1737640000-monitor",
  "sourceHref": "<cmo_api_url>/monitor/<sim_iccid>-1737640000-monitor",
  "state": "IN_PROGRESS",
  "request": {
    "method": "PATCH",
    "body": [
      {
        "op": "replace",
        "path": "productCharacteristic[?(@.name=='VIN')].value",
        "value": "<vin_string>"
      }
    ],
    "headers": [
      {
        "name": "accept",
        "value": "application/json"
      },
      {
        "name": "content-type",
        "value": "application/json-patch-query+json"
      }
    ]
  },
  "response": [
    {
      "platform": "STC",
      "statusCode": 202,
      "state": "IN_PROGRESS",
      "body": {},
      "headers": [
        {
          "name": "X-STC-API-ClientCorrelationRef",
          "value": ""
        },
        {
          "name": "X-STC-API-ApiMsgRef",
          "value": "a2a958f2-643b-4a39-9165-b4096dc00000"
        }
        {
          "name": "X-STC-API-ClientMsgRef",
          "value": ""
        }
        {
          "name": "X-STC-API-TargetMsgRef",
          "value": "383221"
        }
      ]
    }
  ],
  "@type": "monitor",
  "errors": [],
  "correlationId": "0ae98ea1-6e11-4927-b4f4-dda8ffc0000"
}

Update VIN and Status

To update both the Status and the VIN you can use this example, although the resulting monitor will only reflect the status change operation.

  • Copy & paste
  • Output
# Replace <cmo_api_url> below with the CMO API URL 
# (click chain/copy icon in Application Management UI to copy API_URL to clipboard)
# API_URL = BaseURL(including version) + TenantName
$API_URL=<cmo_api_url>
$ACCESS_TOKEN=<access_token>
$VIN_VALUE=<vin_string>
$ICCID=<sim_iccid>

curl --location --request PATCH '$API_URL/product/STC-$ICCID' \
--header 'Content-Type: application/json-patch-query+json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--data-raw '[
    {
        "op": "replace",
        "path": "status",
        "value": "SUSPENDED"
    },
    {
        "op": "replace",
        "path": "productCharacteristic[?(@.name=='\''VIN'\'')].value",
        "value": "$VIN_VALUE"
    }
]'
{
  "id": "<sim_iccid>-1737640000-monitor",
  "href": "<cmo_api_url>/monitor/<sim_iccid>-1737640000-monitor",
  "sourceHref": "<cmo_api_url>/monitor/<sim_iccid>-1737640000-monitor",
  "state": "IN_PROGRESS",
  "request": {
    "method": "PATCH",
    "body": [
      {
        "op": "replace",
        "path": "status",
        "value": "SUSPENDED"
      },
      {
        "op": "replace",
        "path": "productCharacteristic[?(@.name=='VIN')].value",
        "value": "<vin_string>"
      }
    ],
    "headers": [
      {
        "name": "accept",
        "value": "application/json"
      },
      {
        "name": "content-type",
        "value": "application/json-patch-query+json"
      }
    ]
  },
  "response": [
    {
      "platform": "STC",
      "statusCode": 202,
      "state": "IN_PROGRESS",
      "body": {},
      "headers": [
        {
          "name": "X-STC-API-ClientCorrelationRef",
          "value": ""
        },
        {
          "name": "X-STC-API-ApiMsgRef",
          "value": "a2a958f2-643b-4a39-9165-b4096dc00000"
        }
        {
          "name": "X-STC-API-ClientMsgRef",
          "value": ""
        }
        {
          "name": "X-STC-API-TargetMsgRef",
          "value": "383221"
        }
      ]
    }
  ],
  "@type": "monitor",
  "errors": [],
  "correlationId": "0ae98ea1-6e11-4927-b4f4-dda8ffc0000"
}