Discuss.FOLIO.org is no longer used. This is a static snapshot of the website as of February 14, 2023.

REST api endpoints for Folio data, like listing of budgets?

artturimatias
1 Dec '21

Hi, I’ve desperately tried to find examples of REST api usage for data manipulation. I found api descriptions here: FOLIO Developers | Reference | API documentation

But what is the exact endpoint if my Folio instance is in address https://my-folio.com and I want to get list of all budgets (/finance/budgets)?

I guess API is versioned but I can’t find info about that.

Any help is much appreciated.

ostephens
1 Dec '21

You’ll need to have the OKAPI URL for your Folio (more on OKAPI at okapi/guide.md at master · folio-org/okapi · GitHub) and a x-okapi-token and x-okapi-tenant defining in your http request header to interact with the APIs.

This wiki page may help get you started REST API: Getting started with Postman - Information and User Guides for FOLIO Apps - FOLIO Wiki

I also highly recommend joining the learning-apis channel in the Folio Slack channel (you can register for the Slack at slack-invitation.folio.org if you are not already on there)

ostephens
1 Dec '21

An example cURL for this information on the Folio Snapshot hosted reference environment would be:

curl --location --request GET 'https://folio-snapshot-okapi.dev.folio.org/finance/budgets' \
--header 'authority: folio-snapshot-okapi.dev.folio.org' \
--header 'x-okapi-tenant: diku' \
--header 'accept-language: en-US' \
--header 'content-type: application/json' \
--header 'accept: application/json' \
--header 'x-okapi-token: <insert valid token here> \
--header 'sec-fetch-site: same-site' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-dest: empty' \
--header 'referer: https://folio-snapshot.dev.folio.org/'

You’ll need to use a valid x-okapi-token value for this to work where it says ‘<insert valid token here>’

artturimatias
1 Dec '21

Thank you for your help @ostephens. This gets me on the right track.
Is OKAPI url publicly available by default installation? Does it have to be?

artturimatias
1 Dec '21

Ah, found url from System Information. All good so far!

ostephens
1 Dec '21

Yes - if you look login to a Folio tenant in a browser and then look at the network tab in the developer tools of the browser you’ll be able to see the calls to the APIs that are being done to deliver the web UI

artturimatias
1 Dec '21

Thanks again, I got list of budgets now and I also joined the slack channel, thanks for the tip!

kzeng
20 May '22

Thank you for your help. It’s very useful.