HTTP API Request with Node-RED

According to the documentation of the application manager api we should be getting output for this API ( GET /applications/{app_id}/devices/{dev_id}) if the input is of the form

  "app_id": "some-app-id",
  "dev_id": "some-dev-id"

I passed this as msg.payload to the HTTP request node (GET) from the url, but I don’t receive a json object.

What is the response code/msg?
How do you manage auth?

I am trying to understand how to manage authentication, currently the response code says that no json string detected. 404 is the code (it is 200 for successful)

If anybody knows anything that can help me kickstart the process please do help.

404 means that your url is wrong. So you don’t have a json because you are not calling an existing ressource. Without auth, but with an existing ressource, you will receive a 403 or 401.

What is the full url you are using?

The url from which i am requesting data is:

This is the Snapshot of Node red:

You need to call the endpoint, not the root of the API.
Will answer:
{“error”:“Metadata not valid: neither token nor key present”,“code”:2,“message”:“Metadata not valid: neither token nor key present”} (try in your browser).
In your case, you have to call:{app_id}/devices/{dev_id}

1 Like

That’s incomplete. You may want to try without Node-RED first. The following works for me, on a Mac. Just for readability, a trailing backslash \ indicates the command continues on the next line; I think that’s a forward slash / on Windows. The --get and --url are optional, and --header is the same as -H:

  • To get all devices in application arjanvanb-1:

    curl \
      --get \
      --header 'Authorization: Key ttn-account-v2.m2xb7<redacted>I3RqU' \

    Beware that the URL should not end with a slash; using [...]/devices/ will throw Invalid Device Identifier: DevID not valid: can not be empty.

  • To get details of a single device, like arjanvanb-heltec-4 in application arjanvanb-1:

    curl \
      --get \
      --header 'Authorization: Key ttn-account-v2.m2xb7<redacted>I3RqU' \

So, you’ll need something in Node-RED to programmatically expand the URL to include the application id and device id in the URL. See, e.g., See, e.g., or (and in general).


For those with allergies at the CLI, Postman is great to begin and understand how an API works.