API (v1.1)

Requests

The base URL of this api is https://www.vendus.pt/ws/v1.1/

Endpoints

You can see a list of available endpoints on the left side of this page, under "Reference".

To target Account endpoint you use:

https://www.vendus.pt/ws/v1.1/account

To target one item of Account endpoint that has id 123 you use:

https://www.vendus.pt/ws/v1.1/account/123

HTTP Methods/Actions

We use standard HTTP methods to indicate intent of a request:

Each endpoint has a list of allowed methods, than can be one or more of the following:

  • GET - To retrieve a resource or a collection of resources
  • POST - To create a resource
  • PATCH - To modify a resource
  • PUT - To set a resource
  • DELETE - To delete a resource

Params

Preferably, all POST, PUT, PATCH requests should be JSON encoded and with content type of application/json, or the API may return a 415 Unsupported Media Type status code.

$ curl -u api_key: https://www.vendus.pt/ws/v1.1/account/12345 \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -d '{"status":"A"}'

Pagination

Requests for collections can return between 0 and 1000 results, controlled using the per_page and page query parameters. All endpoints are limited to 20 results by default.

GET https://www.vendus.pt/ws/v1.1/account?per_page=15&page=2

Whenever a collection is paged, there will be additional headers sent, X-Paginator-Items and X-Paginator-Pages, containing the count for items and pages respectively.

Sorting

Some endpoints offer result sorting, triggered using the sort query parameter. The value of sort is a comma separated list of fields to sort by. You can specify descending sort by prepending - to a field. Not all fields can be sorted on. The endpoint documentation will list supported sort options.

Limited HTTP Clients

If you have issues on your HTTP client to comply with the above specs, you may overcome them by following these alternatives. This should be a last resource - use it with care.

HTTP Methods/Actions

You may send an action to specify a request method.

$ curl -u api_key: https://www.vendus.pt/ws/v1.1/account/12345?action=PATCH

Params

You may send your params embed in the request.

$ curl -u api_key: https://www.vendus.pt/ws/v1.1/account/12345?status=A