API

TenderList API

User authentication

Each user in the TenderList app will have unique API token for communication with API. Every request should set header with the API token to properly authenticate user. See examples below.

Export the project to the XML file

GET /api/v1/projects/:id.xml

Example:

curl -H "Authorization: Token token=TOKEN" http://tenderlist.herokuapp.com/api/v1/projects/123.xml

Return:

<?xml version="1.0" encoding="UTF-8"?>... + status 200

Errors:

{"message":"MESSAGE"} + status other than 200


Create new project with data from the XML file

POST /api/v1/projects.json + XML file content in the request body

Example:

curl -X POST -H "Authorization: Token token=TOKEN" -H "Content-Type: application/xml" -d @file.xml http://tenderlist.herokuapp.com/api/v1/projects.json

Return:

{"project_id":123} + status 201

Errors:

{"message":"MESSAGE"} + status other than 201


Update the project with data from the XML file according to the Identification column

PUT /api/v1/projects/:id.json + XML file content in the request body

Example:

curl -X PUT -H "Authorization: Token token=TOKEN" -H "Content-Type: application/xml" -d @file.xml http://tenderlist.herokuapp.com/api/v1/projects/123.json

Return:

{"project_id":123} + status 202

Errors:

{"message":"MESSAGE"} + status other than 202

Tagged: