REST API v2.8

Users

Collection of users.
Users are shared between all sites.

Get Users

Endpoint

GET sites/{siteid}/users

Parameters

start

The index of the item to start fromDefault: 0

num

The number of items returnedDefault: 10

fields

Comma separated list of fields to return. Use this to query only the fields you are using.
Default fields:
useridemailnamefirstnamelastcompanydatecreateddatemodified

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an envelope with items of type user.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/users.json?num=2

Response

{ "totalcount": 664, "items": [ { "userid": "{102DC4AA-2C19-3177-6AB2-435CB3A46499}", "email": "steve.smith@example.com", "namefirst": "Steve", "namelast": "Smith", "company": "Acme Inc.", "datecreated": 1462874210, "datemodified": 1462874210 }, { "userid": "{106BCAF2-7731-26CB-1FC6-7F0182FC31C7}", "email": "anna.wilson@example.com", "namefirst": "Anna", "namelast": "Wilson", "company": "Example Inc.", "datecreated": 1462874179, "datemodified": 1462874179 } ] }

Add User

Endpoint

POST sites/{siteid}/users

Request body

See user for fields.
Required fields:
email

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns userid if successful.

Example

Request

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/users.json { "email": "laura.smith@example.com", "namefirst": "Laura", "namelast": "Smith" }

Response

"{790BE006-62A3-39F6-668A-6DCE01E953E7}"

Get User

Endpoint

GET sites/{siteid}/users/{userid}

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an item of type user.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/users/{102DC4AA-2C19-3177-6AB2-435CB3A46499}.json

Response

{ "userid": "{102DC4AA-2C19-3177-6AB2-435CB3A46499}", "email": "steve.smith@example.com", "namefirst": "Steve", "namelast": "Smith", "personalid": "", "company": "Acme Inc.", "department": "", "companyid": "", "address": "", "address2": "", "zip": "", "city": "Townsville", "state": "", "countryid": "se", "phone": "", "mobile": "", "notes": "", "datecreated": 1462874210, "datemodified": 1462874210, "pricelistid": 1 }

Update User

Endpoint

PUT sites/{siteid}/users/{userid}

Request body

See user for fields.

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns true if successful.

Example

Request

PUT https://api.mysitoo.com/v2/accounts/1500/sites/1/users/{1F842C30-1982-5EB9-7C4F-408FE9546453}.json { "company": "Example Inc." }

Response

true

Delete User

Endpoint

DELETE sites/{siteid}/users/{userid}

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns true if successful.

Example

Request

DELETE https://api.mysitoo.com/v2/accounts/1500/sites/1/users/{1F842C30-1982-5EB9-7C4F-408FE9546453}.json

Response

true