PUT
/
work-orders
/
{id}
/
attachments
Add Attachment
curl --request PUT \
  --url https://api.serial.io/work-orders/{id}/attachments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form type=IMAGE \
  --form 'name=<string>' \
  --form added_by_user_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
  --form 'value=<string>' \
  --form 'file_name=<string>'
{
  "id": "<string>",
  "wo_number": 1,
  "name": "<string>",
  "description": "<string>",
  "component_id": "<string>",
  "part_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "DRAFT",
  "phase": "<string>",
  "quantity": 123,
  "approvals": {
    "[approver_user_id]": {
      "approver_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "requested_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "requested_at": "2023-11-07T05:31:56Z",
      "status": "<any>",
      "last_updated_at": "2023-11-07T05:31:56Z"
    }
  },
  "assignee_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "deadline": "2023-11-07T05:31:56Z",
  "activity_log": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "message": "<string>",
      "added_at": "2023-11-07T05:31:56Z",
      "added_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "type": "CREATED",
      "data": "<string>"
    }
  ],
  "last_edited_at": "2023-11-07T05:31:56Z",
  "attachments": [
    {
      "dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "value": "<string>",
      "file_name": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "added_at": "2023-11-07T05:31:56Z",
      "added_by_user_id": "<string>",
      "is_deleted": true
    }
  ]
}

Authorizations

Authorization
string
header
required

API Key or Token formatted as Bearer <YOUR_KEY_OR_TOKEN>

Headers

Content-Type
string

Should be multipart form data

Path Parameters

id
string
required

The work order UUID (work_order.id) or work order number (work_order.wo_number). Both will map to the same work order

Body

multipart/form-data

The request body is multipart form data and must include a JSON metadata object named metadata as well as optionally an image or file (of any format) named attachment if metadata.type is set to IMAGE or FILE. The example body shown here is that only of the metadata. The file binary would need to be attached sperately.

type
enum<string>
required
Available options:
IMAGE,
FILE,
TEXT
name
string
required
added_by_user_id
string<uuid>
required
value
string

Include only for TEXT attachments

file_name
string

Include only for FILE or IMAGE attachments

Response

200 - application/json

OK

Work Order Data

id
string
wo_number
integer
Required range: x >= 0
name
string
description
string | null
component_id
string
part_number_id
string<uuid> | null
created_at
string<date-time>
created_by_user_id
string<uuid>
status
enum<string>
default:DRAFT
Available options:
DRAFT,
REVIEW,
PRODUCTION,
COMPLETE,
CANCELED,
ARCHIVED
phase
string
quantity
integer
approvals
object

Approvals object will have one key value pair for every approver

assignee_user_id
string<uuid> | null
deadline
string<date-time> | null
activity_log
object[]
last_edited_at
string<date-time> | null
attachments
object[]

Multiple datasets can be added to the attachments object