Syntax

POST /api/suppliers/load/

body = {"data": "suppliers.csv"}

In addition to the csv, this API call also supports xml, xls and xlsx file formats.

Request Parameters

None

Sample Response

Returns a JSON object that contains the status of the upload and how many suppliers were actually uploaded. Example:

{
    "status":"ok",
    "num_rcvd_suppliers":1,
    "job_id":"12589-1c139969442840b48efcdaa918b9d4a8"
}

Response Key/Value Explanations

KeyTypeSample ValueDescription
statusString“ok”File was loaded successfully.
num_rcvd_suppliersNumber1Number of suppliers that were loaded from the provided file.

If the file format is not one of the supported file formats: csv, xml, xls and xlsx, the response object will look like this:

{
    "status":"error",
    "error":"File must be a CSV, XML or XLS/XLSX file"
}

HTTP Response Codes

Status CodeDescription
200 OKSuccess
400 Bad RequestThe request could not be understood by the server due to incorrect syntax.
401 Unauthenticated
The request requires user authentication information. Your API token is missing or invalid.
403 ForbiddenPermission Denied – User does not have permission to perform this request
404 Not FoundThe resource you requested on the server does not exist
500The request has failed due to a temporary failure of the server. You can try this request at a later time.
503The request has failed due to a temporary failure of the server. You can try this request at a later time.

Calling the API