Upgrade from v1.0 to v1.1

Everyone should be using version 1.1 of our API. If you are using an older version, please upgrade as soon as possible. API version 1.0 will not be available after April 1, 2018.

Version 1.1 is very similar to 1.0. The minor version bump accounts for small variations outlined below, and in most cases, you will be able to upgrade to version 1.1 without having to change the consuming application.

Empty string to null

v1.0 returned empty string instead of null to indicate no value. This changes with v1.1. Null is the default string value when there is no value to report.

 

Note: This change only affects values that are returned from the API. You are free to continue sending empty string or null and the API will treat them the same.

Example 1: Pagination

v1.0
"paging":{
    "total":25,
    "previous":"",
    "page":1,
    "pages":3,
    "next":"https:\/\/www.newbrunswickjobs.ca\/rest\/v1.0\/jobs?pageSize=10&page=2",
    "pageSize":10
}
            
v1.1
"paging":{
    "total":25,
    "previous":null,
    "page":1,
    "pages":3,
    "next":"https://www.newbrunswickjobs.ca/api/v1.1/jobs?pageSize=10&page=2",
    "pageSize":10
}
            

Example 2: referenceId and applicationUrl in job

v1.0
{
    ...
    "referenceId":"",
    "applicationUrl":"",
    ...
}
            
v1.1
{
    ...
    "referenceId":null,
    "applicationUrl":null,
    ...
}
            

Job duration removal

When v1.0 was first released, the job resource had a duration property. This property was deprecated on 2015-05-15, but v1.0 still returned this property for backwards compatibility. This property is now gone in v1.1. Use the combination of publishDate and closeDate to derive the duration instead.

Location paths replaced with area

In v1.0, the location resource had a paths property, which was an array of arrays. That property has been replaced with area, which is an array of objects.

Example:

v1.0
{
    "id":156,
    "neLatitude":49.309410,
    "swLongitude":-123.268227,
    "paths":[
        [49.234343,-123.267883],
        [49.200929,-123.134274],
        [49.198910,-123.022980],
        [49.294523,-123.022637],
        [49.309410,-123.141312],
        [49.292060,-123.268227]
    ],
    "swLatitude":49.198910,
    "description":"Vancouver, BC",
    "name":"Vancouver",
    "longitude":-123.145264,
    "neLongitude":-123.022637,
    "latitude":49.267239,
    "type":"Town"
}
            
v1.1
{
    "id":156,
    "neLatitude":49.309410,
    "swLongitude":-123.268227,
    "area": [
        { "latitude": 49.234343, "longitude": -123.267883 },
        { "latitude": 49.200929, "longitude": -123.134274 },
        { "latitude": 49.19891, "longitude": -123.02298 },
        { "latitude": 49.294523, "longitude": -123.022637 },
        { "latitude": 49.30941, "longitude": -123.141312 },
        { "latitude": 49.29206, "longitude": -123.268227 }
    ],
    "swLatitude":49.198910,
    "description":"Vancouver, BC",
    "name":"Vancouver",
    "longitude":-123.145264,
    "neLongitude":-123.022637,
    "latitude":49.267239,
    "type":"Town"
}