Upload file
Description
Uploads a file.
Request URL
Method: POST
https://example.com/api/v1.1/file_upload
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
format | string | "json" | No | Response data format. By default– json |
header | string | "emails.csv" | Yes | File name |
data | string | "data:text/csv;base64,YQpi..." | Yes | base64 encoded file |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"data": "data:text/csv;base64,SEVMTE8K",
"header": "US.csv"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<data>data:text/csv;base64,SEVMTE8K</data>
<header>US.csv</header>
</xml>
Response example
- JSON
- XML
{
"data": {
"file": "fd7006e5-5c42-4eba-aa6a-f6cb7f5cb6f2"
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<file>fd7006e5-5c42-4eba-aa6a-f6cb7f5cb6f2</file>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
file | string | Unique file ID |