Contractor membership

Each contractor organization has individual members that are authorized to work on-site. A contractor member can belong to multiple contractor organizations in OnLocation.

Use the API to retrieve the organizations each member belongs to, including locations and contact role types; add, update, or delete the connection between a member and an organization.

Learn more about contractor members in the OnLocation Help Center.

List all membership records

Retrieves a list of the members that belong to each contractor organization.

Request
query Parameters
q
string <string>

Filter by any contractor membership element.

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

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

Example: order=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 memberships

403

Access denied to this resource

404

Resource not found

500

Internal server error

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

Create a membership record

Create a new contractor membership association.

Request
Request Body schema: application/json

Data to save for this contractor membership.

org_id
integer <int32>

ID of a contractor organisation

member_id
integer <int32>
roles
Array of any <int32>
Array of objects (ContractorMembershipLocation)
Responses
201

Resource created

403

Access denied to this resource

500

Internal server error

post/sp/membership
Request samples
application/json
{
  • "org_id": 405,
  • "member_id": 43,
  • "roles": [
    ],
  • "locations": [
    ]
}
Response samples
{
  • "id": 13863,
  • "created": "2021-09-03T15:17:59+12:00",
  • "org_id": 4587,
  • "org_name": "Contractor Organisation",
  • "member_id": 16348,
  • "member_name": "Contractor Name",
  • "roles": [
    ],
  • "locations": [
    ],
  • "locations_same_as_org": true
}

Retrieve a membership record

Retrieves a single contractor membership record, filtering with the provided ID

Request
path Parameters
id
required
integer <int32>

ID of the contractor membership record to retrieve

Responses
200

A single contractor membership record

403

Access denied to resource

404

Resource not found

500

Internal server error

get/sp/membership/{id}
Request samples
curl -i -X GET \
  https://api.whosonlocation.com/v1/sp/membership/:id
Response samples
{
  • "id": 13863,
  • "created": "2021-09-03T15:17:59+12:00",
  • "org_id": 4587,
  • "org_name": "Contractor Organisation",
  • "member_id": 16348,
  • "member_name": "Contractor Name",
  • "roles": [
    ],
  • "locations": [
    ],
  • "locations_same_as_org": true
}

Update a membership record

Updates a contractor membership association

Request
path Parameters
id
required
integer <int32>

ID of the contractor membership association to update

Request Body schema: application/json

Information used to update the contractor membership association record

org_id
integer <int32>

ID of a contractor organisation

member_id
integer <int32>
roles
Array of any <int32>
Array of objects (ContractorMembershipLocation)
Responses
204

Updated resource

403

Access denied to this resource

500

Internal server error

put/sp/membership/{id}
Request samples
application/json
{
  • "org_id": 405,
  • "member_id": 43,
  • "roles": [
    ],
  • "locations": [
    ]
}

Delete a membership record

Deletes the specified contractor membership

Request
path Parameters
id
required
integer <int32>

ID of the membership to delete

Responses
204

Resource Deleted

403

Access denied to resource

404

Resource not found

500

Internal server error

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