Contractor members

A contractor member belongs to an organization that is contracted to provide a service. Each member has a profile in OnLocation that includes their contact details, status, access permission dates, and locations.

Use the contractor member API to retrieve your contractor member list, or add, update or delete a member profile.

To manage which organizations a member belongs to, use the contractor membership endpoint.

Learn more about contractor members in the OnLocation Help Center.

List all members

Returns a list of all contractor organization members.

A comma separated list of tag:value search parameters, a colon separator performs an exact match and a percent separator performs a starts-with search.

A contractor member can be matched to an external token which has been assigned to their profile such as RFID card number, a security turnstile controller may search for an account to update the onsite status, eg q=token:C1BB7F.

Request
query Parameters
q
string <string>

Filter by any contractor member value. It is not possible to filter by customfield-elements at this point.

Example: q=name:ACME
order
string <string>

Order by any element returned, prefix with a - to reverse order.

Example: order=-service_provider_id
limit
integer <int32>

Limits the amount of records to return

Example: limit=10
header Parameters
If-Modified-Since
string <int32>

A UTC timestamp (yyyy-mm-ddThh:mm:ss) . Only entities created or modified since this timestamp will be returned e.g. 2009-11-12T00:00:00

Responses
200

List of contractor organization members

403

Access denied to this resource

404

Resource not found

500

Internal server error

get/sp/member
Request samples
curl -i -X GET \
  'https://api.whosonlocation.com/v1/sp/member?q=string&order=string&limit=0' \
  -H 'If-Modified-Since: string'
Response samples
[
  • {
    }
]

Create a member

Add a new contractor organization member to the database.

To add a member with custom fields:

  1. First, load the available custom fields (GET /customfield/element/sp-member)
  2. POST Request to /sp/member with a key that is called customfields, holding the id: value pair of the data. Your return will show you the type of contractor member custom field, its ID number, and its name.
  3. Fire the POST updating the custom field.
Request
Request Body schema: application/json

Contractor member information:

name
required
string <string>
title
string <string>
email
string <string>
altemail
string <string>
phone
string <string>
ice
string <string>
cur_location
integer <int32>
extension
string <string>
mobile
string <string>
valid_from
string <date>
valid_to
string <date>
onsite_status
string <string>
service_provider_id
string <string>
object

This will return an object of custom fields set for the contractor. The key of the custom field corresponds to the ID of the custom fields when using the Customfield endpoint

Responses
201

Member created

403

Access denied to this resource

500

Internal server error

post/sp/member
Request samples
application/json
{
  • "name": "New Member",
  • "title": "Contractor",
  • "email": "example@example.org",
  • "altemail": "example-alt@example.org",
  • "phone": "+1 206 555 0123",
  • "ice": "+1 206 555 0123",
  • "cur_location": 301,
  • "extension": "047",
  • "mobile": "+1 206 555 0123",
  • "valid_from": "2021-09-03",
  • "valid_to": "2026-09-02",
  • "onsite_status": "onsite",
  • "service_provider_id": "12345",
  • "cf": {
    }
}
Response samples
{
  • "id": 16348,
  • "created": "2021-09-03T15:17:57+12:00",
  • "modified": "2021-11-29T08:39:55+13:00",
  • "name": "First Contractor",
  • "setup_by": 823431,
  • "title": "Contractor",
  • "service_provider_id": "contract_047",
  • "email": "contractor-email@whosonlocation.com",
  • "altemail": "alternative-address@whosonlocation.com",
  • "phone": "+1 206 555 0123",
  • "mobile": "+1 206 555 0123",
  • "status": "active",
  • "valid_from": "2021-09-03",
  • "valid_to": "2026-09-02",
  • "extension": "047",
  • "ice": "+1 206 555 0123",
  • "onsite_status": "onsite",
  • "cur_location_id": 301,
  • "cur_sp_org_id": 4587,
  • "cur_location": "Head Office",
  • "sp_orgs": [
    ],
  • "logs": [
    ],
  • "tokens": [
    ],
  • "customfields": {
    }
}

Retrieve a member

Retrieves a single contractor organization member, filtering with the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the contractor organization member to retrieve

Example: id=16348
Responses
200

Member returned

403

Access denied to resource

404

Resource not found

500

Internal server error

get/sp/member/{id}
Request samples
curl -i -X GET \
  https://api.whosonlocation.com/v1/sp/member/:id
Response samples
{
  • "id": 16348,
  • "created": "2021-09-03T15:17:57+12:00",
  • "modified": "2021-11-29T08:39:55+13:00",
  • "name": "First Contractor",
  • "setup_by": 823431,
  • "title": "Contractor",
  • "service_provider_id": "contract_047",
  • "email": "contractor-email@whosonlocation.com",
  • "altemail": "alternative-address@whosonlocation.com",
  • "phone": "+1 206 555 0123",
  • "mobile": "+1 206 555 0123",
  • "status": "active",
  • "valid_from": "2021-09-03",
  • "valid_to": "2026-09-02",
  • "extension": "047",
  • "ice": "+1 206 555 0123",
  • "onsite_status": "onsite",
  • "cur_location_id": 301,
  • "cur_sp_org_id": 4587,
  • "cur_location": "Head Office",
  • "sp_orgs": [
    ],
  • "logs": [
    ],
  • "tokens": [
    ],
  • "customfields": {
    }
}

Update a member

Update a contractor organization member profile using the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the contractor member to update

Example: id=16348
Request Body schema: application/json

Information used to create the contractor member record:

name
required
string <string>
title
string <string>
email
string <string>
altemail
string <string>
phone
string <string>
ice
string <string>
cur_location
integer <int32>
extension
string <string>
mobile
string <string>
valid_from
string <date>
valid_to
string <date>
onsite_status
string <string>
service_provider_id
string <string>
object

This will return an object of custom fields set for the contractor. The key of the custom field corresponds to the ID of the custom fields when using the Customfield endpoint

Responses
204

Updated member

403

Access denied to this resource

500

Internal server error

put/sp/member/{id}
Request samples
application/json
{
  • "name": "New Member",
  • "title": "Contractor",
  • "email": "example@example.org",
  • "altemail": "example-alt@example.org",
  • "phone": "+1 206 555 0123",
  • "ice": "+1 206 555 0123",
  • "cur_location": 301,
  • "extension": "047",
  • "mobile": "+1 206 555 0123",
  • "valid_from": "2021-09-03",
  • "valid_to": "2026-09-02",
  • "onsite_status": "onsite",
  • "service_provider_id": "12345",
  • "cf": {
    }
}

Delete a member

Delete a contractor organization member using the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the specified contractor organization to delete

Example: id=16348
Responses
204

Member deleted

403

Access denied to resource

404

Resource not found

500

Internal server error

delete/sp/member/{id}
Request samples
curl -i -X DELETE \
  https://api.whosonlocation.com/v1/sp/member/:id