Authentication

You must authenticate every time you wish to use the Web services.

Authentication uses the HTTP Basic method. Simply provide your username and API key to access the services.

The API key is a unique key that you receive when you create your account. It is completely independent from your password and can be regenerated without having to modify any other account information.

Example

get https://[username]:[api_key]@www.pretnumerique.ca/v1

Unsuccessful response

Code Description
401 Access denied. There is a problem with your username or API key.
{
  "errors": ["access_refused"]
}
<loan>
  <errors>
    <error>access_refused</error>
  </errors>
</loan>
Access denied

Pagination

Query

You can control the selected page by passing the parameter \"page\".

Example

get https://www.pretnumerique.ca/v1/resources.json?page=1

Response

Paginated Web services always include 4 variables in the response header.

  • Number of available items
  • Total number of pages
  • Number of items per page
  • Current page number

Should a page be out of bounds, a 404 error message will be returned.