Beta APIs

[beta] Attach a file to a work order.

Attaches a PDF, JPEG or PNG file to an existing work order. Supply exactly one of file (base64, at most 7,864,320 decoded bytes) or upload (up to 40,000,000 bytes). For upload, PUT the declared file with matching Content-Type, Content-MD5 and Content-Length before uploadPut expires. Read GET /maintenance/work-orders for availability and the download URL after successful upload. Presigned uploads require the estimate REST rollout to be enabled.

<b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

To use this endpoint, select Write Work Orders under the Work Orders category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

post/maintenance/work-orders/attachments

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Request body

workOrderIdstring required

ID of the work order to attach the file to.

Example request

{
  "file": {
    "base64Content": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8P...",
    "contentType": "application/pdf"
  },
  "upload": {
    "contentMd5": "1B2M2Y8AsgTpgAmY7PhCfg==",
    "contentType": "application/pdf",
    "fileSizeBytes": 15000000
  },
  "workOrderId": "123456"
}

Response

OK response.

Example response

{
  "data": {
    "id": "0d5f0a5e-9b1a-4e3f-8a7b-2d5c6e9f0a1b",
    "uploadPut": {
      "expiresAtTime": "2024-01-01T13:00:00Z",
      "url": "https://s3.amazonaws.com/bucket/key?signature=abc123"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.