POST /api/models/readfiledetails
Reads the contents of a schema definition file to the Dropbox, and returns a list of models defined in the schema.
Authorization Roles/Permissions: Must have Read permission for the resource.
This topic includes the following sections:
HTTP Method
POST
URL
https://{hostname}/api/models/readfiledetails
Sample Request
The example below shows upload of the specified JSON schema file to the Dropbox.
Sample Request URL
https://{hostname}/api/models/readfiledetails
Sample request headers
Accept: application/json X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...
Sample request body: Postman
The request body is the uploaded model schema file. An example in Postman is shown below.
Request Headers
For general information on request header values, refer to HTTP Request Headers.
Header | Description |
---|---|
Accept | application/json |
Content-Type | multipart/form-data |
Cookie | AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies. |
X-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 GET operations and is required for all others, with a few exceptions relating to user login. |
Request Parameters
Parameter | Parm Type | Data Type | Required | Description |
---|---|---|---|---|
FileName | Form | string | Required | The filename for the schema definition file to be read. For more information, see Managing Multipart/Form-Data Uploads. |
Response
If successful, this operation returns HTTP status code 200, with information about the uploaded file and the DropboxFileId.
Sample Response
The sample response below shows successful completion of this operation.
Sample response headers
HTTP/1.1 200 OK Date: Thu, 09 May 2019 20:53:28 GMT Content-Type: application/json
Sample response body
{ "DropboxFileId":1154, "FileName":"pet-single-schema.json", "SchemaImports":[ { "Name":"Pet", "AddToLibrary":true } ] }
Sample response body in Postman
Response Headers
For general information on response header values, refer to HTTP Response Headers.
Header | Description |
---|---|
Content-Type | application/json |
Response Body
Name | Type | Description |
---|---|---|
SchemaDocumentReference | SchemaDocumentReference | Contains information about references included within a schema document uploaded to the platform. |
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. You would also get this response for any operation that requires login (almost all) if the login cookie was missing. |
406 | Not Acceptable. Returned if there is a problem with the request format. For example, you would get this if you specified an incorrect media type for the Accept header. |
500 | An error occurred processing the call. |
More information about Akana API Platform API error messages.