Upload a file
POST/api/file/upload
Upload a file to the Ownli cloud. All files used for check-ins need to be uploaded to the Ownli cloud first.
Request
- application/json
Body
required
User defined file name of the file. You can give a name that makes it easier the URL easier to identify. Also it will be helpful to provide a suffix so tools like a Browser, Finder or explorer can display it automatically.
Base64 encoded string representation of the file.
Unique identifier of the device on which the document was uploaded or photo taken.
The manufacturer of the device on which the document was uploaded or photo was taken. e.g. Apple, Xiaomi, Samsung, OPPO, OnePlus etc.
The model of the device on which the document was uploaded or photo was taken. e.g. LM-G900, motorola edge, IPad, IPhone 14
The OS of the device on which the document was uploaded or photo was taken. Android 9, iOS 13.2.3 etc.
[takenOn] The timestamp at which the document was uploaded or photo was taken. (The date should be in the ISO8601 UTC format YYY-MM-DDThh:mm:ss.SSSZ; eg: 2024-01-01T00:00:00.000Z
Latitude at which photo was taken.
Longitude at which photo was taken.
Responses
- 200
- 400
- 401
- 403
- 404
- 500
File object created by the upload.
- application/json
- Schema
- Example (from schema)
Schema
Id of the owner
URL of the file
The timestamp of upload
{
"userId": "string",
"fileUrl": "string",
"dateUploaded": "string"
}
Invalid parameters. Possible error codes
-
ERROR_INVALID_PARAMETERS
- application/json
- Schema
- Example (from schema)
Schema
Error code
A verbose error message
{
"error_code": "string",
"error_message": "string"
}
Authorization error e.g. due to an invalid or missing API keys.
Forbidden. Possible error codes
-
ERROR_NO_PERMISSIONS_TO_RESOURCE
- application/json
- Schema
- Example (from schema)
Schema
Error code
A verbose error message
{
"error_code": "string",
"error_message": "string"
}
User not found. Possible error codes
-
ERROR_USER_NOT_FOUND
- application/json
- Schema
- Example (from schema)
Schema
Error code
A verbose error message
{
"error_code": "string",
"error_message": "string"
}
Internal error. Possible error codes
-
INTERNAL_SERVER_ERROR
-
ERROR_DECODING_FILE,
-
ERROR_UPLOADING_FILE
- application/json
- Schema
- Example (from schema)
Schema
Error code
A verbose error message
{
"error_code": "string",
"error_message": "string"
}