Any way to deeplink to .oas2 file


(Aden Forshaw) #1

My tired eyes have probably missed an obvious option to do this, but i can’t seem to find out how to deeplink to the raw .oas2 file, in order to have it downloaded by external parties e.g. https://apis.guru/add-api/


(Taylor Barnett) #2

Hey @aden.forshaw, you are not mistaken. For private projects, this is not possible right now. We’ve got an internal issue opened to push a feature update with this and more sharing options for private OAS documents.


(Thomas De Groof) #3

@aden.forshaw it is possible!

Step 1/3: Generate access token

On the Stoplight dashboard, go to “Settings > Access Tokens > Create a Token”.
2 different tokens are generated - you’ll need the first one:

Step 2/3: Fetch the correct export link

In your project, hover over an OAS file.
The export button will appear, click to retrieve the URL.
(You’ll receive an HTTP 401 Unauthorized)

33

Step 3/3: Request the file with access token

Use the token generated in step 1 as Bearer Authorization header to request the file:

Hint: use the “deref=all” query parameters to merge all external references into the output.

Hope that helps. :slight_smile:


(Taylor Barnett) #4

I should clarify, when I said it isn’t possible. I meant without using access tokens. :slight_smile: