Role
This is a job role that describes a position.
Create
Create a new role
Request
POST /api/roles
Host: api.happyrmatch.com
Authorization: Bearer eyJ0eXAi1QiLCJ...
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
{
"advert_title": "Funny receptionist",
"advert_body_text": "Long text",
"advert_body_html": "Long <b>text<\/b>",
"advert_link": "https:\/\/my-app.com\/advert\/123",
"description": "Short text",
"employment_duration": 1,
"role_category": "[role_category_id]",
"work_hours": 1,
"workplace": "[workplace_id]",
"supervisor_email": "alice@example.com",
"location": {
"country": "SE",
"region": "Stockholms l\u00e4n",
"city": "Stockholm",
"address": "Drottninggatan 75"
}
}
Parameters
Name | Description |
---|---|
advert_title | The title of the advert. Must be less that 255 characters. |
advert_body_text | The advert contents in plain text. This parameter is optional if advert_body_html is used. |
advert_body_html | The advert contents in HTML. This parameter is optional if advert_body_text is used. |
advert_link | The URL to the advert. This parameter is optional. |
description | A short description of the role. Must be less that 3000 characters. |
employment_duration | Define if this is a permanent position (1), temporary position (2) or a position with a predefined end date (3). |
role_category | An ID to a Role Category. |
work_hours | Define if it is a full-time job (1), part-time job (2) or extra/few days (3). |
workplace | Add workplace to the role. |
supervisor_email | Add email of the person supervising/managing candidates/employees. This parameter is optional but highly recommended. It is used for contact, followup survey etc. |
location[country] | Alpha-2 code for the country described by ISO 3166. |
location[region] | A state, county or other region that are covering a larger area than the city. |
location[city] | The name of the city. |
location[address] | The street address and number. |
Note: You have to provide either workplace or all location parameters. Providing both or none will result in 400 Bad request response.
Response
HTTP/1.0 201 Created
Cache-Control: no-cache, private
Content-Type: application/vnd.api+json
Date: Wed, 14 Sep 2022 05:38:55 GMT
{
"data": {
"type": "role",
"id": "85f6b84d-1dff-49fb-9418-706a2e47540b",
"attributes": []
}
}
Update
Update an existing role.
Request
PUT /api/roles/[role_id]
Host: api.happyrmatch.com
Authorization: Bearer eyJ0eXAi1QiLCJ...
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
{
"advert_title": "Funny receptionist",
"advert_body_text": "Long text",
"advert_body_html": "Long <b>text<\/b>",
"advert_link": "https:\/\/my-app.com\/advert\/123",
"description_text": "Short text",
"employment_duration": 1,
"role_category": "[role_category_id]",
"work_hours": 2,
"workplace": "[workplace_id]",
"supervisor_email": "alice@example.com",
"location": {
"country": "SE",
"region": "Stockholms l\u00e4n",
"city": "Stockholm",
"address": "Drottninggatan 75"
}
}
Parameters
The parameters are the same as for creating a role.
Response
HTTP/1.0 202 Accepted
Cache-Control: no-cache, private
Content-Type: application/vnd.api+json
Date: Wed, 14 Sep 2022 05:38:55 GMT
{
"meta": {
"message": "Accepted"
}
}