Post custom data to autopi cloud

Dear AutoPi community,

I was looking for a way to send custom data to the autopi cloud with POST but with no success.

GET metods work so it’s not problem with autentification.

However I’m not sure that all needed headers are included and if there is some needed data format that needs to be used.

Here is post that I call:
curl --request POST "https://api.autopi.io/logbook/storage" --header "Authorization: Bearer ****" --header 'auth_token: ****-****-****-****-****' --header 'Content-Type: application/json' -d '{"gpu":{"value":22.2,"unit":"C"},"cpu":{"unit":"C","value":33.333},"ts":"2024-04-30T09:09:46.511923Z","t":"rpi.temp" }'

and response on it is server error (500).

What am I missing here? Endpoint URL and Auth Token are ones from device settings → cloud storage?

Ok I found where the issue is, when posting date device Auth Token needs to be used for Authorization in format: --header “Authorization: token ---*”

Hi @Stefan_Dangubic,

I apologize for a late reply.
Does your case still require assistance?

You can contact us also through support@autopi.io

Thank and regards!
Alexandra

Hey @Stefan_Dangubic,

Use the methods below :point_down: to acquire the Endpoint URL and Auth Token for cloud storage from your AutoPi device settings.

  • Access the AutoPi Cloud
  • Navigate to Device Settings
  • Locate Cloud Storage Settings
  • Retrieve Endpoint URL
  • Retrieve Auth Token
  • Configure Your Cloud Storage Service

You can configure and control the data exchange between your AutoPi device and the cloud storage service of your choice with this method.

1 Like