Is there a starting point for the ChirpStack API if I have an API token for a tenant? What I mean is some API call I can make to start retrieving the set of objects that are accessible. I’ve tried:
- I can’t list users (error code 16)
- I can’t list tenants expecting to get “mine” (error code 16)
- I can’t list applications, that requires a tenant ID (error code 3)
- I can’t list devices, that requires an application ID
So basically to use the API I also need to get at least my tenant ID from the web UI and enter that into any API client I use so I can list applications and then go from there?
BTW, are the error code meanings documented anywhere? So far I’ve seen:
{"code":16, "message":"", "details":[]}
and
{"code":3, "message":"invalid length: expected length 32 for simple format, found 0", "details":[]}
neither of which I find very helpful…
You likely cannot list tenants because you are a tenant. But you can retrieve your tenant ID from the URL when you log into the web interface. Your URL should look like:
https://<server-ip>/#/tenants/<tenant-id>
You can do the same to get the application ID if you need it, although you should be able to retrieve that from the API.
The first error message I am unsure about, but the second error message is because an input was incorrect, likely an appkey.
But I can’t log in to the web site using the API token, can I? I’m trying to do things like listing devices in a script and I’m wondering whether I can get by with just the API token as input.
No you can’t login with an API token. Maybe try sharing the code you are using, as it looks like you should be able to list tenants even from a tenant API key, so likely there is just something wrong with your script.