Get Attachments for Multiple Records
Method
GET
URL
/v2/<object_full_identifier>/attachments
Parameters
uuids: comma-separated list of record UUIDs for which to retrieve related attachments
Response Content Type
application/json
Imput Example
Following is an example that shows how to get attachments from two Showcase records by using the uuids parameter. The input should be a GET request with the following URL:
GET https://localhost:8080/v2/io_showcase/attachments?uuids=42f64596-c42f-4ba2-8138-cc40188d2a88,41f19ff6-2738-4000-8bfd-a18950caa1d1
Response Example
The response is a JSON map keyed by record UUIDs, in which each value is an array that represents a record's related attachments, with URLs that honor HATEOAS. In the following example Status Code 200 response, the record with UUID 42f64596-c42f-4ba2-8138-cc40188d2a88 has no attachments and is represented by an empty array, and the record with UUID 41f19ff6-2738-4000-8bfd-a18950caa1d1 has multiple attachments.
{
"42f64596-c42f-4ba2-8138-cc40188d2a88": [],
"41f19ff6-2738-4000-8bfd-a18950caa1d1":
[{
"updated_on":"1480085367917",
"size":"314",
"media_type":"application/rtf",
"version_uuid":"28d28b95-277e-4d8b-98c7-0777b4d810c5",
"name":"file1.txt",
"links":[
{ "rel":"url",
"href":"https://localhost:8080/document/e74f0eff-ed37-4d72-9410-01977c5199e5/latest?148008536791"
}
{ "rel":"thumbnail_url",
"href":"https://localhost:8080/document/3b156bad-81fd-4c86-9624-50c4f7cdb71d/latest?5.0.0.620-SNAPSHOT"
}],
"type":"file",
"uuid":"e74f0eff-ed37-4d72-9410-01977c5199e5"
},
{
"updated_on":"1480085367917",
"size":"310",
"media_type":"application/rtf",
"version_uuid":"71e5b04f-3f41-480d-8a71-74fcb28f1600",
"name":"file2.text",
"links":[
{ "rel":"url",
"href":"https://localhost:8080/document/ef39b3db-01ce-4a72-aa28-f3af91917245/latest?1480085367917"
}
{ "rel":"thumbnail_url",
"href":"https://localhost:8080/document/3b156bad-81fd-4c86-9624-50c4f7cdb71d/latest?5.0.0.620-SNAPSHOT"
}],
"type":"file",
"uuid":"ef39b3db-01ce-4a72-aa28-f3af91917245"
}, ...]
}
Input Example
Following is an example of how to retrieve all Showcase records that have at least one attachment. If no records have attachments, the response is an empty map. The input should be a GET request with the following URL:
GET https://localhost:8080/v2/io_showcase/attachments
Response Example
The response format is the same as that for Get Attachments for Single Records when you use the uuids parameter.
Error Response Messages
HTTP Status Code
Error Message
400
The object identifier is not specified or is invalid
The uuids parameter contains an invalid UUID
404
Any of the records specified on the uuids parameters, to get attachments from, was not found (or user has no permission to access it)
500
Internal Server error
For more information:
Was this helpful?