Skip to main content

API requirements for nRF Cloud Location Services

The following table summarizes requirements for using Location Services through either REST or MQTT, as well as an explanation of the authorization mechanisms for each.

ProtocolAuthenticationKey Differences
MQTTMutual TLSRequires certificate and onboarding.
RESTOAT or JWTDoes not require certificate or onboarding. Proxy servers use an Organization Auth Token (OAT); devices use a JWT.

MQTT requirements for Location Services

To use MQTT, you must create X.509 device certificates and onboard your device to nRF Cloud:

  1. Create and inject the device certificates.
  2. Onboard the device.
  3. Follow the steps in the docs for the relevant Location Service libraries in the nRF Connect SDK.

REST requirements for Location Services

When using nRF Cloud REST-based Location Service endpoints, onboarding is optional, as are device certificates.

JWTs are used for device authentication. Include the token in the Authorization header in calls to Location Services REST endpoints. For example, using cURL: Authorization: Bearer <your_token>.

A cloud-to-cloud setup uses OATs for authentication over the REST API.

Authentication for proxy servers

If you are using Location Services over REST through a proxy server in a cloud-to-cloud integration, authenticate using an OAT.

See the Location Services Quickstart for step-by-step instructions.

Access

Cloud-to-cloud use of nRF Cloud requires a Pro or Enterprise plan.

Authentication for devices

This applies to device-to-cloud (D2C) operations.

If you have successfully onboarded and connected your device to nRF Cloud, you do not need to do any additional steps for authentication.

The following steps apply if you are using the REST API without onboarding your devices on nRF Cloud and not using a proxy server:

  1. Create a key pair and inject the private key.
  2. Register the public key for each device using the RegisterPublicKeys endpoint.
  3. Follow the steps in the docs for the relevant Location Service libraries in the nRF Connect SDK, including the REST library. For creating JWTs, see the %JWT AT command and related library in the nRF91 AT Commands documentation.