File attachment to operation
This endpoint is deprecated.
POST
/api/RPC.common.Api.DocInfo.attachFileToOperation?token=<TOKEN>Parameters
| Field | Type | Description |
|---|---|---|
idrequired | String | Document ID |
numrequired | String | Document # |
typerequired | String | Operation type |
attached_filesrequired | Object | Attached_files object. |
attached_files.file_namerequired | String | File name |
attached_files.file_url | String | File URL |
attached_files.base64_file | String | File |
Request example
Attach File To Operation / File Url:
{
"data" : [
{
"num" : "0000000795",
"type" : "invoice",
"attached_files" : [
{
"file_url" : "https://signs.bg/wp-content/uploads/2022/02/smiley.png",
"file_name" : "smiley.png"
}
]
}
]
}
Attach File To Operation / Base64 File:
{
"data" : [
{
"num" : "0000000795",
"type" : "invoice",
"attached_files" : [
{
"base64_file" : "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAQSURBVHjaYvj//z8DQIABAAj8Av7bok0WAAAAAElFTkSuQmCC",
"file_name" : "small_pics.png"
}
]
}
]
}cURL
Attach File To Operation / File Url:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{ "data" : [ { "num" : "0000000795", "type" : "invoice", "attached_files" : [ { "file_url" : "token=<TOKEN>", "file_name" : "smiley.png" } ] } ]}' "https://<DOMAIN_NAME>/api/RPC.common.Api.DocInfo.attachFileToOperation?token=<TOKEN>"
Attach File To Operation / Base64 File:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -d '{ "data" : [ { "num" : "0000000795", "type" : "invoice", "attached_files" : [ { "base64_file" : "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAQSURBVHjaYvj//z8DQIABAAj8Av7bok0WAAAAAElFTkSuQmCC", "file_name" : "small_pics.png" } ] } ]}' "https://<DOMAIN_NAME>/api/RPC.common.Api.DocInfo.attachFileToOperation?token=<TOKEN>"Response example
HTTP/1.1 200 OK
{
"result" : [
{
"file_path" : "/tmp/filename",
"file_name" : "file_name"
}
]
}