Save goods receipts files
The POST /pic/link/goods-receipts/files
endpoint allows you to save files associated with goods receipts. ππΌπ€
Authorizationβ
This endpoint requires authentication through Basic Auth
with the username and password of the backend that will consume it. To create and configure a backend, follow the backends tutorial
Request parametersβ
- π£ Path
- π Query
- πͺ Body
This request does not contain parameters of type Path
This request does not contain parameters of type Query
JSON Bodyβ
{
"inputs": [
GoodsReceiptFile
]
}
Name | Type | Default | Description |
---|---|---|---|
inputs | Array[ GoodsReceiptFile ] | Required | List of files to save |
GoodsReceiptFile
β
{
"id": str,
"data": str,
"fileType": GoodsReceiptFileType
}
Name | Type | Default | Description |
---|---|---|---|
id | string | Required | Identifier of file |
data | string | Required | Base64 encrypted file |
fileType | GoodsReceipFileType | Required | Type (extension) of the file |
The id
field is used so that you can identify which file corresponds to which key in the response.
GoodsReceiptFileType
β
Possible values: [pdf, jpg, jpeg, png]
Examplesβ
- π₯οΈ cURL
curl --location 'https://<identifier>.api.appliqloud.com/pic/link/goods-receipts/files' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <token>' \
--data '{
"inputs": [
{
"id": "01",
"data": "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mP8z8BQz0AEYBxVSF+FABJADveWkH6oAAAAAElFTkSuQmCC",
"fileType": "jpg"
}
]
}'
Make sure to modify the <identifier>
and <token>
fields with your company identifier and authentication token respectively.
Responsesβ
- β 201
- β οΈ 201 (with errors)
- π 401
- π§ 500
The goods receipt files were successfully saved
{
"success":[
{
"id":"01",
"key":"goods-receipts/d6963433-6d75-4ea6-a7b5-0596546e767f.jpg"
}
],
"errors":[
]
}
There is an error in the request
{
"success": [],
"errors": [
{
"traceId": "3095a0a77f80436ba104eb2fc24ba343"
"cause": "InvalidFileDataException",
"message": "File data is not a valid base64 string"
"context": {
"id": "124"
}
}
]
}
Authorization required or credentials are not correct
{
"traceId": "3095a0a77f80436ba104eb2fc24ba343"
"cause": "UnauthorizedException",
"message": "Authorization required"
}
Internal server error (contact support@appliqloud.com or open a support ticket)
{
"success": [],
"errors": [
{
"traceId": "3095a0a77f80436ba104eb2fc24ba343"
"cause": "InternalServerError",
"message": "Internal Server Error"
}
]
}