Create an attachment
POST/v1/attachments
Make a request to create an attachment
Request
- multipart/form-data
Body
The request body to be sent with this request
- fileAttachment
- urlAttachment
oneOf
file binaryrequired
The file to be uploaded
description string
A description of the attachment
file_url urlrequired
A publicly accessible url to fetch the attachment from
description string
A description of the attachment
Responses
- 201
- 400
- 422
Created
- application/json
- Schema
- Example (from schema)
Schema
attachment object
id integer
The unique identifier for the attachment
description string
The description of the attachment
{
"attachment": {
"id": 1,
"description": "vehicle registration certificate"
}
}
Bad Request
- application/json
- Schema
- Example (from schema)
Schema
error string
{
"error": "The file could not be read from the url"
}
Unprocessable Content
- application/json
- Schema
- Example (from schema)
Schema
message string
errors object
file string[]
description string[]
{
"message": "The given data was invalid",
"errors": {
"file": [
"The file is required"
],
"description": [
"The description must be a string"
]
}
}
Loading...