Chirpstack API call via curl

Hello there, I try to use the api of version Chirpstack-4.7.0 but I fail.

I generate a token via web with API KEY.

Then with

curl -X 'GET' \
  'https://console.helium-iot.xyz/api/applications/' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: TOKEN'

I get

{
  "code": 16,
  "message": "authorization metadata must in format 'Bearer <TOKEN>",
  "details": []
}

I found this info, but I don’t understand it.

This seems better but how it’s applicable to chirpstack?

I found something good in forum this but still fails

curl -X 'GET' \
  'https://console.helium-iot.xyz/api/applications' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer <<TOKEN>>'
                                   ^^ Added Bearer, also '<<' before TOKEN and '>>' after token.

I get
{"code":16,"message":"Base64 error: Invalid byte 60, offset 0.","details":[]}

Without << >> but only with Bearer the error is

{
  "code": 3,
  "message": "invalid length: expected length 32 for simple format, found 0",
  "details": []
}

The solution is to add only Bearer before token and I forgot to add tenantID.

So the right curl command is:

curl -X 'GET' \
  'https://console.helium-iot.xyz/api/applications?limit=4&tenantId=ADD_YOUR_TENANT_ID' \
  -H 'accept: application/json' \
  -H 'Grpc-Metadata-Authorization: Bearer TOKEN_FROM_WEB_AS_API_KEY_SEEN_ONLY_ONCE'

With limit 0 you don’t have details, only count of applications.