Community
Sending request to create a document with url of photo
Hello,
I'm trying to create a document with 'submitted' state and filled field values.
One of required fields has photo type.
Example of request from https://developers.samsara.com/reference/postdocument
curl --request POST
--url https://api.samsara.com/fleet/documents
--header 'accept: application/json'
--header 'content-type: application/json'
--data '
{
"state": "submitted",
"fields": [
{
"type": "photo",
"value": {
"photoValue": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
}
]
},
"label": "field label"
}
],
"documentTypeId": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"driverId": "45646",
"name": "Dropoff Slip 123",
"routeStopId": "45646"
}
'
When I'm trying to send such request, I get 400 Bad Request.
Error message: "document media field "FIELD LABEL" is required and must contain a value"
I've found out from https://developers.samsara.com/docs/creating-documents#photo-fields
that photos cannot be submitted via the API. The value for a photo field must be left blank.
Is this information up to date? Is there no way to create document with photo value via API?
Thank you in advance,
Viktoriia