Attachments are binary files, such as photos, that are attached to data points in a session.
Photos are by far the most common type of attachment, but other files may be attached depending on the project.
Attachments can be manipulated downloaded, uploaded (replaced or added) or deleted from a session. Actions that change attachments automatically save the session to reflect the changes to its attachments.
The raw attachment is returned in the response body, with a response Content-Type
set to application/octet-stream
This api call returns a 404 Not Found
error if there is no attachment in the named point.
Param name | Description |
---|---|
project_id required |
The project ID number Validations:
|
session_id required |
The session UUID Validations:
|
id required |
The name of the point containing an attached file to be downloaded. Validations:
|
The raw attachment is uploaded and attached to the session. Any previous value of the session in that point name is replaced. If the previous value was an attachment, then the previous attachment is also deleted from the system.
This api call will accept a standard form upload post (content-type = ‘multipart/form-data’), in which case the attached file is expected to be in a form field named “attachment”.
This api call will also accept a raw upload (content-type = ‘application/octet-stream’). In this case the request body is saved as is into the attachment. To specify a filename for the attachment, use a “filename” query parameter in the request URI.
This api call returns a 400 Bad Request
error if the content type was not recognised or the attachment was not found in the request (eg: incorrect form field name).
On a successful request, this endpoint returns a JSON response with the result set to a hash with the following keys:
These will allow the calling application to determine that the file was indeed delivered and saved correctly.
Param name | Description |
---|---|
project_id required |
The project ID number Validations:
|
session_id required |
The session UUID Validations:
|
id required |
The name of the point containing an attached file. Validations:
|
This api call will remove an attachment from a session. The point value is removed from the session and the attached file is deleted from the system.
This api call returns a 404 Not Found
error if there was no attachment saved in the given point of the session.
A successful request returns a standard JSON response with a result of true
.
Param name | Description |
---|---|
project_id required |
The project ID number Validations:
|
session_id required |
The session UUID Validations:
|
id required |
The name of the point containing an attached file. Validations:
|