Guide: Getting started with the AutoPi REST API

Hi @Malte,

Thank you for your reply.
Yes, I realized about my mistake and the code was working with the edit I mentioned.
Also, is it possible to retrieve data from the new API portal directly?
From the screenshot you posted in the beginning of this post, it seems like the website has changed.

Thanks again!

Best,

Iker

FYI - the currently deployed version of our API documentation does not work properly.
It uses an incorrect url, which means that you can use the documentation, but sending requests interactively from the api documentation does not work.

EDIT: It has been fixed :slight_smile:

@iipr So yes, you can request data directly from the documentation
Yes the website has changed, we will update the getting started guide shortly :slight_smile:

Best regards
/Malte

1 Like

Great news @Malte, thank you!

Looking forward to try it :slight_smile:

Best regards,
Iker

Hi @Malte. Thanks for the guide.
In case I want to retrieve roll_pitch from the accelerometer (http://docs.autopi.io/services/acc_manager/), what parameters should I pass to the request?

Thanks

Hello Malte!

Did you change the API in case of getting the recent position of a vehicle / dangle?

With
https://api.autopi.io/logbook/most_recent_position/?date_cutoff=2018-01-29T09:54:58.679Z&device_id=DEVICE_ID
it worked fine the longest time.

But now I can’t get the position anymore. In the API documentation I found the request
https://api.autopi.io/logbook/most_recent_position**s**/

But the above one is not mentioned there.

The “new” request works, but I always get the positions of all devices. Is it possible to get only one device?

Hi @p.schaedle.

Yes, the API was changed, however there have been some complications with that change, so it will be reverted back. The endpoint path will likely* be the same as before (https://api.autopi.io/logbook/most_recent_position) and there will still be the one that fetches all devices’ recent positions.

* You can always refer to the latest API documentation here as it is autogenerated and you can be sure the paths are up to date.

Best
Nikola

Most of the API examples I have found are for historical data (between dates XXX and YYYY), but what im interested in is getting current/latest data. Is this possible? I know that /logbook/most_recent_positions/ can do that for latest position, but is is it possible with battery voltage and obd data?

The api page is not able to send api requests because it doesnt put APIToken right before the key

I’ve created a Postman collection containing all the endpoints along with step by step install instructions on how to get a token and apply it to Postman. Should save a lot of head scratching for newies.

Auto-Pi Postman collection on GitHub

1 Like

You need to input the APIToken (or Bearer) in front of the token when you input the token.

1 Like