Mail service /api/dropbox/readfiledetails

Uploads the contents of a file, such as an API definition document (individual file or ZIP file), to the Dropbox, and returns information about the service that will be used to create the API. If the upload file is a ZIP file containing multiple services, information technology returns a list of services that are included in the file, so the user can specify a service.

Note: for an example that uses this operation, meet Example: Adding an API by importing an API clarification document.

Authorization Roles/Permissions: Must exist logged in. Must be an authorized user for the resource for which the file is being uploaded.

This topic includes the following sections:

HTTP Method

Post

Back to superlative

URL

https://{hostname}/api/dropbox/readfiledetails

Back to top

Sample Request

The instance below shows a asking to upload a specific API definition document to create an API.

Sample Asking URL

https://{hostname}/api/dropbox/readfiledetails

Sample request headers

Sample request body #1

The asking body is multipart-form data, not shown here.

Sample request #1: Curl

curl -X POST \   http://api.acmepaymentscorp.com/api/dropbox/readfiledetails \   -H 'Take: application/json' \   -H 'Cache-Control: no-cache' \   -H 'Postman-Token: fd22a58c-9024-40d8-a108-64a6d7d1f65b' \   -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \   -F 'FileName=@C:\swagger\swagger_petstore_io_6.json'

Sample asking body #2: Postman

In this example, the upload file was a ZIP file, so the response volition include a list of services included in the Aught file. Both request and response, in Postman, are shown below.

Dropbox service, readFileDetails, shown in Postman

Dorsum to acme

For general information on request header values, refer to HTTP Asking Headers.

Header Clarification
Take application/json, application/vnd.soa.v81+json
Content-Blazon multipart/form-data
Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authority token, and must be sent with every API request that requires login. For more information and an instance, see Session cookies.
10-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for Become operations and is required for all others, with a few exceptions relating to user login.

Dorsum to height

Asking Parameters

Parameter Parm Type Data Type Required Description
FileName Course string Required The name of the file beingness read to the Dropbox.

Note: For information about the wrapInHTML parameter shown in the sample request above, encounter File Upload with Ajax. This is just used if you are running the API in a browser context.

Back to meridian

Response

If successful, this functioning returns HTTP status code 200, with the Dropbox ID of the uploaded content.

Back to peak

Sample Response

The sample response below shows successful completion of this performance.

Sample response headers: application/vnd.soa.v81+json

Sample response body #ane: awarding/vnd.soa.v81+json

In the example beneath, a single file was uploaded to the Dropbox.

{   "FileName" : "swagger_getPetById.json",   "FileType" : "json",   "DropboxFileId" : 1008 }

Sample request body #2: ZIP file upload

In the instance beneath, a ZIP file containing multiple services was uploaded to the Dropbox. In this example, the user must selection the name of the specific service to be used, when putting together the request torso for the Mail service /api/apis operation.

{   "FileName":"swagger_petstore_multi.zip",   "FileType":"zip",   "DropboxFileId":1011,   "ZipFileEntry":[     "swagger_petstore2.json",     "swagger_petstore.json"   ] }

Back to tiptop

For general information on response header values, refer to HTTP Response Headers.

Header Clarification
Content-Blazon application/json, application/vnd.soa.v81+json

Back to meridian

Response Torso

Name Type Description
DropboxFileDetails DropboxFileDetails Contains information about file contents that were loaded into the Dropbox.

Dorsum to top

Error Codes/Messages

If the telephone call is unsuccessful an mistake lawmaking/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you lot didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. Y'all would also get this response for any operation that requires login (almost all) if the login cookie was missing.
405

Method Non Allowed. You might get this if at that place is an error in the URL, or if yous used the wrong HTTP verb.

You would besides get it if the URL was incorrect, including instance.

500 An error occurred processing the call.

More information well-nigh Akana API Platform API mistake letters.

Dorsum to top