This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Struggling to read data via REST-API with Thingy:91

Hello,

I'm trying to read data from the Thingy:91 via the REST-API. I can list the devices and query the state of the device, but I'm not sure how to progress.

So far I have used this to query the state of the device:

http api.nrfcloud.com/.../nrf-X Authorization:"Bearer Y"

I've tried this path to access the GPS for example, but had no success:

http api.nrfcloud.com/.../agps Authorization:"Bearer Y"

How can I get the sensor via the API?

Best regards, Franz

Parents
  • Apologies,  I think I missed your real question.  The /location/agps endpoint requires a device identifier as a parameter: 

    curl -G $API_HOST/location/agps -d "deviceIdentifier=$DEVICE_ID" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/octet-stream" -H "Range: bytes=0-2200" --output agps.bin

    Please note: The just-released location services are designed to assist devices by providing additional
    information to the device about location. They do not provide a GPS location directly. That information is still
    found by GET https://api.nrfcloud.com/v1/messages, if GPS is enabled in the application.

    The single-cell endpoint (https://api.nrfcloud.com/v1/location/single-cell) provides the location of the
    cell tower matching the connection information passed in the parameters, along with an uncertainty radius.

    The agps endpoint (https://api.nrfcloud.com/v1/location/agps) provides a binary payload that
    "Enables a faster time-to-first-fix (TTFF) for the GPS modem". It basically provides information
    on satellite locations to help the GPS acquire a location fix faster.

Reply
  • Apologies,  I think I missed your real question.  The /location/agps endpoint requires a device identifier as a parameter: 

    curl -G $API_HOST/location/agps -d "deviceIdentifier=$DEVICE_ID" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/octet-stream" -H "Range: bytes=0-2200" --output agps.bin

    Please note: The just-released location services are designed to assist devices by providing additional
    information to the device about location. They do not provide a GPS location directly. That information is still
    found by GET https://api.nrfcloud.com/v1/messages, if GPS is enabled in the application.

    The single-cell endpoint (https://api.nrfcloud.com/v1/location/single-cell) provides the location of the
    cell tower matching the connection information passed in the parameters, along with an uncertainty radius.

    The agps endpoint (https://api.nrfcloud.com/v1/location/agps) provides a binary payload that
    "Enables a faster time-to-first-fix (TTFF) for the GPS modem". It basically provides information
    on satellite locations to help the GPS acquire a location fix faster.

Children
Related