Download OpenAPI specification:
The nRF Cloud REST API allows you to programmatically interact with, and retrieve historical information generated by, any device that you have connected to nRFCloud.com.
The REST API documentation is a supplement to the main nRF Cloud documentation.
DevZone is Nordic Semiconductor's official tech support site and community. Get help from a dedicated tech support team and more than 25,000 other community members.
If you are encountering unexpected behavior or errors, check the current status of nRF Cloud.
Some of the endpoints return specific error codes (called 'nRF Codes'), which can be found in this table.
| nRF Code | Error | Reason | Solution |
|---|---|---|---|
|
40000
|
Bad request error. | This error could mean many things. Most of the time it means something is not as expected on the cloud like a file was missing or an internal service failed. | Alert Nordic support by filing a ticket on DevZone. |
|
40001
|
Device does not have a valid device certificate for associating (adding) it to your account. | Your nRF9160 DK device or Thingy:91 device does not have a 'just-in-time provisioning' (JITP) certificate, or the certificate has been corrupted. | Refer to the nRF9160 DK Getting Started Guide or Thingy:91 Getting Started Guide for information on upgrading your device certificate. |
|
40002
|
Device cannot be dissociated (removed from your account). | The nRF9160 DK or Thingy:91 you are trying to dissociate was added to your account using the legacy
pairing mechanism (button and switch pattern) instead of the AssociateDevice endpoint.
|
Delete the device from your account using either the Configure > Delete
Device menu item on nrfcloud.com or the DeleteDevice endpoint. If you want to re-add this device to your account you
will first have to flash a new device certificate and upgrade the firmware. Refer to the
nRF9160 DK Getting Started Guide or
Thingy:91 Getting Started Guide for information on how to do this.
|
|
40005
|
Usage limit exceeded. | The API request exceeds one of the monthly usage limits defined on the Pricing page for users on the free Developer plan. | Wait until the beginning of the next month to continue your usage on the Developer plan, or upgrade to the Pro or Enterprise plan. See nRF Cloud plans to learn about the available plans, how to view your plan details and usage, and how to upgrade your plan. |
|
40100
|
Access denied error. | The user making the request does not have access to the requested resource (device, SIM, invitation, etc.). | Confirm your authorization is correct. Refer to the endpoint's documentation to determine if your request requires a Simple Token (API Key) or a JSON Web Token (JWT). Some endpoints accept either. |
|
40101
|
Device is already associated with another account. | Another user has already added this device to their account. | If you know the other account owner you can request that they dissociate the device so that you can add it to your account. Otherwise, this operation is not allowed. |
|
40102
|
The ownership code is invalid for this device. | You entered the wrong ownership code (PIN or HWID) that is printed on the Nordic Semiconductor product label, or which you submitted when creating a new device certificate. | Verify the PIN or HWID and enter it correctly. |
|
40103
|
This device is not associated with your account. | The device you want to dissociate (remove from your account) is not found in your account. | None. You are not allowed to do this. |
|
40410
|
Entity not found. | This error can be thrown for a variety of reasons, indicating that the entity could not be found by its ID. The entity could be a device, a certificate, or an API key, for example. | Refer to the associated message for details. For devices, confirm the device id you entered matches your existing device ID and that the device has not been deleted. You can confirm using the ListDevices endpoint. |
|
40411
|
A Nordic Semiconductor product with this device id and ownership code could not be found. | The device id you entered matches the format for a Nordic Semiconductor product, but the device id and/or ownership code cannot be found in our system. | Compare the values you entered with what is printed on your product's label (for devices
with IMEI printed on the label, the device id will be nrf-[IMEI], e.g., nrf-123456789012345).
If you submitted the correct values, please contact Nordic Semiconductor Tech Support for further
assistance.
|
|
40412
|
No device found for this id. The device has not yet been provisioned. | The device cannot be found in the nRF Cloud IoT device registry. The most likely reason
is that the device has not established an initial communication with the nRF Cloud MQTT broker, which
creates a new entry in the registry. Possible causes:
|
Solutions that match the possible reasons are listed here. For Nordic Semiconductor products,
refer to the
Getting Started Guide for your device.
|
|
40413
|
No device found for this id. | You are trying to dissociate a device that is not found in your account (wrong device id), or you are submitting the device's friendly name, not the id. | Verify you are passing the correct device id (not the friendly name you may have given it). |
|
40414
|
No device found for this id. | You are trying to delete a device that was not found in your account or in the IoT registry (i.e., provisioned, but not yet added to your account). | This may not be an error, because the device may already be deleted. Verify you entered the correct device id and ownership code (PIN or HWID on the label). For Nordic Semiconductor products, see the solution for nRF Code 40411, above. |
|
40420
|
Resource not found. | This error can be thrown for a variety of reasons, indicating that a resource could not be found by its ID. The resource could be a device, a certificate, or an API key, for example. | Refer to the associated message for details. For devices, confirm the device id you entered matches your existing device ID and that the device has not been deleted. You can confirm using the ListDevices endpoint. |
|
40499
|
Not found, but no error. | The requested item(s) do not exist, but there is no error. For some requests, if the list to be returned is empty, this code and an explanatory message is returned instead of an empty list. | No action is necessary. |
|
41600
|
Range not satisfiable. | You are calling an endpoint that uses the Range header and the byte range does not exist in the target file or the range header itself is malformed. | Check the expected file size for the target file and ensure the range requested exists. Refer to the range header docs for more information. |
|
42200
|
Validation failed. | You are calling an endpoint with invalid request data. | Check the expected request format and try again. |
Fetch information about your team (also known as tenant), your team's current plan, and your user role and permissions for that team. Only team owners are allowed to view current month costs. The API key you use as the Bearer token in this request is specific to one team. You have one API key for each team of which you are a member.
| mqttEndpoint required | string The MQTT endpoint to connect to |
| mqttTopicPrefix required | string The global prefix for all topics |
required | DeveloperPlan (object) or ProOrHigherPlan (object) or EnterprisePerDeviceBillingModelPlan (object) Deprecated |
| role required | string (TenantUserRole) Enum: "owner" "admin" "editor" "viewer" |
required | object Information about your team that owns the devices accessible by your API key |
| userId required | string (UUID) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
| tags | Array of strings (DeviceTag) Your assigned list of device tags (device groups in the nrfcloud.com UI). You can access devices that have any of these tags assigned, and devices that have no tags assigned. |
{- "mqttEndpoint": "mqtt.nrfcloud.com",
- "mqttTopicPrefix": "prod/a5592ec1-18ae-4d9d-bc44-1d9bd927bbe9/",
- "team": {
- "name": "My Team 1",
- "tenantId": "a5592ec1-18ae-4d9d-bc44-1d9bd927bbe9"
}, - "role": "owner",
- "userId": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "tags": [
- "warehouse-east",
- "temperature"
], - "plan": {
- "currentMonthCosts": [
- {
- "serviceId": "AGPS",
- "serviceDescription": "string",
- "quantity": 0.1,
- "price": 0.1,
- "total": 0.1
}
], - "currentMonthTotalCost": 0.1,
- "name": "DEVELOPER",
- "limits": {
- "devices": 10,
- "monthlyLocationServiceRequests": 500,
- "monthlyFOTAJobExecutions": 50,
- "monthlyStoredDeviceMessages": 3000,
- "messageRoutingServiceDestinations": 1
}
}
}Creates a new service key pair for authenticating REST endpoints that support JWTs. The public key is stored in nRF Cloud for use in JWT verification. The response contains the private key and a JWT signed by it, with a one year expiry. The private key can be used to generate additional JWTs with an expiry of your choice.
| key required | string (PrivateKey) The private key of the service key pair. |
| token required | string (ServiceKeyJwt) JWT signed by the private key of the service key pair. |
{- "key": "-----BEGIN PRIVATE KEY-----MIIEowIBAAKCAQEAqSnu/Mn/G5BWYif0mIaVYJG8...-----END PRIVATE KEY-----",
- "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzU0NDQ2NDAsImlhdCI6MTYzMjg1MjY1NCwic3ViIjoibnJmY2xvdWQtZXZhbHVhdGlvbi1kZXZpY2UtM2JmNTBlY2YtMmY3Zi00NjlmLTg4YTQtMmFhODhiZGMwODNiIn0.ldxPFg7xofD8gxjRkdu8WXl-cD01wVqn-VhvhyeuEXMeAmFpDHbSxEo5rs1DofEougUQnZy31T-e_5EQ8rlNMg"
}Gets the service token. The returned token is usable for all services.
| createdAt required | string (ServiceKeyCreatedAt) The date when the service key pair was created in ISO format. |
| token required | string (ServiceKeyJwt) JWT signed by the private key of the service key pair. |
{- "createdAt": "2022-12-19T19:39:02.655Z",
- "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzU0NDQ2NDAsImlhdCI6MTYzMjg1MjY1NCwic3ViIjoibnJmY2xvdWQtZXZhbHVhdGlvbi1kZXZpY2UtM2JmNTBlY2YtMmY3Zi00NjlmLTg4YTQtMmFhODhiZGMwODNiIn0.ldxPFg7xofD8gxjRkdu8WXl-cD01wVqn-VhvhyeuEXMeAmFpDHbSxEo5rs1DofEougUQnZy31T-e_5EQ8rlNMg"
}List all team tags for your account.
| items required | Array of strings (DeviceTag) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- "string"
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}Generates a JSON Web Token (JWT) for evaluating nRF Cloud Location Services by proxy servers. You may use this token to authenticate proxy server requests to any of the Location Service endpoints that indicate Service Evaluation Token among their Authorizations.
Calling this endpoint for the first time will start your 30-day evaluation period, after which you will need to contact Nordic Sales if you want to extend your evaluation period, or enter into a business agreement for commercial cloud-to-cloud use.
The JWT claims are set automatically by nRF Cloud when this token is generated. Although it can be regenerated upon request, the initial 30-day trial period remains unchanged.
For more information see JWT authentication for nRF Cloud.
| expires required | string <date-time> (ExpirationDate) Expiration date for the provided Service Evaluation Token |
| token required | string (ServiceKeyJwt) JWT signed by the private key of the service key pair. |
{- "expires": "2019-08-24T14:15:22Z",
- "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzU0NDQ2NDAsImlhdCI6MTYzMjg1MjY1NCwic3ViIjoibnJmY2xvdWQtZXZhbHVhdGlvbi1kZXZpY2UtM2JmNTBlY2YtMmY3Zi00NjlmLTg4YTQtMmFhODhiZGMwODNiIn0.ldxPFg7xofD8gxjRkdu8WXl-cD01wVqn-VhvhyeuEXMeAmFpDHbSxEo5rs1DofEougUQnZy31T-e_5EQ8rlNMg"
}Returns an existing Service Evaluation Token. Calling this endpoint will not start your evaluation period. You may create one by calling the GenerateServiceEvaluationToken endpoint.
| expires required | string <date-time> (ExpirationDate) Expiration date for the provided Service Evaluation Token |
| token required | string (ServiceKeyJwt) JWT signed by the private key of the service key pair. |
{- "expires": "2019-08-24T14:15:22Z",
- "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzU0NDQ2NDAsImlhdCI6MTYzMjg1MjY1NCwic3ViIjoibnJmY2xvdWQtZXZhbHVhdGlvbi1kZXZpY2UtM2JmNTBlY2YtMmY3Zi00NjlmLTg4YTQtMmFhODhiZGMwODNiIn0.ldxPFg7xofD8gxjRkdu8WXl-cD01wVqn-VhvhyeuEXMeAmFpDHbSxEo5rs1DofEougUQnZy31T-e_5EQ8rlNMg"
}Fetch a list of devices associated with the team defined by your API key.
| deviceIds | Array of strings (DeviceId) [ items/^[a-z0-9:_-]{1,128}$/i ] Example: deviceIds=nrf-1234567890123456789000 If specified, only return devices with matching identifiers |
| deviceNameFuzzy | string |
| firmwareSupport | Array of strings (FirmwareTypes) Items Enum: "APP" "MODEM" "BOOT" "SOFTDEVICE" "BOOTLOADER" "MDM_FULL" "SMP" "CUSTOM" If specified, only return devices that support the given firmware types |
| firmwareSupportExclude | Array of strings (FirmwareTypes) Items Enum: "APP" "MODEM" "BOOT" "SOFTDEVICE" "BOOTLOADER" "MDM_FULL" "SMP" "CUSTOM" |
| includeState | boolean Deprecated Default: false If false (the default), the device’s state is not returned, but only the device metadata. This allows you to keep the response size small if needed. |
| includeStateMeta | boolean Deprecated Default: false If false (the default), the metadata for an IP-based device's state (i.e., timestamps reflecting each property's last updated time) are not returned. |
| pageLimit | integer <int32> (PageLimit) [ 1 .. 100 ] Default: "10" Maximum number of items you want returned in the response (<=100). |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
| subTypes | Array of strings (ThingType) [ items/[a-zA-Z0-9_.,@\/:#-]{0,799}/ ] |
| tags | Array of strings (DeviceTag) If specified, only return devices that have one of these tags AND are accessible by the user's Role and their assigned Device Groups (tags) |
| transform | Array of strings Not a true array of strings, but rather a JSONata expression such as |
required | Array of Device (GenericDevice (object)) or JSONataTransformedResponse (any) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- {
- "id": "nrf-1234567890123456789000",
- "name": "new-device-name",
- "image": "string",
- "tags": [
- "warehouse-east",
- "temperature"
], - "tenantId": "a5592ec1-18ae-4d9d-bc44-1d9bd927bbe9",
- "subType": "jitp-generic",
- "firmware": {
- "supports": [
- "BOOT",
- "APP",
- "MODEM",
- "SOFTDEVICE"
], - "app": {
- "version": "string",
- "name": "string"
}, - "boot": "string",
- "modem": "string",
- "smpDeviceAppVer": "string"
}, - "$meta": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": 4.421
}, - "type": "Generic",
- "state": {
- "reported": {
- "connected": false,
- "sessionIdentifier": "ab6af4e7-32e8-4107-94d8-f096e776c077",
- "pairing": {
- "state": "paired",
- "topics": {
- "d2c": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/m/d/nrf-123456789012345",
- "c2d": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/m/d/nrf-123456789012345/c2d"
}
}, - "nrfcloud_mqtt_topic_prefix": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/",
- "device": {
- "networkInfo": {
- "currentBand": 20,
- "supportedBands": "(1,2,3,4,5,8,12,13,17,18,19,20,25,26,28,66)\r\n",
- "areaCode": 3030,
- "mccmnc": "22801",
- "ipAddress": "10.1.10.106",
- "ueMode": 2,
- "cellID": 17513992,
- "networkMode": "LTE-M GPS"
}, - "simInfo": {
- "uiccMode": 1,
- "iccid": "89410119346707573424",
- "imsi": "228017001757342"
}, - "deviceInfo": {
- "modemFirmware": "mfw_nrf9160_1.2.0",
- "batteryVoltage": 5203,
- "imei": "123456789012345",
- "board": "nrf9160_pca10090",
- "appVersion": "v1.2.0-406-gbc7ade8b14a1",
- "appName": "asset_tracker"
}, - "serviceInfo": {
- "ui": [
- "GPS",
- "FLIP",
- "TEMP",
- "HUMID",
- "AIR_PRESS",
- "RSRP"
], - "fota_v1": [
- "APP",
- "MODEM"
]
}
}, - "config": {
- "GPS": {
- "enable": false
}
}
}, - "desired": {
- "pairing": {
- "state": "paired",
- "topics": {
- "d2c": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/m/d/nrf-123456789012345",
- "c2d": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/m/d/nrf-123456789012345/c2d"
}
}, - "nrfcloud_mqtt_topic_prefix": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/"
}, - "delta": {
- "config": {
- "GPS": {
- "enable": true
}
}
}, - "metadata": {
- "desired": {
- "pairing": {
- "state": {
- "timestamp": 1594295242
}, - "topics": {
- "d2c": {
- "timestamp": 1594295242
}, - "c2d": {
- "timestamp": 1594295242
}
}
}, - "nrfcloud_mqtt_topic_prefix": {
- "timestamp": 1594295242
}
}, - "reported": {
- "connected": {
- "timestamp": 1594395957
}, - "sessionIdentifier": {
- "timestamp": 1594395957
}, - "pairing": {
- "state": {
- "timestamp": 1594395561
}, - "topics": {
- "d2c": {
- "timestamp": 1594395561
}, - "c2d": {
- "timestamp": 1594395561
}
}
}, - "nrfcloud_mqtt_topic_prefix": {
- "timestamp": 1594395561
}, - "device": {
- "networkInfo": {
- "currentBand": {
- "timestamp": 1594395562
}, - "supportedBands": {
- "timestamp": 1594395562
}, - "areaCode": {
- "timestamp": 1594395562
}, - "mccmnc": {
- "timestamp": 1594395562
}, - "ipAddress": {
- "timestamp": 1594395562
}, - "ueMode": {
- "timestamp": 1594395562
}, - "cellID": {
- "timestamp": 1594395562
}, - "networkMode": {
- "timestamp": 1594395562
}
}, - "simInfo": {
- "uiccMode": {
- "timestamp": 1594395562
}, - "iccid": {
- "timestamp": 1594395562
}, - "imsi": {
- "timestamp": 1594395562
}
}, - "deviceInfo": {
- "modemFirmware": {
- "timestamp": 1594395562
}, - "batteryVoltage": {
- "timestamp": 1594395562
}, - "imei": {
- "timestamp": 1594395562
}, - "board": {
- "timestamp": 1594395562
}, - "appVersion": {
- "timestamp": 1594395562
}, - "appName": {
- "timestamp": 1594395562
}
}, - "serviceInfo": {
- "ui": [
- {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}
], - "fota_v1": [
- {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}
]
}
}, - "config": {
- "GPS": {
- "enable": {
- "timestamp": 1594295362
}
}
}
}
}, - "version": 8115
}
}
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}Delete a device from your account. If you are attempting to delete a Nordic hardware product that was onboarded but not yet added to your account (associated), you must also pass the ownership code (PIN or HWID on the product label) in the request body. This will forward a DEVICE DISCON message on the /c2d MQTT topic, allowing the device to gracefully disconnect. You can view the format here.
curl -X DELETE $API_HOST/v1/devices/$DEVICE_ID -d $DEVICE_OWNERSHIP_CODE -H "Authorization: Bearer $API_KEY" -H "Content-Type: text/plain"
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
"string"Fetch a device and its state.
curl $API_HOST/v1/devices/$DEVICE_ID -H "Authorization: Bearer $API_KEY"
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| transform | Array of strings Not a true array of strings, but rather a JSONata expression such as |
required | object (DeviceDocMeta) |
| id required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i This is the canonical device id used in the device certificate, and as the MQTT client id. |
| name required | string (DeviceName) ^[a-zA-Z0-9.@:#-]{1,128}$ Friendly device name. Can be used for searching and filtering devices. |
required | NonGatewayIPDeviceSubType (string) or string |
| tags required | Array of strings (DeviceTag) |
| tenantId required | string (TenantId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... The UUID of the team owning the device(s) |
| type required | string (deviceTypes.Generic) Value: "Generic" |
object (DeviceFirmwareArgs) | |
| image | string (Url) |
object (GenericDeviceState) |
{- "id": "nrf-1234567890123456789000",
- "name": "new-device-name",
- "image": "string",
- "tags": [
- "warehouse-east",
- "temperature"
], - "tenantId": "a5592ec1-18ae-4d9d-bc44-1d9bd927bbe9",
- "subType": "jitp-generic",
- "firmware": {
- "supports": [
- "BOOT",
- "APP",
- "MODEM",
- "SOFTDEVICE"
], - "app": {
- "version": "string",
- "name": "string"
}, - "boot": "string",
- "modem": "string",
- "smpDeviceAppVer": "string"
}, - "$meta": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": 4.421
}, - "type": "Generic",
- "state": {
- "reported": {
- "connected": false,
- "sessionIdentifier": "ab6af4e7-32e8-4107-94d8-f096e776c077",
- "pairing": {
- "state": "paired",
- "topics": {
- "d2c": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/m/d/nrf-123456789012345",
- "c2d": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/m/d/nrf-123456789012345/c2d"
}
}, - "nrfcloud_mqtt_topic_prefix": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/",
- "device": {
- "networkInfo": {
- "currentBand": 20,
- "supportedBands": "(1,2,3,4,5,8,12,13,17,18,19,20,25,26,28,66)\r\n",
- "areaCode": 3030,
- "mccmnc": "22801",
- "ipAddress": "10.1.10.106",
- "ueMode": 2,
- "cellID": 17513992,
- "networkMode": "LTE-M GPS"
}, - "simInfo": {
- "uiccMode": 1,
- "iccid": "89410119346707573424",
- "imsi": "228017001757342"
}, - "deviceInfo": {
- "modemFirmware": "mfw_nrf9160_1.2.0",
- "batteryVoltage": 5203,
- "imei": "123456789012345",
- "board": "nrf9160_pca10090",
- "appVersion": "v1.2.0-406-gbc7ade8b14a1",
- "appName": "asset_tracker"
}, - "serviceInfo": {
- "ui": [
- "GPS",
- "FLIP",
- "TEMP",
- "HUMID",
- "AIR_PRESS",
- "RSRP"
], - "fota_v1": [
- "APP",
- "MODEM"
]
}
}, - "config": {
- "GPS": {
- "enable": false
}
}
}, - "desired": {
- "pairing": {
- "state": "paired",
- "topics": {
- "d2c": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/m/d/nrf-123456789012345",
- "c2d": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/m/d/nrf-123456789012345/c2d"
}
}, - "nrfcloud_mqtt_topic_prefix": "prod/7c219c23-644e-4565-9fe7-6c56ab8bf949/"
}, - "delta": {
- "config": {
- "GPS": {
- "enable": true
}
}
}, - "metadata": {
- "desired": {
- "pairing": {
- "state": {
- "timestamp": 1594295242
}, - "topics": {
- "d2c": {
- "timestamp": 1594295242
}, - "c2d": {
- "timestamp": 1594295242
}
}
}, - "nrfcloud_mqtt_topic_prefix": {
- "timestamp": 1594295242
}
}, - "reported": {
- "connected": {
- "timestamp": 1594395957
}, - "sessionIdentifier": {
- "timestamp": 1594395957
}, - "pairing": {
- "state": {
- "timestamp": 1594395561
}, - "topics": {
- "d2c": {
- "timestamp": 1594395561
}, - "c2d": {
- "timestamp": 1594395561
}
}
}, - "nrfcloud_mqtt_topic_prefix": {
- "timestamp": 1594395561
}, - "device": {
- "networkInfo": {
- "currentBand": {
- "timestamp": 1594395562
}, - "supportedBands": {
- "timestamp": 1594395562
}, - "areaCode": {
- "timestamp": 1594395562
}, - "mccmnc": {
- "timestamp": 1594395562
}, - "ipAddress": {
- "timestamp": 1594395562
}, - "ueMode": {
- "timestamp": 1594395562
}, - "cellID": {
- "timestamp": 1594395562
}, - "networkMode": {
- "timestamp": 1594395562
}
}, - "simInfo": {
- "uiccMode": {
- "timestamp": 1594395562
}, - "iccid": {
- "timestamp": 1594395562
}, - "imsi": {
- "timestamp": 1594395562
}
}, - "deviceInfo": {
- "modemFirmware": {
- "timestamp": 1594395562
}, - "batteryVoltage": {
- "timestamp": 1594395562
}, - "imei": {
- "timestamp": 1594395562
}, - "board": {
- "timestamp": 1594395562
}, - "appVersion": {
- "timestamp": 1594395562
}, - "appName": {
- "timestamp": 1594395562
}
}, - "serviceInfo": {
- "ui": [
- {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}
], - "fota_v1": [
- {
- "timestamp": 1594395562
}, - {
- "timestamp": 1594395562
}
]
}
}, - "config": {
- "GPS": {
- "enable": {
- "timestamp": 1594295362
}
}
}
}
}, - "version": 8115
}
}List all device tags (groups) for your account.
| pageLimit required | integer <int32> (PageLimit) [ 1 .. 100 ] Default: "10" Maximum number of items you want returned in the response (<=100). |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
required | Array of DeviceTag (string) or JSONataTransformedResponse (any) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- "string"
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}Update the device name. The default name is the same as the device id.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
Friendly device name. Can be used for searching and filtering devices.
"new-device-name"Update a device's tags. Useful for labeling, categorizing, grouping, etc.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
[- "string"
]Update the image associated with a device, as displayed on nrfCloud.com. If uploading an image, add image to the request body (JPEG or PNG only). Otherwise, use the sourceUrl query param to set the device image to an existing image on the Web.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| sourceUrl | string (Url) |
"string"For a Web URL of an image associated with a device, dissociate the URL from the device. For an image file stored for a device, delete the image file.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
Provision a device and attach an IoT policy with permissions that grant access to MQTT topics for any device in your team. This type of device can be useful in apps that need an MQTT client to monitor the messages on other devices, or for debugging and testing purposes. When a new team device (and subsequent certificate) is created, both the public AND private keys are returned. If the private key is lost, the certificate should be rotated to obtain a new public/private key pair.
| caCert required | string The AmazonRootCA1.pem used for establishing TLS communications with AWS IoT. |
| clientCert required | string The x.509 certificate. If this is for an "mqtt team device" this string contains only one certificate. JITP device certificates, which are generated using an intermediate CA cert, contain a bundled certificate consisting of the device certificate and the intermediate CA pem. |
| clientId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i This is the canonical device id used in the device certificate, and as the MQTT client id. |
| privateKey | string The private key associated with the device certificate. |
{- "clientId": "nrf-1234567890123456789000",
- "caCert": "-----BEGIN CERTIFICATE-----\nMIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\nADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\nb24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\nMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\nb3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\nca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\nIFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\nVOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\njgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\nAYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\nA4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\nU5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\nN+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\no/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\nrqXRfboQnoZsG4q5WTP468SQvvG5\n-----END CERTIFICATE-----\n",
- "clientCert": "-----BEGIN CERTIFICATE-----\nMIIB7DCCAZMCFFxFKi7+awbjc0j1fN2eh4rsSOZ/MAoGCCqGSM49BAMCMGgxCzAJ\nBgNVBAYTAk5PMQ8wDQYDVQQIDAZOb3J3YXkxEjAQBgNVBAcMCVRyb25kaGVpbTEd\nMBsGA1UECgwUTm9yZGljIFNlbWljb25kdWN0b3IxFTATBgNVBAsMDFRlc3QgRGV2\naWNlczAgFw0yMTA2MTEyMDU4MzVaGA8yMDUxMDYwNDIwNTgzNVowgYcxCzAJBgNV\nBAYTAk5PMRIwEAYDVQQIDAlUcm9uZGVsYWcxEjAQBgNVBAcMCVRyb25kaGVpbTEh\nMB8GA1UECgwYTm9yZGljIFNlbWljb25kdWN0b3IgQVNBMS0wKwYDVQQDDCRkYjEw\nOWYxMC1iOTZiLTRhNGMtODIxOS0yMTEzOTQyNjE2ZDMwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAAQS2bfNI8mgS9b7d6zC/qnYo3C4/Xck/4sbGsUBsOWDKcgp303h\njgWsEWPmq+sZdvUD5NUvwcODxjchEE+1EjXfMAoGCCqGSM49BAMCA0cAMEQCIDWi\nAH0Oml+9+jEPtnqm6pm6vFmHlHlIovAqBZTed2teAiBGg9S21Wd+gFA1Y38OyURw\nGKc8WsgwULn8tOOuGNdl8w==\n-----END CERTIFICATE-----\n",
- "privateKey": "-----BEGIN EC PARAMETERS-----\nBggqhkjOPQMBBw==\n-----END EC PARAMETERS-----\n-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIFcBJEN+pgMAZZqlHySta85JQUR+Q9joiQRkKM+MhidLoAoGCCqGSM49\nAwEHoUQDQgAEEtm3zSPJoEvW+3eswv6p2KNwuP13JP+LGxrFAbDlgynIKd9N4Y4F\nrBFj5qvrGXb1A+TVL8HDg8Y3IRBPtRI13w==\n-----END EC PRIVATE KEY-----\n"
}Retrieve the team device certificate if it exists.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| caCert required | string The AmazonRootCA1.pem used for establishing TLS communications with AWS IoT. |
| clientCert required | string The x.509 certificate. If this is for an "mqtt team device" this string contains only one certificate. JITP device certificates, which are generated using an intermediate CA cert, contain a bundled certificate consisting of the device certificate and the intermediate CA pem. |
| clientId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i This is the canonical device id used in the device certificate, and as the MQTT client id. |
| privateKey | string The private key associated with the device certificate. |
{- "clientId": "nrf-1234567890123456789000",
- "caCert": "-----BEGIN CERTIFICATE-----\nMIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\nADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\nb24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\nMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\nb3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\nca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\nIFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\nVOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\njgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\nAYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\nA4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\nU5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\nN+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\no/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\nrqXRfboQnoZsG4q5WTP468SQvvG5\n-----END CERTIFICATE-----\n",
- "clientCert": "-----BEGIN CERTIFICATE-----\nMIIB7DCCAZMCFFxFKi7+awbjc0j1fN2eh4rsSOZ/MAoGCCqGSM49BAMCMGgxCzAJ\nBgNVBAYTAk5PMQ8wDQYDVQQIDAZOb3J3YXkxEjAQBgNVBAcMCVRyb25kaGVpbTEd\nMBsGA1UECgwUTm9yZGljIFNlbWljb25kdWN0b3IxFTATBgNVBAsMDFRlc3QgRGV2\naWNlczAgFw0yMTA2MTEyMDU4MzVaGA8yMDUxMDYwNDIwNTgzNVowgYcxCzAJBgNV\nBAYTAk5PMRIwEAYDVQQIDAlUcm9uZGVsYWcxEjAQBgNVBAcMCVRyb25kaGVpbTEh\nMB8GA1UECgwYTm9yZGljIFNlbWljb25kdWN0b3IgQVNBMS0wKwYDVQQDDCRkYjEw\nOWYxMC1iOTZiLTRhNGMtODIxOS0yMTEzOTQyNjE2ZDMwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAAQS2bfNI8mgS9b7d6zC/qnYo3C4/Xck/4sbGsUBsOWDKcgp303h\njgWsEWPmq+sZdvUD5NUvwcODxjchEE+1EjXfMAoGCCqGSM49BAMCA0cAMEQCIDWi\nAH0Oml+9+jEPtnqm6pm6vFmHlHlIovAqBZTed2teAiBGg9S21Wd+gFA1Y38OyURw\nGKc8WsgwULn8tOOuGNdl8w==\n-----END CERTIFICATE-----\n",
- "privateKey": "-----BEGIN EC PARAMETERS-----\nBggqhkjOPQMBBw==\n-----END EC PARAMETERS-----\n-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIFcBJEN+pgMAZZqlHySta85JQUR+Q9joiQRkKM+MhidLoAoGCCqGSM49\nAwEHoUQDQgAEEtm3zSPJoEvW+3eswv6p2KNwuP13JP+LGxrFAbDlgynIKd9N4Y4F\nrBFj5qvrGXb1A+TVL8HDg8Y3IRBPtRI13w==\n-----END EC PRIVATE KEY-----\n"
}Create and attach a new certificate for a team device. Overwrite any previously associated certificate.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| caCert required | string The AmazonRootCA1.pem used for establishing TLS communications with AWS IoT. |
| clientCert required | string The x.509 certificate. If this is for an "mqtt team device" this string contains only one certificate. JITP device certificates, which are generated using an intermediate CA cert, contain a bundled certificate consisting of the device certificate and the intermediate CA pem. |
| clientId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i This is the canonical device id used in the device certificate, and as the MQTT client id. |
| privateKey | string The private key associated with the device certificate. |
{- "clientId": "nrf-1234567890123456789000",
- "caCert": "-----BEGIN CERTIFICATE-----\nMIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\nADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\nb24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\nMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\nb3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\nca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\nIFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\nVOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\njgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\nAYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\nA4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\nU5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\nN+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\no/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\nrqXRfboQnoZsG4q5WTP468SQvvG5\n-----END CERTIFICATE-----\n",
- "clientCert": "-----BEGIN CERTIFICATE-----\nMIIB7DCCAZMCFFxFKi7+awbjc0j1fN2eh4rsSOZ/MAoGCCqGSM49BAMCMGgxCzAJ\nBgNVBAYTAk5PMQ8wDQYDVQQIDAZOb3J3YXkxEjAQBgNVBAcMCVRyb25kaGVpbTEd\nMBsGA1UECgwUTm9yZGljIFNlbWljb25kdWN0b3IxFTATBgNVBAsMDFRlc3QgRGV2\naWNlczAgFw0yMTA2MTEyMDU4MzVaGA8yMDUxMDYwNDIwNTgzNVowgYcxCzAJBgNV\nBAYTAk5PMRIwEAYDVQQIDAlUcm9uZGVsYWcxEjAQBgNVBAcMCVRyb25kaGVpbTEh\nMB8GA1UECgwYTm9yZGljIFNlbWljb25kdWN0b3IgQVNBMS0wKwYDVQQDDCRkYjEw\nOWYxMC1iOTZiLTRhNGMtODIxOS0yMTEzOTQyNjE2ZDMwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAAQS2bfNI8mgS9b7d6zC/qnYo3C4/Xck/4sbGsUBsOWDKcgp303h\njgWsEWPmq+sZdvUD5NUvwcODxjchEE+1EjXfMAoGCCqGSM49BAMCA0cAMEQCIDWi\nAH0Oml+9+jEPtnqm6pm6vFmHlHlIovAqBZTed2teAiBGg9S21Wd+gFA1Y38OyURw\nGKc8WsgwULn8tOOuGNdl8w==\n-----END CERTIFICATE-----\n",
- "privateKey": "-----BEGIN EC PARAMETERS-----\nBggqhkjOPQMBBw==\n-----END EC PARAMETERS-----\n-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIFcBJEN+pgMAZZqlHySta85JQUR+Q9joiQRkKM+MhidLoAoGCCqGSM49\nAwEHoUQDQgAEEtm3zSPJoEvW+3eswv6p2KNwuP13JP+LGxrFAbDlgynIKd9N4Y4F\nrBFj5qvrGXb1A+TVL8HDg8Y3IRBPtRI13w==\n-----END EC PRIVATE KEY-----\n"
}Delete a team device and its associated certificate.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
Endpoints for device that have an IP address and can send messages directly to the platform.
Add a device to your nRF Cloud account. The association process is idempotent. You may therefore use this endpoint to update your device's subType. For more on the use of subType see the OnboardDevices endpoint.
curl -X PUT $API_HOST/v1/association/$DEVICE_ID -d "$DEVICE_OWNERSHIP_CODE" -H "Authorization: Bearer $API_KEY" -H "Content-Type: text/plain"
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| subType | string (ThingType) /[a-zA-Z0-9_.,@\/:#-]{0,799}/ A custom string value to specify the type of thing (device) being provisioned on nRF Cloud. |
"string"Onboard and associate one or more devices with your nRF Cloud account by posting CSV data.
This endpoint supports two onboarding modalities depending upon whether you include device certificates or public keys in your CSV Payload.
Uploading a device certificate allows the device to use nRF Cloud services using any supported connectivity protocol, such as MQTT, and CoAP. This is the recommended method for onboarding devices.
Unlike the CreateDeviceCertificate endpoint, this endpoint involves your own CA certificate and
requires you to upload device certificates that you have already obtained, whether via a CSR produced by the AT%KEYGEN command
(modem firmware v1.3+), or offline via your own script. We impose no rules on your CA certificate, and a self-signed certificate may be used.
For more information see Onboarding in the nRF Cloud documentation.
Whether using our APIs via CoAP or MQTT you will need to flash to your device:
Additionally, if the device will be using MQTT, you will also need to flash the device certificate. For signing JWTs you will use the private key associated with the certificate. (During the device onboarding process we extract the corresponding public key from your uploaded certificate and use this for JWT signature verification.)
The second onboarding modality involves uploading a public key to verify the signatures of JSON Web Tokens (JWTs) sent by the device. Uploading a public key allows the device to use JSON Web Tokens (JWTs) signed by the private key of an asymmetric key pair, i.e., a private key that is different than the one used to sign the device's CSR (this key pair can be generated via the AT%KEYGEN command). If you are using JWTs signed by the device CSR key, and you have also uploaded the device's certificate via this or the OnboardDevices endpoint, there is no need to upload the public key, because it is automatically extracted from the certificate. This is useful for devices that only want to consume nRF Cloud services over REST.
Please note: Public keys must be ES256. For more information, see the nRF Cloud REST Authentication documentation.
This endpoint supports asynchronous bulk operations. Your data will be validated, and if valid, you
will receive an HTTP 202 response with a bulkOpsRequestId. You can use this id with the bulk ops endpoints
to track the request's processing status. If the bulk ops request indicates FAILED status, check the JSON errors file (URL in the bulk
ops request details), fix the offending rows, then re-submit the CSV with only those rows.
Each CSV row must in the format deviceId,[subType],[tags],[supportedFirmwareTypes],"certificate",[onboardingToken], where:
| Field | Required? | Description | Validation Pattern |
|---|---|---|---|
deviceId |
Yes | A globally unique device id (UUIDs are highly recommended) | /^[a-z0-9:_-]{1,128}$/i |
subType |
No | A custom device type (for example humidity-sensor) to help you better recognize or categorize your devices. |
|
tags |
No | A list of pipe-delimited tags to create groups of devices (e.g., warehouse|sensor|east) |
Each tag:/^[a-zA-Z0-9_.@:#-]+$/ |
supportedFirmwareTypes |
No | A list of pipe-delimited firmware types that each device supports for FOTA (e.g., APP|MODEM) |
Each type:/^(APP|MODEM|BOOT|SOFTDEVICE|BOOTLOADER|MDM_FULL)$/ |
certificate |
Conditional | Dependending on the onboarding modality, either a unique ES256 X.509 certificate OR public key in PEM format, wrapped in double quotes (to allow for line breaks in CSV). Required if onboardingToken is not provided. |
/^-{5}BEGIN CERTIFICATE-{5}(\r\n|\r|\n)([^-]+)(\r\n|\r|\n)-{5}END CERTIFICATE-{5}(\r\n|\r|\n)$/ OR /^-{5}BEGIN PUBLIC KEY-{5}(\r\n|\r|\n)([^-]+)(\r\n|\r|\n)-{5}END PUBLIC KEY-{5}(\r\n|\r|\n)$/ |
onboardingToken |
Conditional | An onboarding token for token-based device onboarding. If specified, the device will be onboarded using this token instead of a certificate. Cannot be used together with certificate for the same device. Required if certificate is not provided. |
Note: Each device must be onboarded with either a certificate OR an onboarding token, but not both. Within the same CSV file, you can have some devices onboarded with certificates and others with onboarding tokens.
Columns may appear in any order when a header row is present. If the header row is missing, the default column order is applied strictly: deviceId,subType,tags,supportedFirmwareTypes,certificate. To use the onboardingToken field, you must include a header row.
Examples of CSV rows:
deviceId,subType,tags,supportedFirmwareTypes,certificate,onboardingToken
f69c0e45-7f04-4949-8def-bb2215b4223e,my-thing-type,tag1|tag2,APP|MODEM,"-----BEGIN CERTIFICATE-----
MIIB7DCCAZMCFD...Av3CVgjzn5BLS03X7lyf4w==
-----END CERTIFICATE-----
",
deviceId,subType,tags,supportedFirmwareTypes,certificate,onboardingToken
a1b2c3d4-5e6f-7890-abcd-ef1234567890,my-thing-type,tag1|tag2,APP|MODEM,,eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
subType not setdeviceId,tags,supportedFirmwareTypes,certificate
f69c0e45-7f04-4949-8def-bb2215b4223e,tag1|tag2,APP|MODEM,"-----BEGIN CERTIFICATE-----
MIIB7DCCAZMCFD...Av3CVgjzn5BLS03X7lyf4w==
-----END CERTIFICATE-----
"
subType and tags not set, but supported supportedFirmwareTypes are setdeviceId,supportedFirmwareTypes,certificate
f69c0e45-7f04-4949-8def-bb2215b4223e,APP|MODEM,"-----BEGIN CERTIFICATE-----
MIIB7DCCAZMCFD...Av3CVgjzn5BLS03X7lyf4w==
-----END CERTIFICATE-----
"
onboardingToken field is not available when using the headerless format.Also note:
Example of uploading CSV data as a binary file:
curl -X POST $API_HOST/v1/devices \
--data-binary @$PATH_TO_CSV_FILE \
-H "Content-Type: application/octet-stream" \
-H "Authorization: Bearer $API_KEY"
Note that for some unknown reason, curl will strip the final line break in each ES256 cert when sending the CSV file using a non-binary content-type, e.g., using syntax such as -d @$PATH_TO_CSV_FILE -H "Content-Type: text/csv". Therefore, with curl use --data-binary only. If you want to send the CSV as text, use a REST client like Postman or Insomnia.
To synchronously provision a single device, you can also use the OnboardDevice endpoint.
| content-type required | string (RestApiPayloadContentTypeWithCsv) Enum: "text/plain;charset=UTF8" "text/plain;charset=ASCII" "text/plain" "application/octet-stream" "text/csv" |
| bulkOpsRequestId required | string (ULID) ^[0-9A-HJKMNP-TV-Z]{26}$ Universally Unique Lexicographically Sortable Identifier (using Crockford's alphabet). |
"string"{- "bulkOpsRequestId": "01EZZJVDQJPWT7V4FWNVDHNMM5"
}Onboard and associate a single device with your nRF Cloud account.
This endpoint supports two onboarding modalities depending upon whether you include device certificates or a provisioning token in your payload.
Uploading a device certificate allows the device to use nRF Cloud services using any supported connectivity protocol, such as HTTP/REST, MQTT, and CoAP. This is the recommended method for onboarding devices.
Unlike the CreateDeviceCertificate endpoint, this endpoint involves your own CA certificate and
requires you to upload device certificates that you have already obtained, whether via a CSR produced by the AT%KEYGEN command
(modem firmware v1.3+), or offline via your own script. We impose no rules on your CA certificate, and a self-signed certificate may be used.
For more information see Onboarding in the nRF Cloud documentation.
For device type nrf93m, you should provide a provisioning token instead of a certificate.
Whether using our APIs via REST or MQTT you will need to flash to your device:
Additionally, if the device will be using MQTT, you will also need to flash the device certificate. For signing JWTs you will use the private key associated with the certificate. (During the device onboarding process we extract the corresponding public key from your uploaded certificate and use this for JWT signature verification.)
For bulk onboarding of devices, please use the OnboardDevices endpoint.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| certificate required | string X509 Certificate in PEM format. |
| subType | string (ThingType) /[a-zA-Z0-9_.,@\/:#-]{0,799}/ A custom string value to specify the type of thing (device) being provisioned on nRF Cloud. |
| supportedFirmwareTypes | Array of strings (FirmwareTypes) Items Enum: "APP" "MODEM" "BOOT" "SOFTDEVICE" "BOOTLOADER" "MDM_FULL" "SMP" "CUSTOM" |
| tags | Array of strings (DeviceTag) |
{- "certificate": "string",
- "subType": "string",
- "tags": [
- "string"
], - "supportedFirmwareTypes": [
- "APP"
]
}Register one or more public keys so that the signatures for JSON Web Tokens (JWTs) sent by the device can be verified.
This endpoint supports the following use case:
Only one public key may be registered for each device. Uploading CSV data with a different key for the same device will overwrite the existing key.
Public keys must be ES256. For more information, see the nRF Cloud REST Authentication documentation.
This endpoint supports asynchronous bulk operations. Your data will be validated, and if valid, you
will receive an HTTP 202 response with a bulkOpsRequestId. You can use this id with the bulk ops endpoints
to track the request's processing status. If the bulk ops request indicates FAILED status, check the JSON errors file (URL in the bulk
ops request details), fix the offending rows, then re-submit the CSV with only those rows.
Each CSV row must in the format deviceId,"keyPem", where:
| Field | Required | Description | Validation Pattern |
|---|---|---|---|
deviceId |
Yes | A globally unique device id (UUIDs are highly recommended) | /^[a-z0-9:_-]{1,128}$/i |
keyPem |
Yes | A unique ES256 public key in PEM format, wrapped in double quotes (to allow for line breaks in CSV) | /^-{5}BEGIN PUBLIC KEY-{5}(\r\n|\r|\n)([^-]+)(\r\n|\r|\n)-{5}END PUBLIC KEY-{5}(\r\n|\r|\n)$/ |
Example of a CSV row:
f69c0e45-7f04-4949-8def-bb2215b4223e,"-----BEGIN PUBLIC KEY-----
MIIB7DCCAZMCFD...Av3CVgjzn5BLS03X7lyf4w==
-----END PUBLIC KEY-----
"
Also note:
Example of uploading CSV data as a binary file:
curl -X POST $API_HOST/v1/devices/public-keys \
--data-binary @$PATH_TO_CSV_FILE \
-H "Content-Type: application/octet-stream" \
-H "Authorization: Bearer $API_KEY"
Note that for some unknown reason, curl will strip the final line break in each ES256 public key when sending the CSV file using a non-binary content-type, e.g., using syntax such as -d @$PATH_TO_CSV_FILE -H "Content-Type: text/csv". Therefore, with curl use --data-binary only. If you want to send the CSV as text, use a REST client like Postman or Insomnia.
| content-type required | string (RestApiPayloadContentTypeWithCsv) Enum: "text/plain;charset=UTF8" "text/plain;charset=ASCII" "text/plain" "application/octet-stream" "text/csv" |
| bulkOpsRequestId required | string (ULID) ^[0-9A-HJKMNP-TV-Z]{26}$ Universally Unique Lexicographically Sortable Identifier (using Crockford's alphabet). |
"string"{- "bulkOpsRequestId": "01EZZJVDQJPWT7V4FWNVDHNMM5"
}Register one or more device certificates. If a device has already been added to your team (onboarded) this will delete its existing cert and replace it with the new one. It is recommended to update existing devices with their new certificates before registering them here. If it is not onboarded, please use the OnboardDevice endpoint to complete the process which allows your device(s) to use nRF Cloud.
This endpoint supports asynchronous bulk operations. Your data will be validated, and if valid, you
will receive an HTTP 202 response with a bulkOpsRequestId. You can use this id with the bulk ops endpoints
to track the request's processing status. If the bulk ops request indicates FAILED status, check the JSON errors file (URL in the bulk
ops request details), fix the offending rows, then re-submit the CSV with only those rows.
Each CSV row must in the format deviceId,"certPem", where:
| Field | Required | Description | Validation Pattern |
|---|---|---|---|
deviceId |
Yes | A globally unique device id (UUIDs are highly recommended) | /^[a-z0-9:_-]{1,128}$/i |
certPem |
Yes | A unique ES256 X.509 certificate in PEM format, wrapped in double quotes (to allow for line breaks in CSV) | /^-{5}BEGIN CERTIFICATE-{5}(\r\n|\r|\n)([^-]+)(\r\n|\r|\n)-{5}END CERTIFICATE-{5}(\r\n|\r|\n)$/ |
Example of a CSV row:
f69c0e45-7f04-4949-8def-bb2215b4223e,"-----BEGIN CERTIFICATE-----
MIIB7DCCAZMCFD...Av3CVgjzn5BLS03X7lyf4w==
-----END CERTIFICATE-----
"
Also note:
Example of uploading CSV data as a binary file:
curl -X POST $API_HOST/v1/devices/certificates \
--data-binary @$PATH_TO_CSV_FILE \
-H "Content-Type: application/octet-stream" \
-H "Authorization: Bearer $API_KEY"
Note that for some unknown reason, curl will strip the final line break in each ES256 public key when sending the CSV file using a non-binary content-type, e.g., using syntax such as -d @$PATH_TO_CSV_FILE -H "Content-Type: text/csv". Therefore, with curl use --data-binary only. If you want to send the CSV as text, use a REST client like Postman or Insomnia.
| content-type required | string (RestApiPayloadContentTypeWithCsv) Enum: "text/plain;charset=UTF8" "text/plain;charset=ASCII" "text/plain" "application/octet-stream" "text/csv" |
| bulkOpsRequestId required | string (ULID) ^[0-9A-HJKMNP-TV-Z]{26}$ Universally Unique Lexicographically Sortable Identifier (using Crockford's alphabet). |
"string"{- "bulkOpsRequestId": "01EZZJVDQJPWT7V4FWNVDHNMM5"
}Modify the device's state as stored in its shadow. You do not have to pass the entire shadow. You can update a specific portion by setting the correct JSON field path:
export DEVICE_VERSION=$(curl $API_HOST/v1/devices/$DEVICE_ID -H "Authorization: Bearer $API_KEY" | jq -r '.["$meta"].version')
curl -X PATCH $API_HOST/v1/devices/$DEVICE_ID/state -d '{ "reported": { "device": { "serviceInfo": { "fota_v1": ["BOOT"] } } } }' -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -H "If-Match: $DEVICE_VERSION"
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| desired | object |
| reported | object |
{- "reported": {
- "device": {
- "serviceInfo": {
- "fota_v1": [
- "APP",
- "MODEM"
]
}
}
}, - "desired": {
- "someField1": {
- "someField2": "someValue2"
}
}
}Allows a user or IP device to
send a message that is subsequently published over an MQTT topic, on behalf of the
IP device whose deviceId is specified. The device ID for the message comes from the topic. For instance,
if the topic property on the request is m/d/nrf-352656101081837/d2c/custom, the device ID determined
for the message will be 'nrf-352656101081837'.
For dictionary based binary logs via the d2c/bin topic, the message must be base64 encoded.
For instance, for the device nrf-352656101081837 the request body would be:
{
"topic": "d/nrf-352656101081837/d2c/bin",
"message": "blJGQwAAAAAd2qCkkAEAAAEAAABoZWxsbyB3b3JsZA=="
}
For more information, see Sending device messages.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
required | Message (object) or Array of Message (objects) or Base64EncodedBinaryData (string) |
| topic | string (MqttTopic) A string specifying an MQTT topic. |
{- "topic": "d/7e8f29fa-cb04-4351-a7c4-3917649d2d36/d2c/bulk",
- "message": [
- {
- "temp": 59,
- "units": "F",
- "ts": 1631470795000
}, - {
- "temp": 54,
- "units": "F",
- "ts": 1631557195000
}
]
}Fetch historical device messages.
Currently supported parameter combinations:
appId + deviceId
topic + deviceId
appId
deviceId
topic
Not supported:
appId + topic
appId + topic + deviceId
For more information, see our nRF Cloud documentation on device messages.
| appId | string (MessageAppId) <= 64 characters Example: appId=TEMP Filter returned messages by appId. Primarily used by Asset Tracker, AppId is taken from the "appId" property of the message body and is intended to represent the type of data being sent. This can be used to categorize your messages for easy filtering when using the same topic. |
| deviceId | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: deviceId=nrf-1234567890123456789000 A device Id to fetch messages for. Can be specified with appId or topic. |
| end | string <date-time> (ISODateTimeString) Example: end=2020-06-25T21:05:12.830Z HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| exclusiveEnd | string <date-time> (ISODateTimeString) Deprecated Example: exclusiveEnd=2020-06-25T21:05:12.830Z HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| inclusiveStart | string <date-time> (ISODateTimeString) Deprecated Example: inclusiveStart=2020-06-25T21:05:12.830Z HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| pageLimit | integer <int32> (PageLimit) [ 1 .. 100 ] Default: "10" Maximum number of items you want returned in the response (<=100). |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
| pageSort | string (PageSort) Default: "desc" Enum: "asc" "desc" Example: pageSort=desc Sorting order for the paginated results => desc (descending; default) or asc (ascending). |
| start | string <date-time> (ISODateTimeString) Example: start=2020-06-25T21:05:12.830Z HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| topic | string (MqttTopic) Example: topic=d/7e8f29fa-cb04-4351-a7c4-3917649d2d36/d2c/bulk Fetch messages for a single topic. Can be specified with deviceId. |
required | Array of objects (DeviceMessage) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- {
- "tenantId": "a5592ec1-18ae-4d9d-bc44-1d9bd927bbe9",
- "topic": "d/7e8f29fa-cb04-4351-a7c4-3917649d2d36/d2c/bulk",
- "deviceId": "nrf-1234567890123456789000",
- "receivedAt": "2020-06-25T21:05:12.830Z",
- "message": { }
}
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}Fetch device alerts. For more information, see our nRF Cloud documentation on device alerts.
| deviceIds | Array of strings (DeviceId) [ items/^[a-z0-9:_-]{1,128}$/i ] Example: deviceIds=nrf-1234567890123456789000 Fetch alerts optionally by device ids. |
| pageLimit | integer <int32> (PageLimit) [ 1 .. 100 ] Default: "10" Maximum number of items you want returned in the response (<=100). |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
| pageSort | string (PageSort) Default: "desc" Enum: "asc" "desc" Example: pageSort=desc Sorting order for the paginated results => desc (descending; default) or asc (ascending). |
| status | string (AlertStatus) Enum: "ACTIVE" "ARCHIVED" Fetch alerts optionally by Status. By default, both |
required | Array of objects (DeviceAlert) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- {
- "id": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "deviceId": "nrf-1234567890123456789000",
- "createdAt": "2020-06-25T21:05:12.830Z",
- "receivedAt": "2020-06-25T21:05:12.830Z",
- "statusChangedAt": "2020-06-25T21:05:12.830Z",
- "statusChangedBy": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "status": "ACTIVE",
- "originalMessage": { }
}
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}Archives an Alert. For more information, see our nRF Cloud documentation on device alerts.
| id required | string (UUID) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Example: bc631093-7f7c-4c1b-aa63-a68c759bcd5c The unique identifier for the alert |
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i This is the canonical device id used in the device certificate, and as the MQTT client id. |
| id required | string (UUID) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
required | object The original message sent from the device that triggered the alert. |
| receivedAt required | string <date-time> (ISODateTimeString) HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| status required | string Enum: "ARCHIVED" "ACTIVE" ACTIVE: The alert is active and has not been resolved. ARCHIVED: The alert has been resolved and is no longer active. |
| statusChangedAt required | string <date-time> HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| statusChangedBy required | string^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
| createdAt | string <date-time> (ISODateTimeString) HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
{- "id": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "deviceId": "nrf-1234567890123456789000",
- "createdAt": "2020-06-25T21:05:12.830Z",
- "receivedAt": "2020-06-25T21:05:12.830Z",
- "statusChangedAt": "2020-06-25T21:05:12.830Z",
- "statusChangedBy": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "status": "ARCHIVED",
- "originalMessage": { }
}Restore an archived Alert. For more information, see our nRF Cloud documentation on device alerts.
| id required | string (UUID) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Example: bc631093-7f7c-4c1b-aa63-a68c759bcd5c The unique identifier for the alert |
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i This is the canonical device id used in the device certificate, and as the MQTT client id. |
| id required | string (UUID) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
required | object The original message sent from the device that triggered the alert. |
| receivedAt required | string <date-time> (ISODateTimeString) HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| status required | string Enum: "ACTIVE" "ARCHIVED" ACTIVE: The alert is active and has not been resolved. ARCHIVED: The alert has been resolved and is no longer active. |
| createdAt | string <date-time> (ISODateTimeString) HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| statusChangedAt | string <date-time> (ISODateTimeString) HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| statusChangedBy | string (UUID) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
{- "id": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "deviceId": "nrf-1234567890123456789000",
- "createdAt": "2020-06-25T21:05:12.830Z",
- "receivedAt": "2020-06-25T21:05:12.830Z",
- "statusChangedAt": "2020-06-25T21:05:12.830Z",
- "statusChangedBy": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "status": "ACTIVE",
- "originalMessage": { }
}Fetches the URL to a zip file containing one or more binary log files for the requested device and time range. The returned URL can be used to download the zip file.
For more information, see the nRF Cloud documentation on binary logs.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: deviceId=nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| end | string <date-time> (ISODateTimeString) Example: end=2020-06-25T21:05:12.830Z By default, the end time for the range is the current time. The range between start and end cannot be greater than 24 hours. |
| start | string <date-time> (ISODateTimeString) Example: start=2020-06-25T21:05:12.830Z By default, the start time for the range is 24 hours before the current time. The range between start and end cannot be greater than 24 hours. |
| contentLength required | number <double> Content length of the file in bytes. |
| url required | string <url> The URL to download the file from. |
{- "contentLength": 128
}Endpoints for working with the Firmware Over-the-Air (FOTA) Updates service.
For more information see the FOTA Service documentation.
Endpoints for managing your firmware bundles.
For more information see the FOTA Service documentation.
Upload a firmware bundle as a .zip file, whether binary or base64-encoded. The bundle must contain a manifest.json file that conforms to this JSON schema:
{
name?: string,
description?: string,
fwversion: string,
'format-version': 1,
files: {
file: string,
type: 'application' | 'mcuboot' | 'bootloader' | 'softdevice' | 'init_packet',
size: number
}[]
}
Notes:
? fields are optionalfiles is an array of objects, all of which should be of the same type.file must have a .bin extension. Host-side tools like nRF Connect for Desktop Programmer can be used to convert .hex files to .bin.type values application and mcuboot apply only to nRF91 FOTA. Values softdevice and init_packet apply only to Bluetooth LE FOTA..zip file must contain both the init_packet and the firmware image (application or soft device). The type field for the manifest must be application or softdevice, not init_packet.'format-version' should always be set to 1fwversion is validated against this regular expression: /^[a-zA-Z0-9._-]{1,60}$/fwversion field, so you will need to add that field.name, description, and fwversion fields. The UI will then properly generate the manifest.json file and zip file.An example of a valid manifest:
{
"name": "My application update",
"description": "Changelog: Fixed an issue with sleep mode. Power consumption improvements.",
"fwversion": "1.1",
"format-version": 1,
"files": [
{
"file": "my_application_v1_1.hex.bin",
"type": "application",
"size": 695672
}
]
}
Following are examples of uploading with curl (base64 and binary):
Using base64 encoded content:
export FILE=$(base64 path/to/my-file.zip)
# If you get a console error such as "Argument list too long" try using a REST client like Postman.
# UTF-8
curl -X POST $API_HOST/v1/firmwares \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: text/plain;charset=UTF8" \
-d $FILE
# ASCII
curl -X POST $API_HOST/v1/firmwares \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: text/plain;charset=ASCII" \
-d $FILE
# Plain Text
curl -X POST $API_HOST/v1/firmwares \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: text/plain" \
-d $FILE
Using binary content:
# Octet-stream
curl -X POST $API_HOST/v1/firmwares \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/octet-stream" \
--data-binary @/path/to/my-file.zip
# ZIP
curl -X POST $API_HOST/v1/firmwares \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/zip" \
--data-binary @/path/to/my-file.zip
For more information, see the FOTA documentation.
| content-type required | string (RestApiPayloadContentTypeWithZip) Enum: "text/plain;charset=UTF8" "text/plain;charset=ASCII" "text/plain" "application/octet-stream" "application/zip" |
| uris required | Array of strings |
"string"{- "uris": [
- "string"
]
}| modemOnly | boolean Default: false Whether or not to return a list of modem firmware instead of the current tenant's firmware |
| pageLimit | integer <int32> (PageLimit) [ 1 .. 100 ] Default: "10" Maximum number of items you want returned in the response (<=100). |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
required | Array of objects (Firmware) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- {
- "name": "string",
- "description": "string",
- "version": "string",
- "type": "APP",
- "bundleId": "string",
- "filenames": [
- "string"
], - "size": 0.1,
- "lastModified": "2019-08-24T14:15:22Z"
}
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}Endpoints for creating and interacting with FOTA Jobs.
For more information see the FOTA Service documentation.
required | BundleId (string) or UUID (string) A unique id created by the server when the firmware was uploaded (concatenation of firmware type, random string, and firmware version). |
| tags required | Array of strings (DeviceTag) [ 1 .. 100 ] items A list of tags to apply the device to |
| autoApply | boolean Default: "true" If set to false the job will not be applied immediately, but instead will be left in the "CREATED" status. The job can later be applied using POST /fota-jobs/{jobId}/apply |
| description | string <= 1024 characters Short description for this job |
| name | string <= 64 characters Friendly name for this job |
| jobId required | string (UUID) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
{- "bundleId": "string",
- "autoApply": true,
- "name": "string",
- "description": "string",
- "tags": [
- "string"
]
}{- "jobId": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c"
}| pageLimit | integer <int32> (PageLimit) [ 1 .. 100 ] Default: "10" Maximum number of items you want returned in the response (<=100). |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
required | Array of FOTAV2Job (object) or FotaJobV2Plus (object) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- {
- "jobId": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "target": {
- "deviceIds": [
- "nrf-1234567890123456789000"
], - "tags": [
- "string"
]
}, - "description": "string",
- "status": "CREATED",
- "statusDetail": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "lastUpdatedAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "executionStats": {
- "completedExecutions": 0.1,
- "executions": 0.1,
- "devices": 0.1,
- "timedOut": 0.1,
- "removed": 0.1,
- "downloading": 0.1,
- "inProgress": 0.1,
- "queued": 0.1,
- "rejected": 0.1,
- "failed": 0.1,
- "succeeded": 0.1,
- "cancelled": 0.1
}, - "firmware": {
- "bundleId": "string",
- "host": "string",
- "fileSize": 0.1,
- "firmwareType": "APP",
- "version": "string",
- "uris": [
- "string"
]
}
}
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}| jobId required | string (JobId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Example: bc631093-7f7c-4c1b-aa63-a68c759bcd5c Universally unique identifier |
required | object |
required | object |
| jobId required | string (JobId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
| status required | string (FotaV2JobEvents) Enum: "CREATED" "IN_PROGRESS" "CANCELLED" "DELETION_IN_PROGRESS" "COMPLETED" |
required | object (FotaV2JobTargetModel) |
| completedAt | string <date-time> |
| createdAt | string <date-time> |
| description | string |
| lastUpdatedAt | string <date-time> |
| name | string |
| statusDetail | string |
{- "jobId": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "target": {
- "deviceIds": [
- "nrf-1234567890123456789000"
], - "tags": [
- "string"
]
}, - "description": "string",
- "status": "CREATED",
- "statusDetail": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "lastUpdatedAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "executionStats": {
- "completedExecutions": 0.1,
- "executions": 0.1,
- "devices": 0.1,
- "timedOut": 0.1,
- "removed": 0.1,
- "downloading": 0.1,
- "inProgress": 0.1,
- "queued": 0.1,
- "rejected": 0.1,
- "failed": 0.1,
- "succeeded": 0.1,
- "cancelled": 0.1
}, - "firmware": {
- "bundleId": "string",
- "host": "string",
- "fileSize": 0.1,
- "firmwareType": "APP",
- "version": "string",
- "uris": [
- "string"
]
}
}Endpoints for interacting with individual FOTA Job Executions.
For more information see the FOTA Service documentation.
| jobId required | string (JobId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Example: bc631093-7f7c-4c1b-aa63-a68c759bcd5c Universally unique identifier |
| pageLimit | integer <int32> (PageLimit) [ 1 .. 100 ] Default: "10" Maximum number of items you want returned in the response (<=100). |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
| status | string (FotaV2JobExecutionEvents) Enum: "QUEUED" "IN_PROGRESS" "FAILED" "SUCCEEDED" "TIMED_OUT" "CANCELLED" "REJECTED" "DOWNLOADING" |
required | Array of objects (FOTAJobExecutionState) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- {
- "deviceId": "nrf-1234567890123456789000",
- "status": "string",
- "statusDetail": "string",
- "lastUpdatedAt": "2019-08-24T14:15:22Z"
}
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| pageLimit | integer <int32> (PageLimit) [ 1 .. 100 ] Default: "10" Maximum number of items you want returned in the response (<=100). |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
required | Array of objects (FOTAJobExecution) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- {
- "status": "SUCCEEDED",
- "deviceId": "nrfsim-453330795897806100000",
- "createdAt": "2020-12-09T18:34:13.472Z",
- "executionId": "4d50a3ba-9573-4ec9-b362-02e2bde5aaee",
- "jobDocument": {
- "path": "3701edba-5bd5-4fcf-a0d1-769457a8f409/APP*c52c99d3*v1.3.0-280-g485445b6a869/AT_fast_blink.bin",
- "host": "firmware.nrfcloud.com",
- "firmwareType": "APP",
- "fileSize": 253640,
- "version": "v1.3.0-280-g485445b6a869"
}, - "jobId": "f539350f-7784-470c-b0cf-c669147b0c54",
- "lastUpdatedAt": "2020-12-09T18:34:18.731Z",
- "tenantId": "3701edba-5bd5-4fcf-a0d1-769457a8f409",
- "statusDetail": "Job Completed"
}
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}Fetches the pending (QUEUED or IN_PROGRESS) job execution with the earliest createdAt date. This will allow consistent FIFO (First In First Out) processing of incoming executions.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| firmwareType | string (FirmwareTypes) Enum: "APP" "MODEM" "BOOT" "SOFTDEVICE" "BOOTLOADER" "MDM_FULL" "SMP" "CUSTOM" Return only executions with the given firmware type |
| createdAt required | string <date-time> |
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i This is the canonical device id used in the device certificate, and as the MQTT client id. |
| executionId required | string (UUID) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
required | object (FotaV2JobDocumentModel) |
| jobId required | string (JobId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
| lastUpdatedAt required | string <date-time> |
| status required | string (FotaV2JobExecutionEvents) Enum: "QUEUED" "IN_PROGRESS" "FAILED" "SUCCEEDED" "TIMED_OUT" "CANCELLED" "REJECTED" "DOWNLOADING" |
| tenantId required | string (TenantId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... The UUID of the team owning the device(s) |
| statusDetail | string |
{- "status": "SUCCEEDED",
- "deviceId": "nrfsim-453330795897806100000",
- "createdAt": "2020-12-09T18:34:13.472Z",
- "executionId": "4d50a3ba-9573-4ec9-b362-02e2bde5aaee",
- "jobDocument": {
- "path": "3701edba-5bd5-4fcf-a0d1-769457a8f409/APP*c52c99d3*v1.3.0-280-g485445b6a869/AT_fast_blink.bin",
- "host": "firmware.nrfcloud.com",
- "firmwareType": "APP",
- "fileSize": 253640,
- "version": "v1.3.0-280-g485445b6a869"
}, - "jobId": "f539350f-7784-470c-b0cf-c669147b0c54",
- "lastUpdatedAt": "2020-12-09T18:34:18.731Z",
- "tenantId": "3701edba-5bd5-4fcf-a0d1-769457a8f409",
- "statusDetail": "Job Completed"
}| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| jobId required | string (JobId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Example: bc631093-7f7c-4c1b-aa63-a68c759bcd5c Universally unique identifier |
| createdAt required | string <date-time> |
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i This is the canonical device id used in the device certificate, and as the MQTT client id. |
| executionId required | string (UUID) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
required | object (FotaV2JobDocumentModel) |
| jobId required | string (JobId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Universally unique identifier |
| lastUpdatedAt required | string <date-time> |
| status required | string (FotaV2JobExecutionEvents) Enum: "QUEUED" "IN_PROGRESS" "FAILED" "SUCCEEDED" "TIMED_OUT" "CANCELLED" "REJECTED" "DOWNLOADING" |
| tenantId required | string (TenantId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... The UUID of the team owning the device(s) |
| statusDetail | string |
{- "status": "SUCCEEDED",
- "deviceId": "nrfsim-453330795897806100000",
- "createdAt": "2020-12-09T18:34:13.472Z",
- "executionId": "4d50a3ba-9573-4ec9-b362-02e2bde5aaee",
- "jobDocument": {
- "path": "3701edba-5bd5-4fcf-a0d1-769457a8f409/APP*c52c99d3*v1.3.0-280-g485445b6a869/AT_fast_blink.bin",
- "host": "firmware.nrfcloud.com",
- "firmwareType": "APP",
- "fileSize": 253640,
- "version": "v1.3.0-280-g485445b6a869"
}, - "jobId": "f539350f-7784-470c-b0cf-c669147b0c54",
- "lastUpdatedAt": "2020-12-09T18:34:18.731Z",
- "tenantId": "3701edba-5bd5-4fcf-a0d1-769457a8f409",
- "statusDetail": "Job Completed"
}| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| jobId required | string (JobId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Example: bc631093-7f7c-4c1b-aa63-a68c759bcd5c Universally unique identifier |
| status required | string (FotaV2JobExecutionEvents) Enum: "QUEUED" "IN_PROGRESS" "FAILED" "SUCCEEDED" "TIMED_OUT" "CANCELLED" "REJECTED" "DOWNLOADING" |
| details | string |
{- "details": "string",
- "status": "QUEUED"
}Endpoints for retrieving assistance data, enabling a faster time-to-first-fix (TTFF) for the GPS modem.
For more information see the Location Services documentation.
Provides assistance data to the device. Enables a faster time-to-first-fix (TTFF) for the GPS modem. Returns the modem
parameters for the nRF91 GPS modem in a chunk. The chunk size is determined by the request Range header. See GetFileSize endpoint for details.
Basic Request:
curl -G $API_HOST/v1/location/agps -H "Authorization: Bearer $JWT" -H "Content-Type: application/octet-stream" -H "Range: bytes=0-2200" --output agps.bin
Custom Request:
curl -G "$API_HOST/v1/location/agps" -d "types=8" -d "mcc=244" -d "mnc=91" -d "tac=4099" -d "eci=36078631" -H "Authorization: Bearer $JWT" -H "Content-Type: application/octet-stream" -H "Range: bytes=0-2200" --output agps.bin
Type definitions:
| customTypes | Array of numbers (NrfGpsMessageType) Deprecated Items Enum: 1 2 3 4 5 6 7 8 9 Deprecated in favor of the 'types' param. |
| eci | integer <int32> (Eci) Example: eci=167899669 E-UTRA Cell Identifier (ECI), 28 bits (20 bits eNodeB and 8 bits Cell ID). Calculated using "(eNodeB-ID * 256) + Sector-ID". Range 0 .. 268435455. See ETSI TS 123 003, section 19.6 for more details. |
| filtered | boolean (FilteredEphemerisFlag) Example: filtered=true Send this flag if you want to receive ephemeris for only satellites in view. nRF Cloud will return ephemeris for up to 16 satellites. Cell data (eci, mcc, mnc, tac) is required. Defaults to false. |
| mask | number <double> (SatelliteMaskAngle) Example: mask=5 Filtered ephemeris mask angle. Only works in conjunction with the filtered flag. Controls the mask angle for which the satellites are filtered. Range 0..90 Defaults to 5 |
| mcc | |
number or string (Mnc) Example: mnc=120 Mobile Network Code. A number or string: 120 | 1 | "001" | "01" | "000". As defined in ITU-T E.212. | |
| requestType | string (RequestType) Deprecated Enum: "rtLocation" "rtAssistance" "custom" Type of data to be returned. Deprecated because the requestType is inferred from the request data. |
| rsrp | number <double> (Rsrp) Example: rsrp=-90 Reference Signal Received Power. Measured in dBm. See this page for more details. Range -157..-44 |
| tac | integer <int32> (Tac) Example: tac=13601 Tracking Area Code (TAC). Identifies a group of LTE cells in a certain region (Tracking Area). See ETSI TS 123 003, section 19.4.2.3 for more details. |
| types | Array of numbers (NrfGpsMessageType) Items Enum: 1 2 3 4 5 6 7 8 9 Type of assistance data (see description above). Defaults to [1, 2, 3, 4, 6, 7, 9] |
| range | string |
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
Chunk of the file according to the request Range header.
"<Buffer>"This endpoint is for advanced use cases where you need to set the Range header to something other than the payload size.
Normally you will just set the Range header to the payload limit for your modem gets the payload size of the modem
parameters. This endpoint returns the totalBytes in the Content-Length response header, no body.
The Content-Length header in the response can be used in the Range header for a subsequent GET request (same query string, just
GET instead of HEAD + Range header).
curl -I "$API_HOST/v1/location/agps" -H "Authorization: Bearer $JWT"
Type definitions:
| customTypes | Array of numbers (NrfGpsMessageType) Deprecated Items Enum: 1 2 3 4 5 6 7 8 9 Deprecated in favor of the 'types' param. |
| eci | integer <int32> (Eci) Example: eci=167899669 E-UTRA Cell Identifier (ECI), 28 bits (20 bits eNodeB and 8 bits Cell ID). Calculated using "(eNodeB-ID * 256) + Sector-ID". Range 0 .. 268435455. See ETSI TS 123 003, section 19.6 for more details. |
| filtered | boolean (FilteredEphemerisFlag) Example: filtered=true Send this flag if you want to receive ephemeris for only satellites in view. nRF Cloud will return ephemeris for up to 16 satellites. Cell data (eci, mcc, mnc, tac) is required. Defaults to false. |
| mask | number <double> (SatelliteMaskAngle) Example: mask=5 Filtered ephemeris mask angle. Only works in conjunction with the filtered flag. Controls the mask angle for which the satellites are filtered. Range 0..90 Defaults to 5 |
| mcc | |
number or string (Mnc) Example: mnc=120 Mobile Network Code. A number or string: 120 | 1 | "001" | "01" | "000". As defined in ITU-T E.212. | |
| requestType | string (RequestType) Deprecated Enum: "rtLocation" "rtAssistance" "custom" Type of data to be returned. Deprecated because the requestType is inferred from the request data. |
| rsrp | number <double> (Rsrp) Example: rsrp=-90 Reference Signal Received Power. Measured in dBm. See this page for more details. Range -157..-44 |
| tac | integer <int32> (Tac) Example: tac=13601 Tracking Area Code (TAC). Identifies a group of LTE cells in a certain region (Tracking Area). See ETSI TS 123 003, section 19.4.2.3 for more details. |
| types | Array of numbers (NrfGpsMessageType) Items Enum: 1 2 3 4 5 6 7 8 9 Type of assistance data (see description above). Defaults to [1, 2, 3, 4, 6, 7, 9] |
{ }Endpoints to retrieve the coarse location of the device based on the nearest cell(s).
For more information see the Location Services documentation.
Gets the lat, lon, and uncertainty values for the LTE cell(s) passed. If the optional nmr parameter is passed the endpoint operates in a "multi-cell" mode, using
more than one cell to determine a more accurate location.
Basic Request:
curl -X POST "$API_HOST/v1/location/cell" -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -d "{\"lte\":[{\"mcc\": 244, \"mnc\": 91,\"tac\": 4099,\"eci\":36078631}]}"
Save device location and silence response:
curl --verbose -X POST "$API_HOST/v1/location/cell?doReply=0" -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -d "{\"lte\":[{\"mcc\": 244, \"mnc\": 91,\"tac\": 4099,\"eci\":36078631}]}"
boolean or number (DoReplyFlag) Default: "true" Controls the response body. If boolean false or number 0, response body will be empty. | |
| fallback | boolean (FallbackFlag) Default: "true" nRF Cloud will always return the most accurate response based on cell tower location or AP location for wifi, if available. When not available, nRF Cloud falls back to area-level location estimate based on cell tower tracking area code. To disable this behavior, set fallback=false. This will ignore cell tracking area and return a 404 in event a higher accuracy response cannot be provided. |
| hiConf | boolean (HighConfidenceFlag) Default: "false" nRF Cloud automatically uses a 68% confidence interval when estimating the Horizontal Positioning Error (HPE) for a location. This means that there is a 68% probability that the device's actual location is within the HPE radius of the returned coordinates. Enabling this flag will use a 95% confidence interval instead, resulting in a larger HPE radius, and a higher probability that the device's actual location is within the circle. |
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
Array of objects (LteCell) | |
Array of objects (LteCatMCell) | |
Array of objects (NbIoTCell) |
required | LocationServiceType.MCELL (string) or LocationServiceType.SCELL (string) or LocationServiceType.MCELL_EVAL (string) or LocationServiceType.SCELL_EVAL (string) (CellServiceType) |
| lat required | number <double> (Latitude) WGS 84 geodetic grid line, north to south. |
| lon required | number <double> (Longitude) WGS 84 geodetic grid line, east to west. |
| uncertainty required | integer <int32> (Uncertainty) Radius of the uncertainty circle around the location in meters. Also known as Horizontal Positioning Error (HPE). |
{- "lte": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "mcc": 310,
- "mnc": 120,
- "eci": 167899669,
- "tac": 13601,
- "pci": 143,
- "earfcn": 41490,
- "adv": 20000,
- "nmr": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "earfcn": 41490,
- "pci": 143,
- "eci": 167899669,
- "timeDiff": 300
}
]
}
], - "ltecatm": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "mcc": 310,
- "mnc": 120,
- "eci": 167899669,
- "tac": 13601,
- "pci": 143,
- "earfcn": 41490,
- "adv": 20000,
- "nmr": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "earfcn": 41490,
- "pci": 143,
- "eci": 167899669,
- "timeDiff": 300
}
]
}
], - "nbiot": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "mcc": 310,
- "mnc": 120,
- "eci": 167899669,
- "tac": 13601,
- "pci": 143,
- "earfcn": 41490,
- "adv": 20000,
- "nmr": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "earfcn": 41490,
- "pci": 143,
- "eci": 167899669,
- "timeDiff": 300
}
]
}
]
}{- "lat": 45.524098,
- "lon": -122.688408,
- "uncertainty": 300,
- "fulfilledWith": "MCELL"
}Convert a set of WGS 84 coordinates into a physical address. Only country and state/province/region are guaranteed. Higher accuracy properties (street number, street, etc) are provided when available.
A 404 status code (not found) will be returned if nRF Cloud cannot determine at least country and state/province/region for the provided coordinates.
nRF Cloud returns the address data closest to the submitted coordinates. Coordinates from a higher-density urban areas generally provide better results. Coordinates from rural areas may return address data further away from the submitted coordinates. The system returns an uncertainty property, which is the distance in meters away from the submitted coordinates.
Coordinates obtained with a high-accuracy method (GNSS / Wi-Fi) will provide address data closer to the actual device location than coordinates obtained with lower-accuracy methods like cellular.
curl --location --request GET "https://api.nrfcloud.com/v1/location/geo?lat=45.524098&lon=-122.688408" \
--header "Authorization: Bearer $JWT" \
--header "Content-Type: application/json"
| lat required | number <double> (Latitude) Example: lat=45.524098 WGS 84 geodetic grid line, north to south. |
| lon required | number <double> (Longitude) Example: lon=-122.688408 WGS 84 geodetic grid line, east to west. |
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
required | object (ReverseGeoAddress) |
| formatted required | string (GeoAddressFormatted) Description of the address, created from values in the 'address' property |
| lat required | number <double> (Latitude) WGS 84 geodetic grid line, north to south. |
| lon required | number <double> (Longitude) WGS 84 geodetic grid line, east to west. |
| uncertainty required | integer <int32> (Uncertainty) Radius of the uncertainty circle around the location in meters. Also known as Horizontal Positioning Error (HPE). |
{- "lat": 45.524098,
- "lon": -122.688408,
- "uncertainty": 300,
- "formatted": "string",
- "address": {
- "country": "United States of America",
- "state": "Oregon",
- "countryCode": "US",
- "county": "string",
- "postalCode": "97123",
- "stateCode": "OR",
- "city": "Portland",
- "suburb": "string",
- "street": "Main St.",
- "streetNumber": "123"
}
}Endpoints for all things related to GNSS including assistance, predictions (coming soon), and reporting GNSS coordinates.
For more information see the Location Services GNSS tutorial.
Report device coordinates, commonly obtained from the device's GNSS modem.
Basic Request:
curl --location --request POST "$API_HOST/v1/location/gnss" \
--header "Authorization: Bearer $JWT" \
--header "Content-Type: application/json" \
--data-raw "{\"lat\":$LAT, \"lon\":$LON, \"spd\":$SPD, \"acc\":$ACC, \"alt\":$ALT, \"hdg\":$HDG}"
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
| lat required | number <double> (Latitude) WGS 84 geodetic grid line, north to south. |
| lon required | number <double> (Longitude) WGS 84 geodetic grid line, east to west. |
| acc | number <double> (Accuracy) Accuracy in (2D 1-sigma) in meters. |
| alt | number <double> (Altitude) Altitude above WGS 84 ellipsoid in meters. |
| hdg | number <double> (Heading) Heading of movement in degrees. |
| spd | number <double> (Speed) Horizontal speed in meters per second. |
| property name* additional property | any |
{- "lat": 45.524098,
- "lon": -122.688408,
- "acc": 15,
- "alt": 159,
- "spd": 1,
- "hdg": 90,
- "property1": null,
- "property2": null
}Provides assistance data to the device. Enables a faster time-to-first-fix (TTFF) for the GNSS modem. Returns the modem
parameters for the nRF GNSS modem in a chunk. The chunk size is determined by the request Range header.
See GetAssistanceDataSize endpoint for details.
Basic Request:
curl -X POST "$API_HOST/v1/location/agnss" -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -H "Accept: application/octet-stream" -H "Range: bytes=0-2200" --output assistance.bin
Custom Request:
curl -X POST "$API_HOST/v1/location/agnss" -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -H "Accept: application/octet-stream" -H "Range: bytes=0-2200" --output assistance.bin -d "{\"types\": [8], \"mcc\": 244, \"mnc\": 91, \"tac\": 4099, \"eci\": 36078631}"
Type definitions:
| range | string |
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
| eci | integer <int32> (Eci) E-UTRA Cell Identifier (ECI), 28 bits (20 bits eNodeB and 8 bits Cell ID). Calculated using "(eNodeB-ID * 256) + Sector-ID". Range 0 .. 268435455. See ETSI TS 123 003, section 19.6 for more details. |
| filtered | boolean (FilteredEphemerisFlag) Send this flag if you want to receive ephemeris for only satellites in view. nRF Cloud will return ephemeris for up to 16 satellites. Cell data (eci, mcc, mnc, tac) is required. Defaults to false. |
| mask | number <double> (SatelliteMaskAngle) Filtered ephemeris mask angle. Only works in conjunction with the filtered flag. Controls the mask angle for which the satellites are filtered. Range 0..90 Defaults to 5 |
| mcc | integer <int32> (Mcc) Mobile Country Code. As defined in ITU-T E.212. |
number or string (Mnc) Mobile Network Code. A number or string: 120 | 1 | "001" | "01" | "000". As defined in ITU-T E.212. | |
| rsrp | number <double> (Rsrp) Reference Signal Received Power. Measured in dBm. See this page for more details. Range -157..-44 |
| tac | integer <int32> (Tac) Tracking Area Code (TAC). Identifies a group of LTE cells in a certain region (Tracking Area). See ETSI TS 123 003, section 19.4.2.3 for more details. |
| types | Array of numbers (NrfMessageType) Items Enum: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Type of assistance data (see description above). Defaults to [1, 2, 3, 4, 6, 7, 9] |
Chunk of the file according to the request Range header.
{- "types": [
- 1
], - "mcc": 310,
- "mnc": 120,
- "tac": 13601,
- "eci": 167899669,
- "rsrp": -90,
- "filtered": true,
- "mask": 5
}"<Buffer>"This endpoint is for advanced use cases where you need to set the Range header to something other than the payload size.
Normally you will just set the Range header to the payload limit for your modem gets the payload size of the modem
parameters. This endpoint returns the totalBytes in the Content-Length response header, no body.
The Content-Length header in the response can be used in the Range header for a subsequent requests.
Basic Request:
curl -I $API_HOST/v1/location/agnss -H "Authorization: Bearer $JWT" -d "{\"types\": [8], \"mcc\": 244, \"mnc\": 91, \"tac\": 4099, \"eci\": 36078631}"
Type definitions:
| eci | integer <int32> (Eci) Example: eci=167899669 E-UTRA Cell Identifier (ECI), 28 bits (20 bits eNodeB and 8 bits Cell ID). Calculated using "(eNodeB-ID * 256) + Sector-ID". Range 0 .. 268435455. See ETSI TS 123 003, section 19.6 for more details. |
| filtered | boolean (FilteredEphemerisFlag) Example: filtered=true Send this flag if you want to receive ephemeris for only satellites in view. nRF Cloud will return ephemeris for up to 16 satellites. Cell data (eci, mcc, mnc, tac) is required. Defaults to false. |
| mask | number <double> (SatelliteMaskAngle) Example: mask=5 Filtered ephemeris mask angle. Only works in conjunction with the filtered flag. Controls the mask angle for which the satellites are filtered. Range 0..90 Defaults to 5 |
| mcc | |
number or string (Mnc) Example: mnc=120 Mobile Network Code. A number or string: 120 | 1 | "001" | "01" | "000". As defined in ITU-T E.212. | |
| rsrp | number <double> (Rsrp) Example: rsrp=-90 Reference Signal Received Power. Measured in dBm. See this page for more details. Range -157..-44 |
| tac | integer <int32> (Tac) Example: tac=13601 Tracking Area Code (TAC). Identifies a group of LTE cells in a certain region (Tracking Area). See ETSI TS 123 003, section 19.4.2.3 for more details. |
| types | Array of numbers (NrfMessageType) Items Enum: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Type of assistance data (see description above). Defaults to [1, 2, 3, 4, 6, 7, 9] |
{ }Generates up to two weeks of GNSS predictions. The predictions are used by the nRF91 GNSS modem to enable a faster time-to-first-fix (TTFF) and provide offline navigation when out of range of an LTE cell.
Returns a link for easy download of the predictions file.
Basic Request:
curl -G $API_HOST/v1/location/pgnss -H "Authorization: Bearer $JWT" -H "Content-Type: application/json"
Custom Request:
curl -G $API_HOST/v1/location/pgnss -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -d "predictionCount=42" -d "predictionIntervalMinutes=240" -d "startGpsDay=15131" -d "startGpsTimeOfDaySeconds=0"
| predictionCount | number <double> (PredictionCount) The number of predictions requested. Default is 42 (7 days, 6 predictions per day). Valid range 1..42 The number of possible predictions depends on StartGpsDay and PredictionInterval |
| predictionIntervalMinutes | number <double> (PredictionInterval) The time between predictions (in minutes). Defaults to 240 (4 hours). Valid values are: 240 |
| startGpsDay | number <double> (StartGpsDay) Example: startGpsDay=15131 The start day of the prediction set as GPS Day (days since the GPS epoch). Defaults to current GPS day. Valid range currentGpsDay..currentGpsDay + 6. |
| startGpsTimeOfDaySeconds | number <double> (StartGpsTime) The start time of the prediction set as seconds in day. Defaults to 0. Valid range 0..86399 |
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
| host required | string (PgpsHost) The protocol agnostic URL for accessing PGNSS prediction files. |
| path required | string (PgpsFilePath) The path to the file that contains PGNSS prediction data. |
{- "path": "public/15131-0_15135-72000.bin",
- "host": "pgnss.nrfcloud.com"
}Endpoint to retrieve the location of the device based on the nearest wi-fi access points or LTE cells. You can send either or both, using the same formats as you cell/wifi endpoints. The cloud will figure out the best location. This is a good option for low power devices looking to minimize the number of requests and extend battery life.
Gets the lat, lon, and uncertainty values for the LTE cell(s) or wifi access points passed. Wifi will be prioritized and fall back to LTE if unavailable. At least two Access Points are required.
Return JSON payload.
Basic Request:
curl -X POST "$API_HOST/v1/location/ground-fix" -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -d "{\"lte\":[{\"mcc\": 244, \"mnc\": 91,\"tac\": 4099,\"eci\":36078631}], \"wifi\":[{\"macAddress\": \"00-18-39-59-8C-53\", \"ssid\": \"my-wifi-network\", \"signalStrength\": -42}, {\"macAddress\": \"00:21:55:61:F3:0A\", \"ssid\": \"my-other-wifi-network\", \"signalStrength\": -22}]}"
Save device location and silence response:
curl --verbose -X POST "$API_HOST/v1/location/ground-fix?doReply=false" -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -d "{\"lte\":[{\"mcc\": 244, \"mnc\": 91,\"tac\": 4099,\"eci\":36078631}], \"wifi\":[{\"macAddress\": \"00-18-39-59-8C-53\", \"ssid\": \"my-wifi-network\", \"signalStrength\": -42}, {\"macAddress\": \"00:21:55:61:F3:0A\", \"ssid\": \"my-other-wifi-network\", \"signalStrength\": -22}]}"
| alt | boolean (AltLocationFlag) Default: "false" nRF Cloud makes its best effort to return the most quality location data possible. Sometimes that means choosing one location and throwing out the other. These details are omitted from the response to keep a small and succinct payload. Sending alt=true will allow you to see this alternate location and its distance from the chosen location in meters. |
| dist | number <double> (DistanceThresholdFlag) Default: "0" nRF Cloud combats stale and inaccurate Wi-Fi location data by comparing the distance between Wi-Fi and cell location (if provided). This parameter allows the user to customize this behavior by setting the distance threshold used in that comparison, with the requirement that cell location is also provided in the request. Measured in meters (m). |
boolean or number (DoReplyFlag) Default: "true" Controls the response body. If boolean false or number 0, response body will be empty. | |
| fallback | boolean (FallbackFlag) Default: "true" nRF Cloud will always return the most accurate response based on cell tower location or AP location for wifi, if available. When not available, nRF Cloud falls back to area-level location estimate based on cell tower tracking area code. To disable this behavior, set fallback=false. This will ignore cell tracking area and return a 404 in event a higher accuracy response cannot be provided. |
| hiConf | boolean (HighConfidenceFlag) Default: "false" nRF Cloud automatically uses a 68% confidence interval when estimating the Horizontal Positioning Error (HPE) for a location. This means that there is a 68% probability that the device's actual location is within the HPE radius of the returned coordinates. Enabling this flag will use a 95% confidence interval instead, resulting in a larger HPE radius, and a higher probability that the device's actual location is within the circle. |
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
Array of objects (LteCell) | |
Array of objects (LteCatMCell) | |
Array of objects (NbIoTCell) | |
Array of AccessPointWithFrequency (object) or AccessPointWithChannel (object) (AccessPoint) |
required | (GroundFixServiceType (LocationServiceType.MCELL (string) or LocationServiceType.SCELL (string) or LocationServiceType.WIFI (string) or LocationServiceType.MCELL_EVAL (string) or LocationServiceType.SCELL_EVAL (string) or LocationServiceType.WIFI_EVAL (string))) |
| lat required | number <double> (Latitude) WGS 84 geodetic grid line, north to south. |
| lon required | number <double> (Longitude) WGS 84 geodetic grid line, east to west. |
| uncertainty required | integer <int32> (Uncertainty) Radius of the uncertainty circle around the location in meters. Also known as Horizontal Positioning Error (HPE). |
object (AlternateLocation) |
{- "lte": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "mcc": 310,
- "mnc": 120,
- "eci": 167899669,
- "tac": 13601,
- "pci": 143,
- "earfcn": 41490,
- "adv": 20000,
- "nmr": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "earfcn": 41490,
- "pci": 143,
- "eci": 167899669,
- "timeDiff": 300
}
]
}
], - "ltecatm": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "mcc": 310,
- "mnc": 120,
- "eci": 167899669,
- "tac": 13601,
- "pci": 143,
- "earfcn": 41490,
- "adv": 20000,
- "nmr": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "earfcn": 41490,
- "pci": 143,
- "eci": 167899669,
- "timeDiff": 300
}
]
}
], - "nbiot": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "mcc": 310,
- "mnc": 120,
- "eci": 167899669,
- "tac": 13601,
- "pci": 143,
- "earfcn": 41490,
- "adv": 20000,
- "nmr": [
- {
- "rsrp": -90,
- "rsrq": -8,
- "earfcn": 41490,
- "pci": 143,
- "eci": 167899669,
- "timeDiff": 300
}
]
}
], - "wifi": [
- {
- "macAddress": "FE:1E:41:2D:9E:53",
- "ssid": "string",
- "signalStrength": -42,
- "age": 500,
- "signalToNoiseRatio": 0.1,
- "frequency": 2412
}
]
}{- "lat": 45.524098,
- "lon": -122.688408,
- "uncertainty": 300,
- "fulfilledWith": "MCELL",
- "alt": {
- "loc": {
- "lat": 45.524098,
- "lon": -122.688408,
- "uncertainty": 300,
- "fulfilledWith": "MCELL"
}, - "dist": 0.1
}
}Get location history for one, all, or a group of devices specified by tags parameter.
Notes:
serviceType field is intentionally empty for location data before December 10th 2021Basic Request for device history:
curl -G $API_HOST/v1/location/history -d "deviceId=$DEVICE_ID&start=2022-10-15T06:00:00.000Z&end=2022-10-16T18:30:00.000Z" -H "Authorization: Bearer $API_KEY"
Paginated Request:
export PAGE_NEXT_TOKEN=$(curl -G $API_HOST/v1/location/history -d "deviceId=$DEVICE_ID&start=2022-10-15T06:00:00.000Z&end=2022-10-16T18:30:00.000Z" -H "Authorization: Bearer $API_KEY" | jq .pageNextToken)
curl -G $API_HOST/v1/location/history -d "deviceId=$DEVICE_ID" --data-urlencode "pageNextToken=$PAGE_NEXT_TOKEN" -H "Authorization: Bearer $API_KEY"
Request all devices location history†:
curl -G $API_HOST/v1/location/history -H "Authorization: Bearer $API_KEY"
Request all devices last known location†:
curl -G $API_HOST/v1/location/history -d "latest=true" -H "Authorization: Bearer $API_KEY"
† Requires admin privileges
| deviceId | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: deviceId=nrf-1234567890123456789000 This is the canonical device id that is an optional parameter. Specify a device id to get its location history. If a device id is not provided, location history for all devices are returned. You must have admin privileges to perform this operation. |
| deviceIdentifier | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Deprecated Example: deviceIdentifier=nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| end | string <date-time> (ISODateTimeString) Example: end=2020-06-25T21:05:12.830Z HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| inclusiveEnd | string <date-time> (ISODateTimeString) Deprecated Example: inclusiveEnd=2020-06-25T21:05:12.830Z HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| inclusiveStart | string <date-time> (ISODateTimeString) Deprecated Example: inclusiveStart=2020-06-25T21:05:12.830Z HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| latest | boolean Default: false Get the last known location for all devices or a single device (if deviceId is supplied). You must have admin privileges. |
| pageLimit | integer <int32> (PageLimit) [ 1 .. 100 ] Default: "10" Maximum number of items you want returned in the response (<=100). |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
| pageSort | string (PageSort) Default: "desc" Enum: "asc" "desc" Example: pageSort=desc Sorting order for the paginated results => desc (descending; default) or asc (ascending). |
| start | string <date-time> (ISODateTimeString) Example: start=2020-06-25T21:05:12.830Z HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| tags | Array of strings (DeviceTag) If specified, only return location history for devices that have one of these Device Groups (tags). You must have admin privileges. |
required | Array of objects (LocationTrackerItem) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- {
- "id": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
- "deviceId": "nrf-1234567890123456789000",
- "serviceType": "GNSS",
- "insertedAt": "2020-06-25T21:05:12.830Z",
- "lat": "45.524098",
- "lon": "-122.688408",
- "meta": {
- "acc": 233.44,
- "spd": 11.22,
- "hdg": 76.8,
- "alt": 12
}, - "uncertainty": "934"
}
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}Delete a location history record.
| deviceId required | string (DeviceId) /^[a-z0-9:_-]{1,128}$/i Example: nrf-1234567890123456789000 This is the canonical device id used in the device certificate, and as the MQTT client id. |
| id required | string (LocationTrackerId) ^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[a-f0... Example: bc631093-7f7c-4c1b-aa63-a68c759bcd5c Universally unique identifier |
Endpoints for retrieving up to two weeks of predicted assistance data, enabling a faster time-to-first-fix (TTFF) for the GPS modem, even when the device is offline.
For more information see the Location Services documentation.
Generates up to one week of gps predictions. The predictions are used by the nRF91 GPS modem to enable a faster time-to-first-fix (TTFF) and provide offline navigation when out of range of an LTE cell.
Returns a link for easy download of the predictions file.
Basic Request:
curl -G $API_HOST/v1/location/pgps -H "Authorization: Bearer $JWT" -H "Content-Type: application/json"
Custom Request:
curl -G $API_HOST/v1/location/pgps -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -d "predictionCount=42" -d "predictionIntervalMinutes=240" -d "startGpsDay=15131" -d "startGpsTimeOfDaySeconds=0"
| predictionCount | number <double> (PredictionCount) The number of predictions requested. Default is 42 (7 days, 6 predictions per day). Valid range 1..42 The number of possible predictions depends on StartGpsDay and PredictionInterval |
| predictionIntervalMinutes | number <double> (PredictionInterval) The time between predictions (in minutes). Defaults to 240 (4 hours). Valid values are: 240 |
| startGpsDay | number <double> (StartGpsDay) Example: startGpsDay=15131 The start day of the prediction set as GPS Day (days since the GPS epoch). Defaults to current GPS day. Valid range currentGpsDay..currentGpsDay + 6. |
| startGpsTimeOfDaySeconds | number <double> (StartGpsTime) The start time of the prediction set as seconds in day. Defaults to 0. Valid range 0..86399 |
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
| host required | string (PgpsHost) The protocol agnostic URL for accessing PGNSS prediction files. |
| path required | string (PgpsFilePath) The path to the file that contains PGNSS prediction data. |
{- "path": "public/15131-0_15135-72000.bin",
- "host": "pgnss.nrfcloud.com"
}Gets the lat, lon, and uncertainty values based on the id of the LTE cell passed. Returns a binary payload or JSON, depending on the format argument. Binary by default. When returning binary, the by content-type response header is "application/octet-stream".
curl -G $API_HOST/v1/location/single-cell -d "mcc=244" -d "mnc=91" -d "tac=4099" -d "eci=36078631" -d "format=json" -H "Authorization: Bearer $JWT" -H "Content-Type: application/json"
| eci required | integer <int32> (Eci) Example: eci=167899669 E-UTRA Cell Identifier (ECI), 28 bits (20 bits eNodeB and 8 bits Cell ID). Calculated using "(eNodeB-ID * 256) + Sector-ID". Range 0 .. 268435455. See ETSI TS 123 003, section 19.6 for more details. |
| format | string (SingleCellFormat) Enum: "json" "binary" Format of the single-cell GET endpoint request. Defaults to binary. |
| mcc required | |
required | number or string (Mnc) Example: mnc=120 Mobile Network Code. A number or string: 120 | 1 | "001" | "01" | "000". As defined in ITU-T E.212. |
| rsrp | number <double> (Rsrp) Example: rsrp=-90 Reference Signal Received Power. Measured in dBm. See this page for more details. Range -157..-44 |
| tac required | integer <int32> (Tac) Example: tac=13601 Tracking Area Code (TAC). Identifies a group of LTE cells in a certain region (Tracking Area). See ETSI TS 123 003, section 19.4.2.3 for more details. |
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
Lat/lon/uncertainty as a binary struct.
"<Buffer>"Endpoint to retrieve the location of the device based on the nearest wi-fi access points.
boolean or number (DoReplyFlag) Default: "true" Controls the response body. If boolean false or number 0, response body will be empty. | |
| hiConf | boolean (HighConfidenceFlag) Default: "false" nRF Cloud automatically uses a 68% confidence interval when estimating the Horizontal Positioning Error (HPE) for a location. This means that there is a 68% probability that the device's actual location is within the HPE radius of the returned coordinates. Enabling this flag will use a 95% confidence interval instead, resulting in a larger HPE radius, and a higher probability that the device's actual location is within the circle. |
| x-custom-device-id | string (CustomDeviceId) /^[a-z0-9:_-]{1,128}$/i Example: my-device-12345 User-defined device ID, used to identify requests when using a cloud-to-cloud integration or service evaluation token. Ignored if using a device token. |
required | Array of AccessPointWithFrequency (object) or AccessPointWithChannel (object) (AccessPoint) | ||||||||||||
Array Any of
| |||||||||||||
| lat required | number <double> (Latitude) WGS 84 geodetic grid line, north to south. |
| lon required | number <double> (Longitude) WGS 84 geodetic grid line, east to west. |
| uncertainty required | integer <int32> (Uncertainty) Radius of the uncertainty circle around the location in meters. Also known as Horizontal Positioning Error (HPE). |
{- "accessPoints": [
- {
- "macAddress": "FE:1E:41:2D:9E:53",
- "ssid": "string",
- "signalStrength": -42,
- "age": 500,
- "signalToNoiseRatio": 0.1,
- "frequency": 2412
}
]
}{- "lat": 45.524098,
- "lon": -122.688408,
- "uncertainty": 300
}Endpoints for viewing the details and status of one or more bulk operations requests. A bulk operation request is a request to any endpoint that supports asynchronous operations, such as the OnboardDevices endpoint.
Fetch a bulk operations request.
| bulkOpsRequestId required | string (ULID) ^[0-9A-HJKMNP-TV-Z]{26}$ Example: 01EZZJVDQJPWT7V4FWNVDHNMM5 Universally Unique Lexicographically Sortable Identifier (using Crockford's alphabet). |
| bulkOpsRequestId required | string (ULID) ^[0-9A-HJKMNP-TV-Z]{26}$ Universally Unique Lexicographically Sortable Identifier (using Crockford's alphabet). |
| endpoint required | string (BulkOpsRequestEndpoint) Enum: "REGISTER_PUBLIC_KEYS" "REGISTER_CERTIFICATES" "ONBOARD_DEVICES" |
| requestedAt required | string <date-time> (ISODateTimeString) HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| status required | string (BulkOpsRequestStatus) Enum: "IN_PROGRESS" "FAILED" "SUCCEEDED" |
| uploadedDataUrl required | string The URL at which you can retrieve the data you originally uploaded to an endpoint that supports bulk operations. |
| completedAt | string <date-time> (ISODateTimeString) HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00). |
| errorSummaryUrl | string The URL at which you can retrieve a summary of errors and the row indices they occurred at for a failed bulk ops request job. |
{- "bulkOpsRequestId": "01EZZJVDQJPWT7V4FWNVDHNMM5",
- "endpoint": "REGISTER_PUBLIC_KEYS",
- "status": "IN_PROGRESS",
- "requestedAt": "2020-06-25T21:05:12.830Z",
- "completedAt": "2020-06-25T21:05:12.830Z",
}Fetch a list of bulk operations requests.
| endRequestedAt | string |
| pageLimit | number <double> Default: 10 |
| pageNextToken | string (PageNextToken) Example: pageNextToken=4bb1f9ab35bd If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding. |
| startRequestedAt | string |
| status | string (BulkOpsRequestStatus) Enum: "IN_PROGRESS" "FAILED" "SUCCEEDED" |
required | Array of objects (BulkOpsRequestDetails) |
| pageNextToken | string Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding. |
| total | integer <int32> >= 0 Reflects the total results returned by the query, which may be less than the total number
of items available. If the response contains a |
{- "items": [
- {
- "bulkOpsRequestId": "01EZZJVDQJPWT7V4FWNVDHNMM5",
- "endpoint": "REGISTER_PUBLIC_KEYS",
- "status": "IN_PROGRESS",
- "requestedAt": "2020-06-25T21:05:12.830Z",
- "completedAt": "2020-06-25T21:05:12.830Z",
}
], - "total": 10,
- "pageNextToken": "4bb1f9ab35bd"
}