Create an Attachment
The attachment resource connects uploads on Arta to shipment or request resources. Attached uploads are visible in the Arta Dashobard under the "Documents" tab on the shipment and request detail pages.
Each upload may be attached to many requests or shipments. Each request or shipment may have many associated uploads.
To create an attachment via the API you can must send an authenticated request to the POST /attachments
endpoint with a body that includes one of two different payload schema.
To attach an upload to a shipment, the attachment payload must include upload_id
and shipment_id
attributes. This payload must not include a request_id
attribute. For example:
{
"attachment": {
"shipment_id": "506d79b6-1e5e-4e8c-a266-74658fdaf4ee",
"upload_id": 5285
}
}
To attach an upload to a request, the attachment payload must include upload_id
and request_id
attributes. This payload must not include a shipment_id
attribute. For example:
{
"attachment": {
"request_id": "506d79b6-1e5e-4e8c-a266-74658fdaf4ee",
"upload_id": 5285
}
}
Body
-
Additional properties are allowed.
curl \
-X POST https://api.arta.io/attachments \
-H "Content-Type: application/json" \
-H "Authorization: ARTA_APIKey s0e1t2e3c4a5s6t7r8o9n10o11m12y" \
-d '{"attachment":{"upload_id":4791,"request_id":"506d79b6-1e5e-4e8c-a266-74658fdaf4ee"}}'
{
"attachment": {
"upload_id": 4791,
"request_id": "506d79b6-1e5e-4e8c-a266-74658fdaf4ee"
}
}
{
"id": 1942,
"upload_id": 4791,
"created_at": "2021-10-27T16:48:38.657228",
"request_id": "506d79b6-1e5e-4e8c-a266-74658fdaf4ee",
"updated_at": "2021-10-27T16:48:38.657228",
"shipment_id": null
}
# Headers
content-type: application/json
x-arta-request-id: FkBjuxbwLLTx4RoAARkx
# Payload
{
"errors": {
"detail": "string"
}
}