Images
Last updated
Last updated
Endpoint: Upload Image
This endpoint allows developers to upload an image file. The endpoint performs various checks and operations on the uploaded image and returns the processed data.
The request should include the following header:
Request Method: POST
Request Body Parameters:
Parameter | Type | Description |
---|---|---|
Response:
The response returns JSON data with the following structure:
Error Responses:
If an error occurs during the request, the response will contain an error message with the appropriate status code.
Example Usage:
Field | Type | Description |
---|---|---|
Status Code | Error Message | Description |
---|---|---|
file
File
The image file to be uploaded.
user_id
String
The ID of the user/organization associated with the image.
_id
String
Associated _id of file used to identify it.
isSuccess
Boolean
Indicates whether the request was successful or not.
data
Object
Contains the processed data of the uploaded image.
data.file_url
String
The URL/path of the uploaded file.
data.extra_vision
Array
An array of objects representing additional vision information about the image. Each object contains a "description" field.
compute
Number
The remaining compute value of the organization after processing the image.
400
{ "isSuccess": false, "msgError": "file is required" }
The file parameter is missing in the request.
404
{ "isSuccess": false, "message": "Organization not found" }
The organization associated with the user_id was not found.
403
{ "isSuccess": false, "message": "Insufficient compute available" }
The compute reduction exceeds the available compute.