Attachments Upload
Upload an attachment
Parameter | Description | Examples |
---|---|---|
API | The API area | expenselines.json |
Action | Update | &action=update |
General | Parameters described in overview | user=user&password=user&version=3.3 |
company: | Company ID | &company=1 |
input: | Base64 | &input={"data":[{"variable_AttachmentBase64":"SEVSRSBJUyBTT01FIFRFWFQNCg==","variable_AttachmentFileName":"Receipt.jpg","expenselines_expenselineinternal":"3398"}]} |
OR | ||
UUID: | Expense Line UUID | &uuid=1234 |
Example request:
Request to upload attachments
http://<SERVER>/jsonapi/expenselines.json?action=update&input={
"data": [
{
"variable_AttachmentBase64": "SEVSRSBJUyBTT01FIFRFWFQNCg==",
"variable_AttachmentFileName": "Receipt.jpg",
"expenselines_expenselineinternal": "3398"
}
]
}&version=3.3&password=user&user=user
Note: Before calling this endpoint you should first ascertain if the Synergist system being accessed is using Amazon S3 to attachment storage. This can be determined by using the System API. If S3 is being used it is not necessary to pass the Base64 string. In this case the response will include the data required to perform a PUT using Amazon's API
Example response:
AMAZON S3
{
"responsecode": 1,
"responsestatus": "OK",
"errorcode": 0,
"errormessage": "",
"responsemessage": "data processed successfully.",
"warningmessage": "",
"success": true,
"data": [
{
"attachmentS3UrlGet": "https://test.com/Receipt_5776.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ7FWVT3VTEABFH7Q%2F20180424%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20180424T092951Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=fb1a23040da16611f25f91308ec00fffc4aa79e3f1a77e07c1ea2aee286870e9",
"attachmentS3UrlPut": "https://test.com/Receipt_5776.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ7FWVT3VTEABFH7Q%2F20180424%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20180424T092951Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=34fab0f843fc50a972590dfee78c4480847af6145ff10be029fdae31986ec878",
"expenselineInternal": 3398,
"expenselineUuid": "6FE77CC7A93FCF4ABF5D8F88A51FDAEB",
"expenselineTimestampModified": 1504866434,
"expenselineRecordVersionNumber": 6
}
]
}
NON-S3
{
"responsecode": 1,
"responsestatus": "OK",
"errorcode": 0,
"errormessage": "",
"responsemessage": "data processed successfully.",
"warningmessage": "",
"success": true,
"data": [
{
"expenselineInternal": 3471,
"expenselineUuid": "DEA70BB37E5A3E4097CECAEAFBE11C18",
"expenselineTimestampModified": 1524654427,
"expenselineRecordVersionNumber": 2
}
]
}