Configuring Airbyte connector for API with session token and bearer token authorization


Guide on altering YAML file to configure Airbyte connector for API with session token and bearer token authorization


Hi! I am trying out Airbyte to see if the low-code connector will be able to connect to a REST API. The particular one I am working with uses something between a session token and bearer token to authorize. I am getting an error when I set it up. Attached is the error message. How can I alter the YAML file to fit this API?

This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. Click here if you want to access the original thread.

Join the conversation on Slack

["airbyte-connector", "rest-api", "session-token", "bearer-token", "yaml-configuration"]

It looks like you’re using mysGUID key to grab your bearer token. Is it a typo? Should it be myGUID instead?

Ie that error means you don’t have mysGUID key in the returned session.

Also, your auth path has weird param “showCode=packeast24” — should it be there?

Hi Natik, the ShowCode parameter is supposed to be there. The initial call to authorize returns a response with a body {“mysGUID”: “Random letters and numbers for token”}. Then I have to use that token to make calls to the endpoints (orders in this case).

Ah! I think the trick then is that the API returns your token in the body of the response, but SessionTokenAuthenticator wants a session (cookie I assume) key, not in the actual response body, but in response headers for session.

I don’t know from the top of my head if there’s a response body authenticator, let me check

Hmmmm, no, I think I’m wrong and your setup looks right to me.

I.e. in the docs it looks like session authenticator should grab the key out of response’s json body correctly. I wonder what response it receives, let me ask folks how to check out the response.

If you have a test account I can use on your API, I’m happy to try and test

Oh, that would be awesome! I don’t currently have a test account I can share with you. Let me check with some guys on Monday. In the meantime, here is the link to the documentation.

Here is some postman documentation

Looks good! Yeah, that should work in the Builder. Ping me with a test account, I’ll try to put something together!

Another tricky thing about this API is that a single call cannot access all the data in an endpoint. For instance, for payments, you have to use a parameter, either Customer ID or Order ID or another option. You only get that order returned in the response. Can Airbyte take an array of Customer IDs and cycle through making all those calls to get all the data?

Yep, that’s called “substreams”. In Payments stream, you would setup a parent stream “Orders” for example. Airbyte would fetch orders, and then fetch payments for each order.