Get an upload token
getUploadToken starts a binary upload. It returns a token that identifies the upload and a one-time URL to send the file to. Then follow the progress with getUploadStatus.
The method supports trusted mode with i_customer.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_upload_type |
int | yes | What the file contains: 1 routes of a destination set, 2 rates of a tariff. The upload_types dictionary of getDictionary lists the values |
params |
struct | yes | The object to load into: {"i_destination_set": <id>} for routes, {"i_tariff": <id>} for rates |
process_on |
dateTime | no | When to start processing the file, in UTC. Default: now, that is as soon as the file arrives |
expires_on |
dateTime | no | Until when the upload URL accepts the file, in UTC. Default: now plus one day |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
token |
string | Unique token of this upload; pass it to getUploadStatus |
url |
string | Unique URL to POST the file to |
Example
Section titled “Example”Load rates into tariff 12 and process them at night:
from datetime import datetime
call("getUploadToken", { "i_upload_type": 2, "params": {"i_tariff": 12}, "process_on": datetime(2026, 1, 16, 2, 0, 0),}){ "result": "OK", "token": "5f0c2a9e7b1d4c38a6e2f1b0c9d8e7a6", "url": "https://panel.example.com/…", # use exactly as returned}Related
Section titled “Related”- Binary upload: the whole procedure and the file format
- Get the status of an upload
- Tariff rates and destination sets: methods for single rates and routes