Export using access token


(Thomas De Groof) #1

The export feature (as documented here https://docs.stoplight.io/platform/export/export) is great for including Swagger spec into a code project (e.g. for code generation).
Unfortunately this only works when the projects is set to public… for a private project the export urls throw an HTTP 401 error.

Would be great if we could somehow use a generated access token (also used here: https://docs.stoplight.io/platform/projects/git-repo) to access export endpoints for private projects.
E.g. by adding the access token as a query parameter or HTTP header.


(Taylor Barnett) #2

Hey @thomas.degroof -

You can use access token and insert it as a header right now, like:

Authorization: Bearer $ACCESS_TOKEN


(Thomas De Groof) #3

@taylor what access token do you mean? When using a generated access token (from the user settings page), I receive following error:


(Taylor Barnett) #4

I’m looking more into this. Sorry about the delay with the US Thanksgiving Holiday.


(Taylor Barnett) #5

Did you use the first auth token? The one that says, “Use this token to authenticate with the Stoplight API and Prism.”

I do get the same error as you when I use second one, but it isn’t meant for the Stoplight API. It is only meant for git access.


(Taylor Barnett) #6

@thomas.degroof checking in on this to see if you got a chance to try it again. Otherwise, I am going to close it soon.


(Thomas De Groof) #7

Hi @taylor - it does work with the first token, must have missed that there are actually 2 tokens per token generation :slight_smile:

Thanks for the support, happy to have it working now!


(Taylor Barnett) #8

Yay - good to hear! :slight_smile:


(Taylor Barnett) #9