SmarterWX Developer API

General notes

SmarterWX offers application developers the ability to write custom applications that integrate with the SmarterWX Developer API. Below you’ll find tips on how to get started with the API.

The SmarterWX Developer API provides support for these high-level functional areas: -

  • Managing Users
  • Publishing Projects and Exclusion Zones
  • Querying and Retrieving Data

NB SmarterWX also provides an implementation of the GeoServices REST API for integrating data from SmarterWX into web mapping applications. Discussion of the GeoServices REST API is described elsewhere.

Authentication

Applications developed against the SmarterWX API authenticate use the OAuth 2 Client Credentials Grant flow. The application key and application secret can be found in the SmarterWX website. Only an Organisation Administrator will be able to view the key and secret.

The OAuth2 client credentials flow returns an access token. This token should be submitted as a Bearer Authorization header on all requests.

Refer to the documentation for the /v1/oauth2/token endpoint on how to request an access token.

Returning Collections

The GET calls on resource end-points will result in a collection of resources being returned. For example, ‘GET /community/users’ will return a collection of users. This section describes how to filter the collection, select fields to return and manage paging of large collections.

Filtering the Collection

Specify a set of query filters to return only matching items from the collection.

  • ?firstName=Gar% - Return only the resources with firstName starting with Gar.
  • ?role=ORGPUBLISHER,ORGUSER - Return only the resources with a role of either ORGPUBLISHER or ORGUSER.
  • ?organisation=12 - Return only the resources with an organisation id of 12.

Multiple query filters can be included in the query string.

Details of the available filters is given within the definition for each resource.

Sorting the Collection

Specify the order of resources returned in the collection. * ?sort=lastName,firstName - Describes the sort order for resources returned in the collection. A comma separated list can be used to sort by more than one attribute (the first item has the highest sort precedence). * ?sort=-created_at - Prefix an attribute name with a hyphen to reverse the sort order.

Details of the available sort fields is given within the definition for each resource.

Result Paging

Operations that return a collection may be limited to maximum number of records. In this case the following headers will be set on the HTTP response: -

  • X-Result-Total-Count - The total number of records available.
  • X-Result-Page-Limit - The maximum number of records that could be returned in this response.
  • X-Result-Start-Offset - The record index of the first record returned in this response.

The API call may include query parameters to select the maximum number of records and the first record to return.

  • ?limit=10 - Return at most 10 records (some operations will have a maximum limit above which you cannot go).
  • ?offset=10 - The record index of the first record to return (zero-based).

Selecting Fields and Related Resources to Return

To reduce the data size returned for collection queries, the API request must include details of the fields and related resources to be returned with each resource in the collection.

  • ?fields=firstName,lastName,email - Indicates which fields on the resource should be returned. Use the special case of ?fields=* to return all available fields.
  • includes=Organisation - Indicates which related resources of the resource should be returned. Use the special case of ?includes=* to return all available related resources.

Details of the available fields and related resources is given within the definition of each resource.

Error Codes

  • 200 - OK
  • 201 - OK. New resource created.
  • 400 - Error. Problem with request data or attempting an operation on a resource that is not in the correct state.
  • 403 - Forbidden. Either you are not authenticated or you are not authorised for this operation.
  • 404 - The resource is not found.
  • 5xx - An error occurred on the server. Your request could not be completed at this time.

API detail

Authentication

All requests to the SmarterWX Developer API must include a Bearer Authorization header containing an access token. To request an access token the SmarterWX Developer API uses the OAuth2 “Client Credentials” grant flow.

Application access tokens are used to make requests to the SmarterWX Developer API on behalf of an application rather than a user.

Request a token by using the /oauth2/token endpoint passing in the Client ID and Client Secret found in the Organisation Profile on the SmarterWX website.

Note: Some user data that would normally be recorded when requests when made by a user through the SmarterWX website will not be recorded when using an application access token.

GET /oauth2/token

Application access tokens provide access to SmarterWX on behalf of your organisation. Keep the tokens, client id and client secret secure. Use the SmarterWX Organisation Profile to invalidate your secret and create a new one if required.

The token returned by this call should be passed to all other API calls as a Bearer Authorization header. You should check the expiry of the token and request a new token if necessary.

curl -X GET "https://api.smarterwx.com.au/v1/oauth2/token?grant_type=client_credentials&client_id=848a8254db291caa23f8&client_secret=66aceace519f038754e9374cf7570ddf"
GET /v1/oauth2/token?grant_type=client_credentials&client_id=848a8254db291caa23f8&client_secret=66aceace519f038754e9374cf7570ddf HTTP/1.1
Host: api.smarterwx.com.au
Status200
{
    "access_token": "J-S0KLOl5_8UIqzZfmjPp6KQQeN5rnDRxRKB73n7B2hxuuI6Fe-LoBskkptfGOMlqfFCoGRwF9n0h3tOd21lMyB9g..",
    "expires_at": 1516150671290
}

Publishing Data

Publishing data follows a workflow including multiple sequential API requests. These requests create a WORKSPACE resource to represent the overall publishing unit, and an UPLOAD resource representing each of the projects and exclusion zones.

There are multiple ways to publish data through the SmarterWX Developer API.

  • Uploading spatial data files.
  • Calling the API to create the projects and exclusion zones.
  • Triggering a Live Connect Sync operation (where the configuration has previously been configured through the SmarterWX web site).
  • Cloning and modifying the contents of the existing published workspace.

The following diagram shows the sequence of API calls required to publish a new workspace using spatial data fies.

Upload Publishing Workflow

Files uploaded through the SmarterWX Developer API must always first be uploaded to an AWS S3 location and then the reference to this location passed to the relevant API call. (For example, in the above diagram the application requests a location from /system/uploads, uploads the file to the given S3 location, and finally passes the upload key to the /workspaces/{wsid}/projects API call.)

More details on working with the publishing API is provided in each of the /workspaces REST calls detailed below.

Within a workspace, the projects and exclusion zones are refered to as Staged Projects and Staged Exclusion Zones, meaning that they are loaded and part of the workspace but are not yet live. Staged resources can be edited, deleted and added to through the /workspaces/{id}/projects and /workspaces/{id}/exclusionzones resources.

GET /workspaces

Returns a collection of workspace resources based on the query parameters provided. See general discussion on working with collections in the SmarterWX Developer API overview.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces?offset=0&limit=20&fields=*&sort=-created_at&name=LC%&status=draft&owner=19"
GET /v1/workspaces?offset=0&limit=20&fields=*&sort=-created_at&name=LC%&status=draft&owner=19 HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
[
    {
        "id": 30,
        "name": "23rd May 2017 @ 10:47",
        "status": "live",
        "rules": {
            "opportunity": {
                "timeBuffer": {
                    "after": 730,
                    "before": 730
                },
                "distanceBuffer": 20,
                "createForSameOwner": true,
                "createForSameOrganisation": true
            },
            "exclusionZoneConflict": {
                "timeBuffer": {
                    "after": 60,
                    "before": 60
                },
                "distanceBuffer": 50,
                "createForSameOwner": true,
                "createForSameOrganisation": true
            }
        },
        "updated_at": "2017-05-23T03:18:35.790Z",
        "created_at": "2017-05-23T00:47:55.048Z",
        "ProjectsUpload": {
            "id": 72,
            "format": "SHP",
            "filename": "Project.zip",
            "isProcessed": false,
            "isValid": false,
            "errors": null
        },
        "ExclusionZonesUpload": {
            "id": 73,
            "format": null,
            "filename": null,
            "isProcessed": false,
            "isValid": false,
            "errors": null
        },
        "Owner": {
            "fullName": "Andy Murray",
            "avatar": "/v1/community/users/47/avatar",
            "id": 47,
            "firstName": "Andy",
            "lastName": "Murray"
        }
    }
]

POST /workspaces

Creates a new “empty workspace”. Use this placeholder to then add projects or upload data files. See the publishing workflow described in the Publishing Data section for more information.

The name given to your workspace must be unique. An error will be returned for a duplicate name within your organisation.

curl -X POST -H "X-Requested-With: XmlHttpRequest" -H "Content-Type: application/json" -d '{
	"name":"My New Workspace"
}' "https://api.smarterwx.com.au/v1/workspaces"
POST /v1/workspaces HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Content-Type: application/json

{
	"name":"My New Workspace"
}

GET /workspaces/:wsid

Returns the specified workspace resource.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces/{id}"
GET /v1/workspaces/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status403
{
    "id": 19,
    "name": "19th January 2018 @ 13:22",
    "status": "private",
    "rules": {
        "opportunity": {
            "timeBuffer": {
                "after": 730,
                "before": 730
            },
            "distanceBuffer": 20,
            "createForSameOwner": false,
            "createForSameOrganisation": false
        },
        "exclusionZoneConflict": {
            "timeBuffer": {
                "after": 60,
                "before": 60
            },
            "distanceBuffer": 50,
            "createForSameOwner": false,
            "createForSameOrganisation": false
        }
    },
    "updated_at": "2018-01-19T02:23:37.684Z",
    "Owner": {
        "fullName": "Geoffrey Chaucer",
        "avatar": "/v1/community/users/4/avatar",
        "id": 4,
        "firstName": "Geoffrey",
        "lastName": "Chaucer",
        "isDisabled": false
    },
    "ProjectsUpload": null,
    "ExclusionZonesUpload": null
}

DELETE /workspaces/{id}

Delete a workspace resource based on the provided workspace id.

A workspace cannot be deleted if it is the current live workspace for your organisation. Before deleting a live workspace it will first need to be unpublished.

curl -X DELETE -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces/{id}"
DELETE /v1/workspaces/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200

PUT /workspaces/{id}

Updates a workspace resource based on the provided id.

There are two types of workspace update - an update to the attributes (name and rules) and an update to the published state of the workspace. Only one of these can occur on any update operation. For example, the workspace name cannot be changed in the same operation as the workspace is published to live.

Use the special isPublished attribute (true or false) to cause the workspace to be published (true) or unpublished (false). Note tht unpublishing removes all of your live data - this will include removing all opportunities and conflicts that exist between your organisation and any other organisation. The response object when publishing or unpublishing a workspace will be a SystemJob resource. Poll this job to monitor the status of the publishing operation.

curl -X PUT -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "X-Requested-With: XmlHttpRequest" -H "Content-Type: application/json" "https://api.smarterwx.com.au/v1/workspaces/{id}"
PUT /v1/workspaces/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Content-Type: application/json
Status200
Status200
{
    "id": 12441,
    "status": "created",
    "jobType": "publish-workspace",
    "awsMessageId": "3d0970f5-86d1-5b61-a21a-217c7300c27c",
    "jobData": {
        "notificationType": "publish-workspace",
        "workspace": {
            "id": 19
        }
    },
    "result": null,
    "runCount": 1,
    "deferredUntil": null,
    "created_at": "2017-05-08T04:26:56.797Z",
    "updated_at": "2017-05-08T04:26:57.492Z",
    "user_id": 19
}

GET /workspaces/{id}/projects

Retrieve collection of staged project resources for a workspace.

When a workspace is created and project data is uploaded or added to the workspace these projects are classified as Staged Projects. This means that it belongs to the workspace but is not necessarily published. When a workspace is published, the staged projects are copied to the live dataset. (Live projects can be retrieved using the /projects end point.)

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces/{id}/projects?sort=id&offset=0&limit=20&fields=*&returnGeometry=false&returnCentroid=true&f=arcgis&text=abc&extent={ xmin: 0, xmax: 0, ymin: 0, ymax: 0 }&format=SHP&includes=PrimaryContact&primaryContact=19&status=CONFIRMED,CONSTRUCTION&worksClassification=WATER,ROAD&persistentId=ABC.001-A&startBefore=2018-06-30&startAfter=2017-12-18&endBefore=2018-12-31&endAfter=2018-01-01"
GET /v1/workspaces/%7Bid%7D/projects?sort=id&offset=0&limit=20&fields=*&returnGeometry=false&returnCentroid=true&f=arcgis&text=abc&extent={ xmin: 0, xmax: 0, ymin: 0, ymax: 0 }&format=SHP&includes=PrimaryContact&primaryContact=19&status=CONFIRMED,CONSTRUCTION&worksClassification=WATER,ROAD&persistentId=ABC.001-A&startBefore=2018-06-30&startAfter=2017-12-18&endBefore=2018-12-31&endAfter=2018-01-01 HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
[
    {
        "type": "StagedProject",
        "id": 1304,
        "source": "UPLOAD",
        "notes": "Civic Tower - Fire Pump Replacement",
        "locality": "BANKSTOWN",
        "persistentId": "XAB.18184",
        "startDate": "2017-07-01T00:00:00.000Z",
        "endDate": "2018-06-30T00:00:00.000Z",
        "status": "CONFIRMED",
        "worksClassification": "STRUCTURES",
        "primary_contact_id": 4,
        "created_at": "2017-08-09T11:04:32.005Z",
        "PrimaryContact": {
            "fullName": "Geoffrey Chaucer",
            "avatar": "/v1/community/users/4/avatar",
            "id": 4,
            "firstName": "Geoffrey",
            "lastName": "Chaucer",
            "isDisabled": false
        },
        "geometry": {
            "rings": [
                [
                    [
                        151.03613143611454,
                        -33.91487285274946
                    ],
                    [
                        151.03632909687892,
                        -33.914863654828295
                    ],
                    [
                        151.0363350649799,
                        -33.91484842376798
                    ],
                    [
                        151.0361376008583,
                        -33.91492677193255
                    ],
                    [
                        151.03613143611454,
                        -33.91487285274946
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        }
    }
]

GET /workspaces/{id}/projects/{id}

Retrieves an individual staged project resource from a workspace.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces/{id}/projects/{id}?returnGeometry=true&f=arcgis"
GET /v1/workspaces/%7Bid%7D/projects/%7Bid%7D?returnGeometry=true&f=arcgis HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
{
    "type": "StagedProject",
    "id": 1304,
    "source": "UPLOAD",
    "notes": "Civic Tower - Fire Pump Replacement",
    "locality": "BANKSTOWN",
    "persistentId": "XAB.18184",
    "startDate": "2017-07-01T00:00:00.000Z",
    "endDate": "2018-06-30T00:00:00.000Z",
    "status": "CONFIRMED",
    "worksClassification": "STRUCTURES",
    "primary_contact_id": 4,
    "created_at": "2017-08-09T11:04:32.005Z",
    "PrimaryContact": {
        "fullName": "Geoffrey Chaucer",
        "avatar": "/v1/community/users/4/avatar",
        "id": 4,
        "firstName": "Geoffrey",
        "lastName": "Chaucer",
        "isDisabled": false
    },
    "geometry": {
        "rings": [
            [
                [
                    151.03613143611454,
                    -33.91487285274946
                ],
                [
                    151.03632909687892,
                    -33.914863654828295
                ],
                [
                    151.0363350649799,
                    -33.91484842376798
                ],
                [
                    151.0361376008583,
                    -33.91492677193255
                ],
                [
                    151.03613143611454,
                    -33.91487285274946
                ]
            ]
        ],
        "spatialReference": {
            "wkid": 4326
        }
    }
}

POST /workspaces/{id}/projects

Add staged projects to a workspace.

Staged projects can be added in one of four ways. Each will match a different use case and business workflow. These are described below. At the completion of this step you will have an editable set of staged projects ready to be published.

Strict validation rules apply to projects. For example, the geometry of the project must be within your organisation’s area of operation, and the start date must be before the end date. Errors and warnings are returned when adding projects. An error indicates the project could not be added; warnings are for information but will allow the project to be added. An example of a warning is a mismatch between a project status and dates (e.g. if status is under CONSTRUCTION but start date is still in the future).

  1. Create an empty staged projects collection for editing. To create an empty set, submit a body of { "processingType": "EMPTY" }.
  2. Create a copy of the current live projects for editing. To create a copy of the current live projects in your workspace, submit a body of { "processingType": "CARRYFORWARD" }.
  3. Add projects from a spatial data file. First request a /system/uploads location and upload the file, then submit a body of { "processingType": "REPLACE" } or { "processingType": "APPEND" } including the key for the file location. See example for more fields.
  4. Add projects individually. Use the /workspace/{id}/projects endpoint to add an individual project. You must have created a staged projects collection using one of the above three methods before attempting to add projects individually. See examples.

Note - for methods 1, 2 and 3 above, the returned resource will be a SystemJob tracking the progress of the operation. Poll the /system/jobs endpoint to get an update on the job status.

curl -X POST -H "X-Requested-With: XmlHttpRequest" -H "Content-Type: application/json" -d '{
	"processingType": "REPLACE",
	"format": "SHP",
	"originalname": "Friendly Filename.shp.zip",
	"contentType": "application/zip",
	"S3FileKey": "123145asdasdf45sad/sadf3254asfd"
}' "https://api.smarterwx.com.au/v1/workspaces/{id}/projects"
POST /v1/workspaces/%7Bid%7D/projects HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Content-Type: application/json

{
	"processingType": "REPLACE",
	"format": "SHP",
	"originalname": "Friendly Filename.shp.zip",
	"contentType": "application/zip",
	"S3FileKey": "123145asdasdf45sad/sadf3254asfd"
}
Status200
{
    "status": "created",
    "jobType": "process-projects-upload",
    "jobData": {
        "notificationType": "process-projects-upload",
        "workspace": {
            "id": "19"
        },
        "upload": {
            "id": 145
        }
    },
    "result": {},
    "user_id": 12
}
Status200
{
    "status": "created",
    "jobType": "process-projects-upload",
    "jobData": {
        "notificationType": "process-projects-upload",
        "workspace": {
            "id": "19"
        },
        "upload": {
            "id": 145
        }
    },
    "result": {},
    "user_id": 12
}
Status200
{
    "status": "created",
    "jobType": "process-projects-upload",
    "jobData": {
        "notificationType": "process-projects-upload",
        "workspace": {
            "id": "19"
        },
        "upload": {
            "id": 145
        }
    },
    "result": {},
    "user_id": 12
}
Status200
{
    "type": "StagedProject",
    "id": 16669,
    "source": "APPLICATION_API",
    "notes": "AAZZ-11",
    "locality": "Granville",
    "persistentId": "AAZZ-4121",
    "startDate": "2018-01-01T00:00:00.000Z",
    "endDate": "2018-06-01T00:00:00.000Z",
    "status": "CONFIRMED",
    "worksClassification": "WATER",
    "primary_contact_id": 19,
    "created_at": "2018-01-22T00:26:21.662Z",
    "shape": {
        "type": "MultiPolygon",
        "coordinates": [
            [
                [
                    [
                        151.1793878674507,
                        -33.888673087177104
                    ],
                    [
                        151.18019253015515,
                        -33.888673087177104
                    ],
                    [
                        151.18019253015515,
                        -33.888372500759274
                    ],
                    [
                        151.1793878674507,
                        -33.888372500759274
                    ],
                    [
                        151.1793878674507,
                        -33.888673087177104
                    ]
                ]
            ]
        ]
    },
    "PrimaryContact": {
        "fullName": "Sydney Water-Admin",
        "id": 19,
        "firstName": "Sydney",
        "lastName": "Water-Admin",
        "isDisabled": false
    },
    "CustomFieldValues": [
        {
            "id": 47,
            "sequence": 0,
            "value": "ddd"
        }
    ],
    "warnings": [
        "Start Date is incompatible with Status (CONFIRMED)"
    ]
}

DELETE /workspaces/{id}/projects/{id}

Delete staged project from workspace.

curl -X DELETE -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces/{id}/projects/{id}"
DELETE /v1/workspaces/%7Bid%7D/projects/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200

PUT /workspaces/{id}/projects/{id}

Updates the attributes for a staged project.

curl -X PUT -H "Content-Type: application/json" -d '{
    "notes": "Rosemont Street from Hillcrest St to The Boulevarde - Road Resurfacing",
    "locality": "PUNCHBOWL",
    "startDate": "2017-07-01T00:00:00.000Z",
    "endDate": "2018-06-30T00:00:00.000Z",
    "status": "CONFIRMED",
    "worksClassification": "ROAD RESURFACING",
    "primary_contact_id": 4,
    "CustomFieldValues": [],
    "shape": {
        "rings": [
            [
                [
                    151.0618648185771,
                    -33.92703866896214
                ],
                [
                    151.06177717814532,
                    -33.92707632486698
                ],
                [
                    151.0615040327883,
                    -33.926601338395926
                ],

                [
                    151.06109628086764,
                    -33.925454039603714
                ],
                [
                    151.06115421295596,
                    -33.925554389553206
                ],
                [
                    151.06121248662296,
                    -33.925655376050905
                ],
                [
                    151.06198146409653,
                    -33.92698848686364
                ],
                [
                    151.0618648185771,
                    -33.92703866896214
                ]
            ]
        ],
        "spatialReference": {
            "wkid": 4326
        }
    }
}' "https://api.smarterwx.com.au/v1/workspaces/{id}/projects/{id}"
PUT /v1/workspaces/%7Bid%7D/projects/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
Content-Type: application/json

{
    "notes": "Rosemont Street from Hillcrest St to The Boulevarde - Road Resurfacing",
    "locality": "PUNCHBOWL",
    "startDate": "2017-07-01T00:00:00.000Z",
    "endDate": "2018-06-30T00:00:00.000Z",
    "status": "CONFIRMED",
    "worksClassification": "ROAD RESURFACING",
    "primary_contact_id": 4,
    "CustomFieldValues": [],
    "shape": {
        "rings": [
            [
                [
                    151.0618648185771,
                    -33.92703866896214
                ],
                [
                    151.06177717814532,
                    -33.92707632486698
                ],
                [
                    151.0615040327883,
                    -33.926601338395926
                ],

                [
                    151.06109628086764,
                    -33.925454039603714
                ],
                [
                    151.06115421295596,
                    -33.925554389553206
                ],
                [
                    151.06121248662296,
                    -33.925655376050905
                ],
                [
                    151.06198146409653,
                    -33.92698848686364
                ],
                [
                    151.0618648185771,
                    -33.92703866896214
                ]
            ]
        ],
        "spatialReference": {
            "wkid": 4326
        }
    }
}
Status200
{
    "type": "StagedProject",
    "id": 19,
    "shape": {
        "type": "MultiPolygon",
        "coordinates": [
            [
                [
                    [
                        151.0618648185771,
                        -33.92703866896214
                    ],
                    [
                        151.06177717814532,
                        -33.92707632486698
                    ],
                    [
                        151.06198146409653,
                        -33.92698848686364
                    ],
                    [
                        151.0618648185771,
                        -33.92703866896214
                    ]
                ]
            ]
        ]
    },
    "locality": "PUNCHBOWL",
    "notes": "Rosemont Street from Hillcrest St to The Boulevarde - Road Resurfacing",
    "persistentId": "XRS.18163",
    "startDate": "2017-07-01T00:00:00.000Z",
    "endDate": "2018-06-30T00:00:00.000Z",
    "status": "CONFIRMED",
    "worksClassification": "ROAD RESURFACING",
    "isPrivate": false,
    "created_at": "2017-08-09T11:04:32.005Z",
    "updated_at": "2018-01-21T00:48:30.109Z",
    "organisation_id": 2,
    "primary_contact_id": 4,
    "upload_id": 143,
    "CustomFieldValues": [],
    "isEdited": true
}

GET /workspaces/{id}/exclusionzones

Retrieve collection of staged exclusion zone resources for a workspace. When a workspace is created and exclusion zone data is uploaded or added to the workspace these exclusion zones are classified as Staged Exclusion Zones. This means that it belongs to the workspace but is not necessarily published. When a workspace is published, the staged exclusion zones are copied to the live dataset. (Live exclusion zones can be retrieved using the /exclusionzones end point.)

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces/{id}/exclusionzones?sort=id&limit=20&offset=0&returnGeometry=true&returnCentroid=false&f=arcgis&format=SHP&fields=*&extent={ xmin: 0, xmax: 0, ymin: 0, ymax: 0 }&text=abc&primaryContact=19&persistentId=ABC.EX.0091-a&startBefore=2018-09-30&startAfter=2017-12-31&endBefore=2018-12-31&endAfter=2017-12-31"
GET /v1/workspaces/%7Bid%7D/exclusionzones?sort=id&limit=20&offset=0&returnGeometry=true&returnCentroid=false&f=arcgis&format=SHP&fields=*&extent={ xmin: 0, xmax: 0, ymin: 0, ymax: 0 }&text=abc&primaryContact=19&persistentId=ABC.EX.0091-a&startBefore=2018-09-30&startAfter=2017-12-31&endBefore=2018-12-31&endAfter=2017-12-31 HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
[
    {
        "type": "StagedExclusionZone",
        "id": 5,
        "source": "UPLOAD",
        "notes": "City to Bay Fun Run 2018",
        "locality": "ADELAIDE",
        "persistentId": "2",
        "startDate": "2018-09-15T00:00:00.000Z",
        "endDate": "2018-09-17T00:00:00.000Z",
        "primary_contact_id": 12,
        "created_at": "2017-10-19T21:35:25.863Z",
        "PrimaryContact": {
            "fullName": "David Trengove",
            "avatar": "/v1/community/users/12/avatar",
            "id": 12,
            "firstName": "David",
            "lastName": "Trengove",
            "isDisabled": false
        },
        "geometry": {
            "rings": [
                [
                    [
                        138.52060661481764,
                        -34.98008307479301
                    ],
                    [
                        138.52062470703126,
                        -34.97998046874999
                    ],
                    [
                        138.5206201493572,
                        -34.980032563203274
                    ],
                    [
                        138.52060661481764,
                        -34.98008307479301
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        }
    }
]


GET /workspaces/{id}/exclusionzones/{id}

Retrieves an individual staged exclusion zone resource from a workspace.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces/{id}/exclusionzones/{id}?returnGeometry=true&f=arcgis"
GET /v1/workspaces/%7Bid%7D/exclusionzones/%7Bid%7D?returnGeometry=true&f=arcgis HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
{
    "type": "StagedExclusionZone",
    "id": 19,
    "source": "UPLOAD",
    "notes": "City to Bay Fun Run 2018",
    "locality": "ADELAIDE",
    "persistentId": "2",
    "startDate": "2018-09-15T00:00:00.000Z",
    "endDate": "2018-09-17T00:00:00.000Z",
    "primary_contact_id": 12,
    "created_at": "2017-10-19T21:35:25.863Z",
    "PrimaryContact": {
        "fullName": "David Trengove",
        "avatar": "/v1/community/users/12/avatar",
        "id": 12,
        "firstName": "David",
        "lastName": "Trengove",
        "isDisabled": false
    },
    "geometry": {
        "rings": [
            [
                [
                    138.52060661481764,
                    -34.98008307479301
                ],
                [
                    138.53651350467803,
                    -34.97570248231687
                ],
                [
                    138.52062470703126,
                    -34.97998046874999
                ],
                [
                    138.5206201493572,
                    -34.980032563203274
                ],
                [
                    138.52060661481764,
                    -34.98008307479301
                ]
            ]
        ],
        "spatialReference": {
            "wkid": 4326
        }
    }
}

POST /workspaces/{id}/exclusionzones

Add staged exclusion zones to a workspace.

Staged exclusion zones can be added in one of four ways. Each will match a different use case and business workflow. These are described below. At the completion of this step you will have an editable set of staged exclusion zones ready to be published.

Strict validation rules apply to exclusion zones. For example, the geometry of the exclusion zones must be within your organisation’s area of operation, and the start date must be before the end date. Errors and warnings are returned when adding exclusion zones. An error indicates the exclusion zone could not be added; warnings are for information but will allow the exclusion zone to be added.

  1. Create an empty staged exclusion zones collection for editing. To create an empty set, submit a body of { "processingType": "EMPTY" }.
  2. Create a copy of the current live exclusion zones for editing. To create a copy of the current live exclusion zones in your workspace, submit a body of { "processingType": "CARRYFORWARD" }.
  3. Add exclusion zones from a spatial data file. First request a /system/uploads location and upload the file, then submit a body of { "processingType": "REPLACE" } or { "processingType": "APPEND" } including the key for the file location. See example for more fields.
  4. Add exclusion zones individually. Use the /workspace/{id}/exclusionzones endpoint to add an individual exclusion zone. You must have created a staged exclusion zones collection using one of the prior three methods before attempting to add exclusion zones individually. See examples.

Note - for methods 1, 2 and 3 above, the returned resource will be a SystemJob tracking the progress of the operation. Poll the /system/jobs endpoint to get an update on the job status.

curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "X-Requested-With: XmlHttpRequest" -H "Content-Type: application/json" "https://api.smarterwx.com.au/v1/workspaces/{id}/exclusionzones"
POST /v1/workspaces/%7Bid%7D/exclusionzones HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Content-Type: application/json
Status200
{
    "status": "created",
    "jobType": "process-projects-upload",
    "jobData": {
        "notificationType": "process-projects-upload",
        "workspace": {
            "id": "19"
        },
        "upload": {
            "id": 145
        }
    },
    "result": {},
    "user_id": 12
}
Status200
{
    "status": "created",
    "jobType": "process-projects-upload",
    "jobData": {
        "notificationType": "process-projects-upload",
        "workspace": {
            "id": "19"
        },
        "upload": {
            "id": 145
        }
    },
    "result": {},
    "user_id": 12
}
Status200
{
    "status": "created",
    "jobType": "process-projects-upload",
    "jobData": {
        "notificationType": "process-projects-upload",
        "workspace": {
            "id": "19"
        },
        "upload": {
            "id": 145
        }
    },
    "result": {},
    "user_id": 12
}
Status200
{
    "type": "StagedExclusionZone",
    "id": 103,
    "source": "APPLICATION_API",
    "notes": "AAZZ-11",
    "locality": "Granville",
    "persistentId": "AAZZ-4121e1",
    "startDate": "2018-01-01T00:00:00.000Z",
    "endDate": "2018-06-01T00:00:00.000Z",
    "primary_contact_id": 19,
    "created_at": "2018-01-22T00:46:23.608Z",
    "shape": {
        "type": "MultiPolygon",
        "coordinates": [
            [
                [
                    [
                        151.1793878674507,
                        -33.888673087177104
                    ],
                    [
                        151.18019253015515,
                        -33.888673087177104
                    ],
                    [
                        151.18019253015515,
                        -33.888372500759274
                    ],
                    [
                        151.1793878674507,
                        -33.888372500759274
                    ],
                    [
                        151.1793878674507,
                        -33.888673087177104
                    ]
                ]
            ]
        ]
    },
    "PrimaryContact": {
        "fullName": "Sydney Water-Admin",
        "avatar": "/v1/community/users/19/avatar",
        "id": 19,
        "firstName": "Sydney",
        "lastName": "Water-Admin",
        "isDisabled": false
    },
    "CustomFieldValues": [
        {
            "id": 149,
            "value": "aaa"
        }
    ]
}

DELETE /workspaces/{id}/exclusionzones/{id}

curl -X DELETE -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces/{id}/exclusionzones/{id}"
DELETE /v1/workspaces/%7Bid%7D/exclusionzones/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200

PUT /workspaces/{id}/exclusionzones/{id}

Update attributes for a staged exclusion zone resource in a workspace.

curl -X PUT -H "X-Requested-With: XmlHttpRequest" -H "Content-Type: application/json" -d '{
    "notes": "City to Bay Fun Run 2018",
    "locality": "ADELAIDE",
    "startDate": "2018-09-15T00:00:00.000Z",
    "endDate": "2018-09-17T00:00:00.000Z",
    "primary_contact_id": 12,
    "shape": {
        "rings": [[[138.52060661481764, -34.98008307479301], [138.52058451465243, -34.980130468749955], [138.52055452036413, -34.9801733050329], [138.52060661481764, -34.98008307479301]]],
        "spatialReference": {
            "wkid": 4326
        }
    }
}

' "https://api.smarterwx.com.au/v1/workspaces/{id}/exclusionzones/{id}"
PUT /v1/workspaces/%7Bid%7D/exclusionzones/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Content-Type: application/json

{
    "notes": "City to Bay Fun Run 2018",
    "locality": "ADELAIDE",
    "startDate": "2018-09-15T00:00:00.000Z",
    "endDate": "2018-09-17T00:00:00.000Z",
    "primary_contact_id": 12,
    "shape": {
        "rings": [[[138.52060661481764, -34.98008307479301], [138.52058451465243, -34.980130468749955], [138.52055452036413, -34.9801733050329], [138.52060661481764, -34.98008307479301]]],
        "spatialReference": {
            "wkid": 4326
        }
    }
}

Status200
[
    {
        "type": "StagedExclusionZone",
        "id": 19,
        "source": "UPLOAD",
        "notes": "City to Bay Fun Run 2018",
        "locality": "ADELAIDE",
        "persistentId": "2",
        "startDate": "2018-09-15T00:00:00.000Z",
        "endDate": "2018-09-17T00:00:00.000Z",
        "primary_contact_id": 12,
        "created_at": "2017-10-19T21:35:25.863Z",
        "geometry": {
            "rings": [
                [
                    [
                        138.52060661481764,
                        -34.98008307479301
                    ],
                    [
                        138.53655785827797,
                        -34.97569700623398
                    ],
                    [
                        138.53655111789087,
                        -34.97569827435711
                    ],
                    [
                        138.52060661481764,
                        -34.98008307479301
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        }
    }
]

GET /workspaces/syncconfigs

Returns a Live Connect sync configuration resource.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/workspaces/syncconfigs?offset=0&limit=20&fields=*&sort=-created_at&includes=Owner&status=draft&owner=19"
GET /v1/workspaces/syncconfigs?offset=0&limit=20&fields=*&sort=-created_at&includes=Owner&status=draft&owner=19 HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
[
    {
        "id": 19,
        "agsUrl": "http://lea-304863.services.esriaustralia.com.au:6080/arcgis/rest/services",
        "status": "live",
        "projectsService": "live_projects",
        "exclusionsService": null,
        "name": "my live config"
    }
]

PUT /workspaces/syncconfigs/{id}

Initiates an immediate Live Connect sync operation for the given sync config. The selected Live Connect configuration must have been setup through the SmarterWX website and have a status of live.

Pass a JSON body with the value of shouldSyncNow set to true.

curl -X PUT -H "X-Requested-With: XmlHttpRequest" -H "Content-Type: application/json" -d '{
	"shouldSyncNow": true
}' "https://api.smarterwx.com.au/v1/workspaces/syncconfigs/{id}"
PUT /v1/workspaces/syncconfigs/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Content-Type: application/json

{
	"shouldSyncNow": true
}
Status200
{
    "id": 12441,
    "status": "created",
    "jobType": "initiate-live-sync",
    "awsMessageId": "3d0970f5-86d1-5b61-a21a-217c7300c27c",
    "jobData": {
        "notificationType": "initiate-live-sync",
        "syncConfiguration": {
            "id": 19
        }
    },
    "result": null,
    "runCount": 1,
    "deferredUntil": null,
    "created_at": "2017-05-08T04:26:56.797Z",
    "updated_at": "2017-05-08T04:26:57.492Z",
    "user_id": 15
}

Query and Retrieve

The four main resource types in SmarterWX can be discovered using search operations. The SmarterWX Developer API is read-only for these features. To create new projects or exclusion zones for publishing refer to the Workspace Publishing section of the API.

  • Project - Represents a capital works project.
  • Exclusion Zone - Represents an area where works cannot be performed during a fixed period (typically things like sporting events or community celebrations).
  • Opportunity - Where two projects may provide an opportunity to collaborate or re-schedule to reduce costs or disruption.
  • Exclusion Zone Conflict - Represents a clash betwen a planned Project and an Exclusion Zone.
curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/search"
GET /v1/search HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest

GET /projects

Returns a collection of project resources based on the query parameters provided. See general discussion on working with collections in the SmarterWX Developer API overview.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/projects?fields=startDate,endDate&sort=-endDate&includes=CustomFieldValues&offset=0&limit=20&primaryContact=19&status=CURRENT&worksClassification=Water&persistentId=SW.001a&startBefore=2018-06-30&startAfter=2018-01-19&endBefore=2019-03-31&endAfter=2018-11-17&updatedBefore=2018-01-01&updatedAfter=2017-10-23&organisaton=3&returnGeometry=true&returnCentroid=true&f=arcgis"
GET /v1/projects?fields=startDate,endDate&sort=-endDate&includes=CustomFieldValues&offset=0&limit=20&primaryContact=19&status=CURRENT&worksClassification=Water&persistentId=SW.001a&startBefore=2018-06-30&startAfter=2018-01-19&endBefore=2019-03-31&endAfter=2018-11-17&updatedBefore=2018-01-01&updatedAfter=2017-10-23&organisaton=3&returnGeometry=true&returnCentroid=true&f=arcgis HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
[
    {
        "id": 237,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.20546858388525,
            "y": -33.897661765474076,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.20635,
                        -33.89764
                    ],
                    [
                        151.20634,
                        -33.89775
                    ],
                    [
                        151.20458,
                        -33.89768
                    ],
                    [
                        151.20459,
                        -33.89757
                    ],
                    [
                        151.20635,
                        -33.89764
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    },
    {
        "id": 487,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.20752208011993,
            "y": -33.89743191938797,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.20784,
                        -33.89639
                    ],
                    [
                        151.20742,
                        -33.89851
                    ],
                    [
                        151.20721,
                        -33.89848
                    ],
                    [
                        151.20762,
                        -33.89636
                    ],
                    [
                        151.20784,
                        -33.89639
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    },
    {
        "id": 547,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.20630390653452,
            "y": -33.89939347183135,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.20622,
                        -33.89921
                    ],
                    [
                        151.20627,
                        -33.89914
                    ],
                    [
                        151.20628,
                        -33.89871
                    ],
                    [
                        151.20623,
                        -33.8987
                    ],
                    [
                        151.20623,
                        -33.89853
                    ],
                    [
                        151.2065,
                        -33.89859
                    ],
                    [
                        151.20649,
                        -33.89914
                    ],
                    [
                        151.20652,
                        -33.89917
                    ],
                    [
                        151.20648,
                        -33.89925
                    ],
                    [
                        151.2063,
                        -33.90018
                    ],
                    [
                        151.20603,
                        -33.90016
                    ],
                    [
                        151.20622,
                        -33.89921
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    },
    {
        "id": 254,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.2078173354262,
            "y": -33.898258643455684,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.20787,
                        -33.89829
                    ],
                    [
                        151.20747,
                        -33.89824
                    ],
                    [
                        151.20748,
                        -33.89818
                    ],
                    [
                        151.20817,
                        -33.89828
                    ],
                    [
                        151.20815,
                        -33.89833
                    ],
                    [
                        151.20787,
                        -33.89829
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    },
    {
        "id": 571,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.20473799422285,
            "y": -33.89830854910498,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.20466,
                        -33.89822
                    ],
                    [
                        151.20537,
                        -33.89824
                    ],
                    [
                        151.20536,
                        -33.89842
                    ],
                    [
                        151.20413,
                        -33.89838
                    ],
                    [
                        151.20408,
                        -33.8982
                    ],
                    [
                        151.20466,
                        -33.89822
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    },
    {
        "id": 507,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.20774274981034,
            "y": -33.8986480397874,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.20806,
                        -33.89879
                    ],
                    [
                        151.20739,
                        -33.89869
                    ],
                    [
                        151.20742,
                        -33.89851
                    ],
                    [
                        151.2081,
                        -33.8986
                    ],
                    [
                        151.20806,
                        -33.89879
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    },
    {
        "id": 281,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.20724439562247,
            "y": -33.89621348331266,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.2068,
                        -33.89624
                    ],
                    [
                        151.20696,
                        -33.89608
                    ],
                    [
                        151.2076,
                        -33.89616
                    ],
                    [
                        151.20762,
                        -33.89636
                    ],
                    [
                        151.2068,
                        -33.89624
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    },
    {
        "id": 479,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.2052631536889,
            "y": -33.899069891965546,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.20524,
                        -33.89901
                    ],
                    [
                        151.20627,
                        -33.89914
                    ],
                    [
                        151.20622,
                        -33.89921
                    ],
                    [
                        151.20527,
                        -33.89909
                    ],
                    [
                        151.20429,
                        -33.89904
                    ],
                    [
                        151.20427,
                        -33.89896
                    ],
                    [
                        151.20524,
                        -33.89901
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    },
    {
        "id": 1156,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.20832301923411,
            "y": -33.898060842608096,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.20821,
                        -33.89807
                    ],
                    [
                        151.20833,
                        -33.89749
                    ],
                    [
                        151.20855,
                        -33.89752
                    ],
                    [
                        151.20832,
                        -33.89863
                    ],
                    [
                        151.2081,
                        -33.8986
                    ],
                    [
                        151.20821,
                        -33.89807
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    },
    {
        "id": 1269,
        "type": "Project",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 1,
        "centroid": {
            "x": 151.2080060762765,
            "y": -33.899617133876255,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 1,
        "Organisation.type": "Council",
        "geometry": {
            "rings": [
                [
                    [
                        151.20793,
                        -33.89947
                    ],
                    [
                        151.20806,
                        -33.89879
                    ],
                    [
                        151.20828,
                        -33.89882
                    ],
                    [
                        151.20795,
                        -33.90045
                    ],
                    [
                        151.20773,
                        -33.90041
                    ],
                    [
                        151.20793,
                        -33.89947
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 1,
            "type": "Council"
        }
    }
]


GET /projects/{id}

Retrieve a single project resource based on id. The id can be found through the /search or /projects collections.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/projects/{id}"
GET /v1/projects/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
{
    "isDeleted": false,
    "type": "Project",
    "id": 763,
    "locality": "SYDNEY",
    "persistentId": "10112561",
    "primary_contact_id": 47,
    "organisation_id": 9,
    "notes": "50mm AC14 HD",
    "startDate": "2017-07-01T00:00:00.000Z",
    "endDate": "2018-03-31T00:00:00.000Z",
    "status": "PROPOSED",
    "worksClassification": "ROAD RESURFACING",
    "isPrivate": false,
    "updated_at": "2017-05-23T03:18:34.385Z",
    "created_at": "2017-05-23T03:18:34.385Z",
    "deleted_at": null,
    "PrimaryContact": {
        "fullName": "Sidney Poitier",
        "avatar": "/v1/community/users/47/avatar",
        "id": 47,
        "firstName": "Sidney",
        "lastName": "Poitier",
        "email": "sp@smarterwx.com.au",
        "phonePrimary": null
    },
    "Organisation": {
        "avatar": "/v1/organisations/9/avatar",
        "id": 9,
        "name": "Sydney Regional Council",
        "type": "Council"
    },
    "CustomFieldValues": [],
    "Watches": [],
    "Conversations": [],
    "hasOpportunity": false,
    "hasExclusionZoneConflict": false,
    "geometry": {
        "rings": [
            [
                [
                    151.20956252602124,
                    -33.870816017663344
                ],
                [
                    151.20935628253,
                    -33.87081978519001
                ],
                [
                    151.20937679283853,
                    -33.87065484251588
                ],
                [
                    151.20958966430746,
                    -33.8705839111651
                ],
                [
                    151.20964837716127,
                    -33.870636126737146
                ],
                [
                    151.20956252602124,
                    -33.870816017663344
                ]
            ]
        ],
        "spatialReference": {
            "wkid": 4326
        }
    }
}

GET /exclusionzones

Returns a collection of exclusion zone resources based on the query parameters provided. See general discussion on working with collections in the SmarterWX Developer API overview.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "/exclusionzones?fields=startDate,endDate&sort=startDate&includes=PrimaryContact&offset=0&limit=20&returnGeometry=true&returnCentroid=true&f=arcgis&primaryContact=19&persistentId=SW-EX-A451&startBefore=2018-06-30&startAfter=2017-09-01&endBefore=2019-12-31&endAfter=2019-01-01&updatedBefore=2018-01-01&updatedAfter=2017-11-30"
GET /exclusionzones?fields=startDate,endDate&sort=startDate&includes=PrimaryContact&offset=0&limit=20&returnGeometry=true&returnCentroid=true&f=arcgis&primaryContact=19&persistentId=SW-EX-A451&startBefore=2018-06-30&startAfter=2017-09-01&endBefore=2019-12-31&endAfter=2019-01-01&updatedBefore=2018-01-01&updatedAfter=2017-11-30 HTTP/1.1
Host: 
X-Requested-With: XmlHttpRequest
Status200
[
    {
        "id": 1,
        "type": "ExclusionZone",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 3,
        "centroid": {
            "x": 151.20658940354886,
            "y": -33.89707888720473,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 3,
        "Organisation.type": "Water/Sewer",
        "geometry": {
            "rings": [
                [
                    [
                        151.20487,
                        -33.90432
                    ],
                    [
                        151.20523,
                        -33.90347
                    ],
                    [
                        151.20607,
                        -33.90033
                    ],
                    [
                        151.20662,
                        -33.89602
                    ],
                    [
                        151.20543,
                        -33.90352
                    ],
                    [
                        151.20507,
                        -33.9044
                    ],
                    [
                        151.20487,
                        -33.90432
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 3,
            "type": "Water/Sewer"
        }
    },
    {
        "id": 3,
        "type": "ExclusionZone",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 3,
        "centroid": {
            "x": 151.22105198170695,
            "y": -33.89443668028808,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 3,
        "Organisation.type": "Water/Sewer",
        "geometry": {
            "rings": [
                [
                    [
                        151.21542,
                        -33.89179
                    ],
                    [
                        151.21694,
                        -33.89206
                    ],
                    [
                        151.21925,
                        -33.8934
                    ],
                    [
                        151.21542,
                        -33.89179
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 3,
            "type": "Water/Sewer"
        }
    },
    {
        "id": 2,
        "type": "ExclusionZone",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 3,
        "centroid": {
            "x": 151.21570278365647,
            "y": -33.87946486156448,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 3,
        "Organisation.type": "Water/Sewer",
        "geometry": {
            "rings": [
                [
                    [
                        151.21214,
                        -33.87685
                    ],
                    [
                        151.21255,
                        -33.87698
                    ],
                    [
                        151.21751,
                        -33.88089
                    ],
                    [
                        151.21961,
                        -33.88184
                    ],
                    [
                        151.2195,
                        -33.88192
                    ],
                    [
                        151.21745,
                        -33.88099
                    ],
                    [
                        151.21214,
                        -33.87685
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 3,
            "type": "Water/Sewer"
        }
    }
]

GET /exclusionzones/{id}

Retrieve a single exclusion zone resource based on id. The id can be found through the /search or /exclusionzones collections.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/exclusionzones/{id}"
GET /v1/exclusionzones/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
{
    "isDeleted": false,
    "type": "ExclusionZone",
    "id": 19,
    "locality": "SYDNEY",
    "persistentId": "EZ.0012000",
    "primary_contact_id": 468,
    "organisation_id": 20,
    "notes": "Sydney Harbour Bridge",
    "startDate": "2017-12-15T00:00:00.000Z",
    "endDate": "2018-01-02T00:00:00.000Z",
    "isPrivate": false,
    "updated_at": "2017-12-11T15:25:34.467Z",
    "created_at": "2017-12-11T15:25:34.467Z",
    "deleted_at": null,
    "PrimaryContact": {
        "fullName": "Harold Holt",
        "avatar": "/v1/community/users/468/avatar",
        "id": 468,
        "firstName": "Harold",
        "lastName": "Holt",
        "email": "harold@smarterwx.com.au",
        "phonePrimary": null
    },
    "Organisation": {
        "avatar": "/v1/organisations/20/avatar",
        "id": 20,
        "name": "Roads Authority of NSW",
        "type": "Transport"
    },
    "CustomFieldValues": [],
    "Watches": [],
    "Conversations": [],
    "hasOpportunity": false,
    "hasExclusionZoneConflict": false,
    "geometry": {
        "rings": [
            [
                [
                    151.21093601439506,
                    -33.84374450070891
                ],
                [
                    151.21158500764466,
                    -33.843599761092435
                ],
                [
                    151.21191183135352,
                    -33.84451211482934
                ],
                [
                    151.21267146007472,
                    -33.8469379654905
                ],
                [
                    151.21276816400257,
                    -33.847718065131176
                ],
                [
                    151.2127762853387,
                    -33.848425994828006
                ],
                [
                    151.21269304540306,
                    -33.848925127612176
                ],
                [
                    151.21242581165677,
                    -33.84979296646628
                ],
                [
                    151.21180519184279,
                    -33.8510122470899
                ],
                [
                    151.21052028289978,
                    -33.8531252084631
                ],
                [
                    151.20783625088518,
                    -33.8575909808788
                ],
                [
                    151.21132454071983,
                    -33.85033267302663
                ],
                [
                    151.21192416489316,
                    -33.84939992431225
                ],
                [
                    151.21216211099375,
                    -33.84865372534085
                ],
                [
                    151.21220018236977,
                    -33.84761628034232
                ],
                [
                    151.21121032659153,
                    -33.8444563561265
                ],
                [
                    151.21093601439506,
                    -33.84374450070891
                ]
            ]
        ],
        "spatialReference": {
            "wkid": 4326
        }
    }
}

GET /opportunities

Returns a collection of opportunity resources based on the query parameters provided. See general discussion on working with collections in the SmarterWX Developer API overview.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/opportunities?returnGeometry=true&returnCentroid=true&returnChildGeometry=false&f=arcgis&fields=notes,status,updated_at,created_at,linked_project_id&sort=created_at&offset=0&limit=20&status=CURRENT&createdBefore=2018-01-31&createdAfter=2017-12-16&endAfter=2018-03-31&startBefore=2017-12-16"
GET /v1/opportunities?returnGeometry=true&returnCentroid=true&returnChildGeometry=false&f=arcgis&fields=notes,status,updated_at,created_at,linked_project_id&sort=created_at&offset=0&limit=20&status=CURRENT&createdBefore=2018-01-31&createdAfter=2017-12-16&endAfter=2018-03-31&startBefore=2017-12-16 HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
[
    {
        "id": 6412,
        "type": "Opportunity",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 2,
        "centroid": {
            "x": 150.80609317065696,
            "y": -33.96275589552667,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 2,
        "Organisation.type": "Water/Sewer",
        "geometry": {
            "rings": [
                [
                    [
                        150.80599,
                        -33.96273
                    ],
                    [
                        150.80596,
                        -33.96269
                    ],
                    [
                        150.80595,
                        -33.96263
                    ],
                    [
                        150.80632,
                        -33.96289
                    ],
                    [
                        150.80627,
                        -33.96288
                    ],
                    [
                        150.80599,
                        -33.96273
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 2,
            "type": "Water/Sewer"
        }
    },
    {
        "id": 6494,
        "type": "Opportunity",
        "deleted_at": null,
        "isPrivate": false,
        "organisation_id": 2,
        "centroid": {
            "x": 150.81762450332096,
            "y": -33.96859348595476,
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation.id": 2,
        "Organisation.type": "Water/Sewer",
        "geometry": {
            "rings": [
                [
                    [
                        150.81799,
                        -33.96876
                    ],
                    [
                        150.8175,
                        -33.96878
                    ],
                    [
                        150.8173,
                        -33.96849
                    ],
                    [
                        150.81729,
                        -33.96842
                    ],
                    [
                        150.81775,
                        -33.96841
                    ],
                    [
                        150.81799,
                        -33.96876
                    ]
                ]
            ],
            "spatialReference": {
                "wkid": 4326
            }
        },
        "Organisation": {
            "id": 2,
            "type": "Water/Sewer"
        }
    }
]

GET /opportunities/{id}

Retrieve a single opportunity resource based on id. The id can be found through the /search or /opportunities collections.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "/opportunities/{id}"
GET /opportunities/%7Bid%7D HTTP/1.1
Host: 
X-Requested-With: XmlHttpRequest
Status200
{
    "type": "Opportunity",
    "id": 6411,
    "notes": null,
    "status": "Current",
    "updated_at": "2017-11-27T01:22:14.448Z",
    "created_at": "2017-11-27T01:22:14.448Z",
    "MyProject": {
        "isDeleted": false,
        "type": "Project",
        "id": 14760,
        "persistentId": "43081",
        "notes": "20033556 St Marys Wastewater System Augmentation Area 3-G-Infill",
        "locality": "ST MARYS",
        "startDate": "2018-01-01T00:00:00.000Z",
        "endDate": "2018-09-01T00:00:00.000Z",
        "status": "PROPOSED",
        "worksClassification": "SEWERAGE",
        "primary_contact_id": 52,
        "PrimaryContact": {
            "fullName": "John Snow",
            "avatar": "/v1/community/users/52/avatar",
            "id": 52,
            "firstName": "John",
            "lastName": "Snow",
            "email": "john@smarterwx.com.au",
            "phonePrimary": "0288493413"
        },
        "CustomFieldValues": []
    },
    "LinkedProject": {
        "isDeleted": false,
        "type": "Project",
        "id": 14759,
        "persistentId": "43080",
        "notes": "20033556 St Marys Wastewater System Augmentation Area 3-G-Infill",
        "locality": "ST MARYS",
        "startDate": "2018-01-01T00:00:00.000Z",
        "endDate": "2018-09-01T00:00:00.000Z",
        "status": "PROPOSED",
        "worksClassification": "SEWERAGE",
        "Organisation": {
            "avatar": "/v1/organisations/2/avatar",
            "id": 2,
            "name": "Water Is Us",
            "type": "Water/Sewer",
            "isDisabled": false,
            "hasAvatarImage": false,
            "licensedUsers": 120,
            "licenseExpiryDate": "2018-04-17T22:15:07.061Z",
            "authenticationProviderType": null,
            "created_at": "2017-04-17T22:15:07.060Z",
            "updated_at": "2017-04-17T22:15:07.275Z",
            "organisation_group_id": 1,
            "primary_contact_id": 4,
            "live_workspace_id": null,
            "authentication_provider_id": null
        },
        "PrimaryContact": {
            "fullName": "Harry Hydro",
            "avatar": "/v1/community/users/52/avatar",
            "id": 52,
            "firstName": "Harry",
            "lastName": "Hydro",
            "email": "harry@smarterwx.com.au",
            "phonePrimary": "0288493413"
        },
        "CustomFieldValues": []
    },
    "Conversations": [],
    "Comments": [],
    "geometry": {
        "rings": [
            [
                [
                    150.7690415365808,
                    -33.76716924095279
                ],
                [
                    150.7690331468168,
                    -33.76712230794011
                ],
                [
                    150.7690320885643,
                    -33.767104661521024
                ],
                [
                    150.7690325092234,
                    -33.767102276828986
                ],
                [
                    150.76910251508832,
                    -33.7669996440158
                ],
                [
                    150.76911934723492,
                    -33.76698459980299
                ],
                [
                    150.76910166882826,
                    -33.76726359239883
                ],
                [
                    150.76908284288086,
                    -33.76725030149473
                ],
                [
                    150.7690681186541,
                    -33.76723378981434
                ],
                [
                    150.76905826416058,
                    -33.767214918606456
                ],
                [
                    150.7690415365808,
                    -33.76716924095279
                ]
            ]
        ],
        "spatialReference": {
            "wkid": 4326
        }
    }
}

GET /ezconflicts

Returns a collection of exclusion zone conflict resources based on the query parameters provided. See general discussion on working with collections in the SmarterWX Developer API overview.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/ezconflicts?returnGeometry=true&returnCentroid=true&returnChildGeometry=false&f=arcgis&fields=notes,status,myentity&sort=status,-created_at&offset=0&limit=20&owner=19&myentity=ExclusionZone&status=CURRENT&createdBefore=2017-12-01&createdAfter=2018-01-31"
GET /v1/ezconflicts?returnGeometry=true&returnCentroid=true&returnChildGeometry=false&f=arcgis&fields=notes,status,myentity&sort=status,-created_at&offset=0&limit=20&owner=19&myentity=ExclusionZone&status=CURRENT&createdBefore=2017-12-01&createdAfter=2018-01-31 HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
[
    {
        "type": "ExclusionZoneConflict",
        "id": 187,
        "notes": null,
        "created_at": "2017-12-11T15:25:38.538Z",
        "status": "Current",
        "myentity": "Project",
        "deleted_at": null,
        "project_id": 852,
        "exclusion_zone_id": 70,
        "User": {
            "fullName": "Andy Murray",
            "avatar": "/v1/community/users/47/avatar",
            "id": 47,
            "email": "andy@smarterwx.com.au",
            "role": "ORGADMIN",
            "firstName": "Andy",
            "lastName": "Murray",
            "phonePrimary": null,
            "isVerified": true,
            "isBounced": false,
            "isDisabled": false,
            "hasAvatarImage": false,
            "emailPreferences": {
                "aoi": "immediate",
                "watch": "immediate",
                "message": "immediate",
                "ezconflict": "daily-digest",
                "opportunity": "daily-digest"
            },
            "invalidPasswordCount": 0,
            "lastLoggedInAt": "2017-11-20T03:57:52.976Z",
            "created_at": "2017-04-27T23:24:47.735Z",
            "updated_at": "2017-11-20T03:57:52.974Z",
            "organisation_id": 9,
            "Organisation": {
                "avatar": "/v1/organisations/9/avatar",
                "id": 9,
                "name": "Regional Sydney",
                "type": "Council"
            }
        },
        "Project": {
            "isDeleted": false,
            "type": "Project",
            "id": 852,
            "persistentId": "10020675",
            "notes": "50mm AC14",
            "locality": "SYDNEY",
            "startDate": "2017-03-29T00:00:00.000Z",
            "endDate": "2018-03-31T00:00:00.000Z",
            "status": "PROPOSED",
            "worksClassification": "ROAD RESURFACING",
            "deleted_at": null,
            "Organisation": {
                "avatar": "/v1/organisations/9/avatar",
                "id": 9,
                "name": "Sydney Regional Area",
                "type": "Council",
                "isDisabled": false,
                "hasAvatarImage": true,
                "licensedUsers": 25,
                "licenseExpiryDate": "2018-04-27T23:24:47.741Z",
                "authenticationProviderType": null,
                "created_at": "2017-04-27T23:24:47.740Z",
                "updated_at": "2017-05-02T02:52:38.848Z",
                "organisation_group_id": 1,
                "primary_contact_id": 47,
                "live_workspace_id": null,
                "authentication_provider_id": null
            },
            "PrimaryContact": {
                "fullName": "André Aravena",
                "avatar": "/v1/community/users/47/avatar",
                "id": 47,
                "email": "andy@smarterwx.com.au",
                "role": "ORGADMIN",
                "firstName": "Andy",
                "lastName": "Murray",
                "phonePrimary": null,
                "isVerified": true,
                "isBounced": false,
                "isDisabled": false,
                "hasAvatarImage": false,
                "emailPreferences": {
                    "aoi": "immediate",
                    "watch": "immediate",
                    "message": "immediate",
                    "ezconflict": "daily-digest",
                    "opportunity": "daily-digest"
                },
                "invalidPasswordCount": 0,
                "lastLoggedInAt": "2017-11-20T03:57:52.976Z",
                "created_at": "2017-04-27T23:24:47.735Z",
                "updated_at": "2017-11-20T03:57:52.974Z",
                "organisation_id": 9
            }
        },
        "ExclusionZone": {
            "isDeleted": false,
            "type": "ExclusionZone",
            "id": 70,
            "persistentId": "EZ.0012010",
            "notes": "Harbour Tunnels",
            "locality": "MILSONS POINT",
            "startDate": "2017-12-15T00:00:00.000Z",
            "endDate": "2018-01-02T00:00:00.000Z",
            "deleted_at": null,
            "Organisation": {
                "avatar": "/v1/organisations/20/avatar",
                "id": 20,
                "name": "Roads Authority",
                "type": "Transport",
                "isDisabled": false,
                "hasAvatarImage": false,
                "licensedUsers": 25,
                "licenseExpiryDate": "2018-08-15T02:19:37.809Z",
                "authenticationProviderType": null,
                "created_at": "2017-08-15T02:19:37.808Z",
                "updated_at": "2017-12-13T23:51:57.117Z",
                "organisation_group_id": null,
                "primary_contact_id": 457,
                "live_workspace_id": null,
                "authentication_provider_id": null
            },
            "PrimaryContact": {
                "fullName": "Paula Durrant",
                "avatar": "/v1/community/users/468/avatar",
                "id": 468,
                "email": "paula@smarterwx.com.au",
                "role": "ORGUSER",
                "firstName": "Paula",
                "lastName": "Durrant",
                "phonePrimary": null,
                "isVerified": true,
                "isBounced": false,
                "isDisabled": false,
                "hasAvatarImage": false,
                "emailPreferences": {
                    "aoi": "immediate",
                    "watch": "immediate",
                    "message": "immediate",
                    "ezconflict": "daily-digest",
                    "opportunity": "daily-digest"
                },
                "invalidPasswordCount": 0,
                "lastLoggedInAt": null,
                "created_at": "2017-12-11T14:10:58.959Z",
                "updated_at": "2017-12-12T20:51:41.192Z",
                "organisation_id": 20
            }
        }
    }
]

GET /ezconflicts/{id}

Retrieve a single exclusion zone conflict resource based on id. The id can be found through the /search or /ezconflicts collections.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/ezconflicts/{id}"
GET /v1/ezconflicts/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
{
    "type": "ExclusionZoneConflict",
    "id": 19,
    "status": "Current",
    "notes": null,
    "myentity": "ExclusionZone",
    "updated_at": "2017-11-24T03:54:34.954Z",
    "created_at": "2017-11-24T03:54:34.954Z",
    "User": {
        "fullName": "Richard Adams",
        "avatar": "/v1/community/users/5/avatar",
        "firstName": "Richard",
        "lastName": "Adams",
        "id": 5,
        "email": "richard@smarterwx.com.au",
        "phonePrimary": null,
        "Organisation": {
            "avatar": "/v1/organisations/3/avatar",
            "name": "Our Water",
            "type": "Water/Sewer",
            "id": 3
        }
    },
    "Project": {
        "isDeleted": false,
        "type": "Project",
        "id": 310,
        "source": "UPLOAD",
        "locality": "WATERLOO",
        "notes": "Concrete footway, tree surrounds",
        "persistentId": "10040487",
        "startDate": "2017-04-10T00:00:00.000Z",
        "endDate": "2017-05-01T00:00:00.000Z",
        "status": "CONFIRMED",
        "worksClassification": "ROAD RESURFACING",
        "isPrivate": false,
        "created_at": "2017-08-09T23:25:33.866Z",
        "updated_at": "2017-08-09T23:25:33.866Z",
        "primary_contact_id": 3,
        "organisation_id": 1,
        "Organisation": {
            "avatar": "/v1/organisations/1/avatar",
            "name": "Sydney Regional Authority",
            "type": "Council",
            "id": 1
        },
        "PrimaryContact": {
            "fullName": "Sidney Poitier",
            "avatar": "/v1/community/users/3/avatar",
            "firstName": "Sidney",
            "lastName": "Poitier",
            "id": 3,
            "email": "sidney@smarterwx.com.au",
            "phonePrimary": null
        },
        "CustomFieldValues": []
    },
    "ExclusionZone": {
        "isDeleted": false,
        "type": "ExclusionZone",
        "id": 1,
        "source": "UPLOAD",
        "locality": "WATERLOO",
        "notes": "Major Trunk",
        "persistentId": "346456",
        "startDate": "2017-01-11T00:00:00.000Z",
        "endDate": "2017-11-10T00:00:00.000Z",
        "isPrivate": false,
        "created_at": "2017-08-10T23:01:27.242Z",
        "updated_at": "2017-08-10T23:01:27.242Z",
        "deleted_at": null,
        "primary_contact_id": 5,
        "organisation_id": 3,
        "Organisation": {
            "avatar": "/v1/organisations/3/avatar",
            "name": "Our Water",
            "type": "Water/Sewer",
            "id": 3
        },
        "PrimaryContact": {
            "fullName": "Richard Adams",
            "avatar": "/v1/community/users/5/avatar",
            "firstName": "Richard",
            "lastName": "Adams",
            "id": 5,
            "email": "richard@smarterwx.com.au",
            "phonePrimary": null
        },
        "CustomFieldValues": []
    },
    "Conversations": [],
    "geometry": {
        "rings": [
            [
                [
                    151.20580037749474,
                    -33.89818028190774
                ],
                [
                    151.20592838758114,
                    -33.897173538624436
                ],
                [
                    151.20685328004475,
                    -33.89788603113155
                ],
                [
                    151.20580037749474,
                    -33.89818028190774
                ]
            ]
        ],
        "spatialReference": {
            "wkid": 4326
        }
    }
}

User Management

Each organisation has a number of users. The SmarterWX Developer API allows you to manage the users within your organisation, adding, updating and deleting users.

A user can belong to one of three roles:-

  • ORGUSER - Basic User. The lowest level of user. Can search and view projects, exclusion zones, opportunities etc, converse with project owners, and set areas of interest and watches.
  • ORGPUBLISHER - Organisation publisher. Can upload and edit project data and maintain live connect configurations , and perform all operations that a USER can perform.
  • ORGADMIN - Organisation administrator. The highest level of user. Can maintain users, update organisation information, run reports and perform all operations that a PUBLISHER can perform.

Note: An application login through the SmarterWX Developer API has permissions equivalent to an ORGADMIN user.

Projects and exclusion zones belong to a user if they are the project owner. It is not possible to delete or disable a user without first reassigning any owned projects or exclusion zones. An error will be returned in this case.

The maximum number of users allowed is dependent on the organisation’s license type. Any attempt to create more than the maximum number of users will result in a 400 error.

GET /community/users

Returns a list of all user belonging to your organisation. Each user has an id which should be used when performing update and delete operations on the user.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/community/users?fields=lastName,firstName&sort=-lastLoggedInAt&includes=Organisation&offset=0&limit=20&firstName=Gar%&lastName=John%&role=ORGUSER,ORGPUBLISHER&isDisabled=true&isVerified=false&email=gjohn%&organisation=12"
GET /v1/community/users?fields=lastName,firstName&sort=-lastLoggedInAt&includes=Organisation&offset=0&limit=20&firstName=Gar%&lastName=John%&role=ORGUSER,ORGPUBLISHER&isDisabled=true&isVerified=false&email=gjohn%&organisation=12 HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
X-Result-Total-Count2
X-Result-Start-Offset0
X-Result-Page-Limit20
[
    {
        "fullName": "Tom Huang",
        "avatar": "/v1/community/users/6/avatar",
        "id": 6,
        "role": "ORGADMIN",
        "firstName": "Tom",
        "lastName": "Huang",
        "isVerified": true,
        "isDisabled": false,
        "organisation_id": 2,
        "lastLoggedInAt": "2017-08-30T01:10:40.073Z",
        "email": "th@smarterwx.com.au",
        "isBounced": false,
        "phonePrimary": "02 8888 1011"
    },
    {
        "fullName": "Jane Asher",
        "avatar": "/v1/community/users/454/avatar",
        "id": 454,
        "role": "ORGUSER",
        "firstName": "Jane",
        "lastName": "Asher",
        "isVerified": true,
        "isDisabled": false,
        "organisation_id": 2,
        "lastLoggedInAt": "2017-12-13T03:59:00.147Z",
        "email": "ja@smarterwx.com.au",
        "isBounced": false,
        "phonePrimary": null
    }
]

POST /community/users

Creates a new user in your organisation.

There is a maximum number of users available for any organisation based on your license. Any attempt to add users beyond this limit will result in an error. The user’s email address must be unique across all SmarterWX users in all organisations.

curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Content-Type: application/json" -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/community/users"
POST /v1/community/users HTTP/1.1
Host: api.smarterwx.com.au
Content-Type: application/json
X-Requested-With: XmlHttpRequest
Status200
{
    "id": 19,
    "email": "gary@smarterwx.com.au",
    "firstName": "Gary",
    "lastName": "Johnson",
    "role": "ORGUSER",
    "isVerified": false
}

GET /community/users/{id}

Retrieve a single user resource based on user id. The user id can be found through the GET /community/users call to search for user collection.

curl -X GET -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/community/users/{id}"
GET /v1/community/users/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
{
    "id": 19,
    "email": "gary@smarterwx.com.au",
    "role": "ORGUSER",
    "firstName": "Gary",
    "lastName": "Johnson",
    "fullName": "Gary Johnson",
    "avatar": "/v1/community/users/19/avatar",
    "phonePrimary": "0123456789",
    "isBounced": false,
    "organisation_id": 3,
    "lastLoggedInAt": "2018-01-04 10.00.12.000",
    "emailPreferences": {
        "aoi": "immediate",
        "watch": "immediate",
        "message": "immediate",
        "ezconflict": "daily-digest",
        "opportunity": "daily-digest"
    }
}

PUT /community/users/{id}

Update a user resource. The user and id can be found using the GET /community/users request to return user collection.

A number of restrictions apply to user updates. The following list may not be exhaustive - any errors will be returned from the API call including explanatory text.

  • The role cannot be changed for the Organisation’s Primary Contact. Must be ORGADMIN.
  • The email address cannot be changed.
  • The Organisation’s Primary Contact cannot be disabled. You must select an alternate primary contact through the SmarterWX web site.
  • A user cannot be disabled if they are the owner of any projects or exclusion zones. In this case, the special attribute of reassignToUser can be included in the request to change the owner of all objects to the specified user id. (Reassign to user must be an enabled user within your organisation).
  • The isBounced attributes indicates that emails being sent to this user have been returned as bouncing. An update request may only set this value to false.

Available values for the emailPreferences keys are: immediate, daily-digest, weekly-digest, none.

curl -X PUT -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/community/users/{id}"
PUT /v1/community/users/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200
{
    "id": 19,
    "fullName": "Gary Johnson",
    "email": "gary@smarterwx.com.au",
    "role": "ORGPUBLISHER",
    "firstName": "Gary",
    "lastName": "Johnson",
    "phonePrimary": "0123456789",
    "isDisabled": false,
    "isBounced": false,
    "isVerified": true,
    "emailPreferences": {
        "aoi": "immediate",
        "watch": "immediate",
        "message": "immediate",
        "ezconflict": "daily-digest",
        "opportunity": "daily-digest"
    }
}

DELETE /community/users/{id}

Delete a user. The user and id can be found using the GET /community/users request to return user collection.

A number of restrictions apply to user deletion. The following list may not be exhaustive - any errors will be returned from the API call including explanatory text.

  • The Organisation’s Primary Contact cannot be deleted. You must select an alternate primary contact through the SmarterWX web site.
  • A user cannot be deleted if they are the owner of any projects or exclusion zones. In this case, the special attribute of reassignToUser can be included in the request to change the owner of all objects to the specified user id. (Reassign to user must be an enabled user within your organisation).
curl -X DELETE -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/community/users/{id}"
DELETE /v1/community/users/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
X-Requested-With: XmlHttpRequest
Status200

POST /community/users/{id}/avatar

Adds a custom image to user for use as their avatar. The image must be sent as Base-64 Image String. The uploaded image will replace any existing or default image for this user.

The maximum image size is 200KB. Any attempt to upload an image larger than this will fail.

curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Content-Type: application/json" -H "X-Requested-With: XmlHttpRequest" "https://api.smarterwx.com.au/v1/community/users/{id}/avatar"
POST /v1/community/users/%7Bid%7D/avatar HTTP/1.1
Host: api.smarterwx.com.au
Content-Type: application/json
X-Requested-With: XmlHttpRequest
Status200
{
    "id": 19,
    "hasAvatarImage": true,
    "avatar": "/v1/community/users/19/avatar"
}

DELETE /community/users/{id}/avatar

Remove the custom avatar image from the user. The default “initials” avatar will replace the existing custom image.

curl -X DELETE -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" "https://api.smarterwx.com.au/v1/community/users/{id}/avatar"
DELETE /v1/community/users/%7Bid%7D/avatar HTTP/1.1
Host: api.smarterwx.com.au
Status200

Utility Resources

The system endpoints are used to make requests related to system operations separate from the key resources in SmarterWX. These are typically used to request information necessary to populate or track requests.

GET /system/jobs/{id}

The System Job resource represents a job submitted through the SmarterWX Developer API. It provides information about the status of the job and any messages relating to the job’s processing.

Certain calls to the SmarterWX Developer API that result in a potentially long-running activity (such as publishing data) will return a System Job ID. Use the id with this resource to query the status of the job.

curl -X GET "https://api.smarterwx.com.au/v1/system/jobs/{id}"
GET /v1/system/jobs/%7Bid%7D HTTP/1.1
Host: api.smarterwx.com.au
Status200
{
    "status": "completed",
    "jobType": "verify-new-user",
    "jobData": {
        "notificationType": "verify-new-user",
        "user": {
            "id": 51
        }
    },
    "result": {
        "id": 71,
        "awsMessageId": "0101015bc139556a-e3410215-68c3-473d-aefc-1234567890-000000",
        "system_job_id": 101,
        "updated_at": "2017-04-30T23:36:52.062Z",
        "created_at": "2017-04-30T23:36:52.051Z",
        "destination_user_id": 51
    },
    "user_id": 4
}

GET /system/uploads

As a security measure, the SmarterWX Developer API does not allow files to be uploaded directly to the API Server. Instead you must request an upload placeholder from this endpoint and upload the file to the specified location. Once uploaded you can use the key of the upload placeholder to attach your uploaded file to the relevant resource through the API. See the section on uploading data to workspaces for details on how this is used within the publishing workflow.

The information returned from this call is used to upload to a location within AWS S3. For details on how to use the location information, please refer to this article from AWS.

curl -X GET "https://api.smarterwx.com.au/v1/system/uploads"
GET /v1/system/uploads HTTP/1.1
Host: api.smarterwx.com.au
Status200
{
    "url": "smarterwx.s3.amazonaws.com",
    "key": "prd/uploads/a4e95393a50832b499a532cd36f16a90bc9f876546e7123456785fd96c5f",
    "AWSAccessKeyId": "AKIAJQZITKZUNOHE5CMQ",
    "acl": "private",
    "policy": "eyJleHBpcmF0aW9uIjoiMj........ic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjoiMjAxIn1dfQ==",
    "signature": "4tb6ae0JadN4/fyjt....rbi9/c=",
    "success_action_status": "201"
}