Upload (POST)
Use the POST method to upload files.
Content type to upload files must be "multipart/form-data".
The FormData interface should be used to upload files and text fields.
Other considerations when uploading files:
- Files must be sent with the fieldname file.
- You can upload up to 10 files in a single request.
- Each file can have up to 100 MB.
- Text fields are stored under metadata.
uniqueId - For each file uploaded we generate an uniqueId to identify the record stored in the database. This id can be used for the other request types.
Example:
note
Please remember that you are responsible for the data and files stored in your endpoints. YAWE's only objective is to provide a service to its users to make their life easier, we don't have interest in the data and we don't monitor it.
#
Request dataHTTP method: POST
URL format: https://baseUrl/versionNumber/customEndpointRoute/userEndpoint?key=apiKey[&dataOnly=true]
Example: https://app.yawe.dev/api/1/ce/examples/unsecure-endpoint?key=d59eb2859c284168ac48aef65046d5dd[&dataOnly=true]
#
Request ParametersThe following table describes the Request parameters.
Parameter | Description | Required |
baseUrl | Base url for calling the API. Value: app.yawe.dev/api | Yes |
versionNumber | Service version. Value: The current value is 1. | Yes |
customEndpointRoute | The route which identifies custom endpoints. Default value: ce | Yes |
userEndpoint | The endpoint name generated by the user. Value: the name created at https://app.yawe.dev | Yes |
key | The API Key of the project. | Yes |
dataOnly | If used, the endpoint response will only include the data associated with the file, without additional information such as ‘uniqueId’. Value: true | No |
masterKey | Overrides the need for Access tokens or restrictions applied to Authentication endpoints. Don't use this key in your client application. For more information please refer to projects. Value: the masterKey created at https://app.yawe.dev. | No |
#
Request CookiesHeader | Description | Required |
__Secure-yawe-access-token | The Access token is required for secure endpoints. It is obtained when doing a login and it is stored in an httpOnly cookie. To automatically include it in the request you need to set the following property:
Alternatively you can also use the Authorization header. For more information please refer to  the login documentation and Secure Endpoints documentation. | Yes - if endpoint is secure and Authorization header is not used |
#
Request HeadersHeader | Description | Required |
Content-Type | Specifies the MIME type of the body of the Request. It must be multipart/form-data. | Yes |
Authorization | The Access token is required for secure endpoints. You should use this header if you are not using the httpOnly cookie to access a Secure endpoint. For more information please refer to  the login documentation and Secure Endpoints documentation. | Yes - if endpoint is secure and httpOnly cookie is not used |
#
POST bodyYou can include an array of files (up to 10), and text fields. For files, they must be sent using the fieldname file.
#
Response data#
Error codesError code | Description |
400 | Possible reasons:
|
401 | If the endpoint is secured and the access token is missing or is not valid. It may also return this error if the user no longer exists. |
403 | Missing API Key, not allowed origin or disallowed request without orign. |