-
Notifications
You must be signed in to change notification settings - Fork 10
Images
W. Scott Meeks edited this page Sep 6, 2019
·
5 revisions
List images
GET api/v1/{imageable_type}/{imageable_id}/images
e.g., api/v1/assets/A3CFFNMLECIAD/images
Request must contain following parameters in URL:
- imageable_type string [REQUIRED]
- imageable_id string [REQUIRED]
If successful, will return image array. For example:
{
"status": "success",
"data": {
"images": [
{
"object_key": "A3CN063DDED2",
"description": "test image 1"
"url": "http://sample.com/test_image_1.png"
},
{
"object_key": "A4CN0D3DDEF2",
"description": "test image 2"
"url": "http://sample.com/test_image_2.png"
}
]
}
}
Upload one image. This version of the API uses base64 to encode and transfer the image data.
POST api/v1/{imageable_type}/{imageable_id}/images
e.g., api/v1/assets/A3CFFNMLECIAd/images
Request must contain the following parameters in the URL:
- imageable_type string [REQUIRED]
- imageable_id string [REQUIRED]
And the following parameters in the POST Body:
- image base64 string [REQUIRED]
- original_filename string [REQUIRED]
- content_type string [REQUIRED] (e.g "image/jpeg")
- description string [REQUIRED] (can be empty string)
- image_classification_id integer [OPTIONAL]
- compass_point string [OPTIONAL] (N NE E SE S SW W NW)
- latitude float [OPTIONAL]
- longitude float [OPTIONAL]
If successful, will return uploaded image data. For example:
{
"status": "success",
"data": {
"image": {
"object_key": "A3CN063DDED2",
"description": "test image 1"
"url": "http://sample.com/test_image_1.png"
}
}
}
Update one image
PATCH/PUT api/v1/{imageable_type}/{imageable_id}/images/{id}
e.g., api/v1/assets/A3CFFNMLECIAd/images/A3CN063DDED2
Request must contain following parameters in URL:
- imageable_type string [REQUIRED]
- imageable_id string [REQUIRED]
- id _string [required]
If successful, will return updated image data. For example:
{
"status": "success",
"data": {
"image": {
"object_key": "A3CN063DDED2",
"description": "updated test image 1"
"url": "http://sample.com/test_image_1.png"
}
}
}
Delete one image
DELETE api/v1/{imageable_type}/{imageable_id}/images/{id}
e.g., api/v1/assets/A3CFFNMLECIAd/images/A3CN063DDED2
Request must contain following parameters in URL:
- imageable_type string [REQUIRED]
- imageable_id string [REQUIRED]
- id _string [required]
If successful, will return empty data hash. For example:
{
"status": "success",
"data": {}
}