POST /api/dropbox/readfiledetails

Reads 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, it returns a list of services that are included in the file, so the user can specify a service.

Authorization Roles/Permissions: 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 top

URL

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

Back to top

Sample Request

The example below shows a request to upload a specific API definition document to create an API.

Request URL

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

Sample request headers

POST /api/dropbox/readfiledetails?wrapInHTML=true&document.domain= HTTP/1.1
Accept: application/vnd.soa.v81+json
X-Csrf-Token_{tenant}: {TokenID}

Sample request body

The request body is multipart form data, not shown here.

Back to top

Request Headers

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

Header Description
Accept application/json, application/vnd.soa.v81+json
Content-Type multipart/form-data

Back to top

Request Parameters

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

Back to top

Response

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

Back to top

Sample Response

The sample response below shows successful completion of this operation.

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

HTTP/1.1 200 OK
Date: Wed, 10 Feb 2016 21:54:27 GMT
Content-Type: application/vnd.soa.v81+json

Sample response body #1: application/vnd.soa.v81+json

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

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

In the example below, a ZIP file containing multiple services was uploaded to the Dropbox. In this example, a further step is needed; the user must specify which service to use to create the API, using the GET /api/dropbox/readfiledetails operation.

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

Back to top

Response Headers

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

Header Description
Content-Type application/json, application/vnd.soa.v81+json

Back to top

Response Body

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

Back to top

Error Codes/Messages

If the call is unsuccessful an error code/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 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.
405

Method Not Allowed. For example, you might get this if you specified an invalid Accept header or omitted a required Content-Type header.

You would also get it if the URL was incorrect, including case.

500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics