Hi there guys,
I am trying to make a login via a console application, while trying to make the API
with the curl inside the openbalena-api
container, and for every request I get a redirect to my public redirect API_HOST
, which has been set in environment variable.
On the official documentation page, I could not find the proper information.
Tried different approaches: API Key as Bearer token
and Service tokens
.
Here is an output of what I’m getting when trying to login via curl
on the same container of the API:
root@538ed6bca06c:/usr/src/app# curl -i -L -X GET --location 'http://localhost/device' --header 'AdminBalenaAPIKey: MY_API_KEY_HERE'
HTTP/1.1 301 Moved Permanently
Location: https://api.iot.mydomain.com/device
Vary: Accept
Content-Type: text/plain; charset=utf-8
Content-Length: 72
Date: Wed, 13 Dec 2023 15:39:37 GMT
Connection: keep-alive
Keep-Alive: timeout=5
HTTP/1.1 404 Not Found
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Content-Security-Policy: default-src 'none'
Content-Type: text/html; charset=utf-8
Content-Length: 145
Vary: Accept-Encoding
Date: Wed, 13 Dec 2023 15:39:37 GMT
Keep-Alive: timeout=5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /device</pre>
</body>
</html>
root@538ed6bca06c:/usr/src/app#
Does anyone have an example of a curl
request to OpenBalena API
? I am looking for login request example, getting a token and revalidate it.
Thanks, looking forward!