Request Formats

Retrieving Resources with HTTP GET

Example:

GET https://www.ytjobcentre.ca/api/v1.1/positiontypes HTTP/1.1
Host: www.ytjobcentre.ca
Connection: keep-alive
        

You can easily test GET requests by entering the URI in your web browser:

https://www.ytjobcentre.ca/api/v1.1/positiontypes

Creating or Updating Resources with HTTP POST and PUT

To create or update a resource, make an HTTP POST or PUT request with JSON in the body of the request. The JSON format is resource specific and not all resources support POST and PUT, so please refer to the Resources section for more info.

Be sure that the HTTP Content-Type starts with application/json, for example:

application/json; charset=UTF-8

Example:

PUT https://www.ytjobcentre.ca/api/v1.1/jobs/183668 HTTP/1.1
Host: www.ytjobcentre.ca
Content-Length: 31
API-Key: 932d2608-2e18-41f7-bf24-caa922ee9d23
Content-Type: application/json; charset=UTF-8

{"title":"Account Manager"}
        

Deleting Resources with HTTP DELETE

To delete a resource, make an HTTP DELETE request to the resource URI. Not all resources support HTTP DELETE, so please refer to the Resources section for more info.

Example:

DELETE https://www.ytjobcentre.ca/api/v1.1/jobs/183668 HTTP/1.1
Host: www.ytjobcentre.ca
API-Key: 932d2608-2e18-41f7-bf24-caa922ee9d23
        

HTTP Method Overriding

If your HTTP client does not support PUT or DELETE requests, you can use HTTP method overriding. It works as follows:

  • We will look for a X-HTTP-Method-Override parameter in the HTTP header.
  • If the original request is anything other than POST, X-HTTP-Method-Override will be ignored.
  • If the X-HTTP-Method-Override value is PUT or DELETE, that value will be used as the HTTP verb.

Example:

POST https://www.ytjobcentre.ca/api/v1.1/jobs/183668 HTTP/1.1
Host: www.ytjobcentre.ca
X-HTTP-Method-Override: DELETE
API-Key: 932d2608-2e18-41f7-bf24-caa922ee9d23