EmployeeRole¶
An EmployeeRole is a Person's role at a business (employer, an Organization
or a local business Place): the role and position, since and until when, the Services they
provide, their qualifications (hasCredential) and their working hours (workSchedule, Schedules with
their days, times and time zone, every other week or except holidays if need be). A
Person lists their roles in roles. GraphQL's availableSlots gives a provider's free times from these hours less
their appointments. A private record: it has no JSON-LD document, and a staff member's name is
never in one.
Modeled on schema.org/EmployeeRole · JSON Schema · ABAC object type EmployeeRole
Example¶
Create one with POST /employeeroles:
{
"employee": {
"at_id": "https://apis.objectsgrid.com/persons/8e9f0a1b-2c3d-4e5f-8a6b-7c8d9e0f1a2b"
},
"employer": {
"at_id": "https://apis.objectsgrid.com/places/4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a"
},
"roleName": [
{
"at_language": "en",
"at_value": "Stylist"
}
],
"providesService": [
{
"at_id": "https://apis.objectsgrid.com/services/6f7a8b9c-0d1e-4f2a-b3c4-d5e6f7a8b9c0"
}
],
"workSchedule": [
{
"byDay": [
"https://schema.org/Monday",
"https://schema.org/Tuesday"
],
"startTime": "09:00:00",
"endTime": "17:00:00",
"repeatFrequency": "P1W",
"scheduleTimezone": "Europe/Berlin"
}
]
}
Fields¶
Required: employee, employer.
| Field | Type | Required | Description |
|---|---|---|---|
at_context |
https://schema.org |
JSON-LD @context, always https://schema.org. |
|
at_type |
EmployeeRole |
JSON-LD @type, the object's type name. |
|
at_id |
URL | The object's ObjectsGrid URL, https://apis.objectsgrid.com/<path>/<id>, its JSON-LD @id: what References to it hold. Assigned by ObjectsGrid. |
|
id |
string | The object's id. Assigned by ObjectsGrid when the object is created. | |
identifier |
string | The object's id, as Schema.org identifier. Assigned by ObjectsGrid. |
|
url |
URL | The object's own URL, https://apis.objectsgrid.com/<path>/<id>. Assigned by ObjectsGrid. |
|
employee |
Reference to Person | Yes | The Person in the role |
employer |
Reference to Organization or Place | Yes | The Organization or local business (Place) they work for |
roleName |
list of LanguageTaggedString | The role, e.g. 'Stylist' | |
namedPosition |
string | The position's name in the business, e.g. 'Senior stylist' | |
startDate |
date | Since when | |
endDate |
date | Until when | |
providesService |
list of References to Service | The Services they provide | |
hasCredential |
list of EducationalOccupationalCredential | Their qualifications | |
workSchedule |
list of Schedule | When they work: Schedules with days, times and time zone, e.g. Mondays 09:00-17:00 Europe/Berlin, every other week, except holidays. ObjectsGrid's own field. | |
tags |
list of Tag | Tags your ABAC policy decides on. Created empty when not sent, kept by a PUT that leaves them out, cleared by null or []. |
|
meta |
ObjectMeta | Read-only metadata: version, type, creation and last update. |
REST API¶
Base URL https://apis.objectsgrid.com. Every request sends the X-ObjectsGrid-AccessPoint and Authorization: Bearer <access token> headers; see the REST API guide.
| Operation | Request |
|---|---|
| Create | POST /employeeroles |
| List and search | GET /employeeroles |
| Create up to 100 at once | POST /employeeroles/batch |
| Retrieve | GET /employeeroles/{id} |
| Replace | PUT /employeeroles/{id} |
| Update some fields | PATCH /employeeroles/{id} |
| Delete | DELETE /employeeroles/{id} |
EmployeeRole objects have no JSON-LD document: asked for one (Accept: application/ld+json), GET answers 406.
The OpenAPI contract, with every parameter and response: EmployeeRoles (JSON).
GraphQL¶
Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.
| Operation | Field |
|---|---|
| Query | employeeRole(id: ID!, version: String): EmployeeRole |
| Query | employeeRoles(where: EmployeeRoleWhereInput, orderBy: [EmployeeRoleOrderByInput!], first: Int, after: String): EmployeeRoleConnection! |
| Query | employeeRolesGroupBy(by: [EmployeeRoleGroupByField!]!, where: EmployeeRoleWhereInput, having: EmployeeRoleHavingInput, orderBy: [EmployeeRoleGroupByOrderByInput!], first: Int, after: String): EmployeeRoleGroupByConnection! |
| Mutation | createEmployeeRole(input: CreateEmployeeRoleInput!): EmployeeRole! |
| Mutation | updateEmployeeRole(input: UpdateEmployeeRoleInput!, expectedVersion: String): EmployeeRole! |
| Mutation | deleteEmployeeRole(id: ID!, expectedVersion: String): Boolean! |
Webhook events¶
Subscribe to these events in your webhook configuration to be called when an EmployeeRole changes:
EmployeeRoleCreated, EmployeeRoleUpdated, EmployeeRolePatched, EmployeeRoleDeleted.