API with Session Auth

Hi there,

How to connect API that uses initial connection to store session in cookies?
Then uses cookie and api key to authorize requests?

Is it possible with Bubble API COnnector plugin?


1 Like

Which API are you trying to use?

It’s Slovak invoicing app, they use session based auth:

First you need to initialize with api key to get session id:

curl -G https://www.faktury-online.com/api/init
–cookie-jar cookie.txt
–data-urlencode ‘data={“key”:“YOUR_API_KEY”,“email”:“your@email.com”}’

As you can see I tested it with curl where it saved cookie/session id

www.faktury-online.com FALSE / FALSE 0 PHPSESSID 2je39jldcka5vnff3middmldqp

After this you can lets say list invoices or create one:

curl -G https://www.faktury-online.com/api/zf
–cookie “cookie.txt”
–cookie-jar cookie.txt
–data-urlencode ‘data={“key”:“YOUR_API_KEY”,“email”:“your@email.com”,“code”:“2e20acdc64c15eb20796555d5ds33cdsa8”}’

This curl call is to show invoice details in JSON format about invoice ID: 2e20dc4c63c15eb9479659dddc33cd98

So is there any possibility to use such auth in bubble, either plugin development or via API Connector plugin?

Thank you