Uploading swagger file using an api call.

Hi,

I want to upload swagger (json format) file using api call specified here. Following are my queries:

1. My use case is that Swagger file is uploaded as an asset on BaaS. So in-order to fetch it I need to place URL=https://api.usergrid.com/org/app/collection/uuid but I also need to pass the header "Accept: text/plain". I can specify the URL as body while making the call, but is there a way to send this header also?

The api call works fine when I specify another URL that can fetch the swagger directly without the need of attaching any header.

2. Since the option to upload from file is present in the devportal UI. So, is there an api call to upload swagger 2.0 json files, by passing its content as body?

Thanks in advance.

Solved Solved
1 2 1,324
1 ACCEPTED SOLUTION

Not applicable

Hi @Sonali

Instead of upload to BaaS as an asset, You can use the devportal itself to upload the file and provided as an absolute url. You can navigate to Admin->Content -> Files (admin/content/file ) to upload new files. To make sure your file extension is allowed for file uploads, you can update the Default Allowed File Extensions under Admin->Configuration->Media->File Settings ( admin/config/media/file-settings ).

Visit the file and copy the full path and same path can be used in upload option of SmartDocs UI.

View solution in original post

2 REPLIES 2

Not applicable

Hi @Sonali

Instead of upload to BaaS as an asset, You can use the devportal itself to upload the file and provided as an absolute url. You can navigate to Admin->Content -> Files (admin/content/file ) to upload new files. To make sure your file extension is allowed for file uploads, you can update the Default Allowed File Extensions under Admin->Configuration->Media->File Settings ( admin/config/media/file-settings ).

Visit the file and copy the full path and same path can be used in upload option of SmartDocs UI.

Thank you!