Workplace

Workplaces are a part of an organization. It could be an office, a store, a department etc. Organization users may assign a culture to a workplace to get a culture match.

Workplaces are not shared between API clients. An organization user may delete workplaces in their control panel.

Show all

Display all workplaces.

Request

GET /api/workplaces
Host:          api.happyrmatch.com
Authorization: Bearer eyJ0eXAi1QiLCJ...
Accept:        application/vnd.api+json
        

Response

HTTP/1.0 200 OK
Cache-Control: no-cache, private
Content-Type:  application/vnd.api+json
Date:          Wed, 14 Sep 2022 05:38:55 GMT

{
    "data": {
        "type": "workplace",
        "id": "493f3999-2872-4beb-bd80-53517a259b9d",
        "attributes": {
            "organization": "5b0a13b6-d6e3-4841-9a13-d152f61d474a",
            "name": "Adams-Reichel",
            "country": "SE",
            "region": "Stockholms l\u00e4n",
            "city": "Stockholm",
            "address": "Drottninggatan 75"
        }
    }
}

Show

Display a workplace.

Request

GET /api/workplaces/[workplace_id]
Host:          api.happyrmatch.com
Authorization: Bearer eyJ0eXAi1QiLCJ...
Accept:        application/vnd.api+json
Content-Type:  application/vnd.api+json
        

Response

HTTP/1.0 200 OK
Cache-Control: no-cache, private
Content-Type:  application/vnd.api+json
Date:          Wed, 14 Sep 2022 05:38:55 GMT

{
    "data": {
        "type": "workplace",
        "id": "493f3999-2872-4beb-bd80-53517a259b9d",
        "attributes": {
            "organization": "5b0a13b6-d6e3-4841-9a13-d152f61d474a",
            "name": "Adams-Reichel",
            "country": "SE",
            "region": "Stockholms l\u00e4n",
            "city": "Stockholm",
            "address": "Drottninggatan 75"
        }
    }
}

Create

Create a new workplace

Request

POST /api/workplaces
Host:          api.happyrmatch.com
Authorization: Bearer eyJ0eXAi1QiLCJ...
Accept:        application/vnd.api+json
Content-Type:  application/vnd.api+json

{
    "name": "My workplace",
    "country": "SE",
    "region": "Stockholms l\u00e4n",
    "city": "Stockholm",
    "address": "Drottninggatan 75"
}

Parameters

NameDescription
nameThe name of the workplace.
countryAlpha-2 code for the country described by ISO 3166.
regionA state, county or other region that are covering a larger area than the city.
cityThe name of the city.
addressThe street address and number.

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": "workplace",
        "id": "493f3999-2872-4beb-bd80-53517a259b9d",
        "attributes": {
            "organization": "5b0a13b6-d6e3-4841-9a13-d152f61d474a",
            "name": "Adams-Reichel",
            "country": "SE",
            "region": "Stockholms l\u00e4n",
            "city": "Stockholm",
            "address": "Drottninggatan 75"
        }
    }
}

Update

Update an existing workplace.

Request

PUT /api/workplaces/[workplace_id]
Host:          api.happyrmatch.com
Authorization: Bearer eyJ0eXAi1QiLCJ...
Accept:        application/vnd.api+json
Content-Type:  application/vnd.api+json

{
    "name": "My workplace",
    "country": "SE",
    "region": "Stockholms l\u00e4n",
    "city": "Stockholm",
    "address": "Drottninggatan 75"
}

Parameters

The parameters are the same as for creating a workplace.

Response

HTTP/1.0 200 OK
Cache-Control: no-cache, private
Content-Type:  application/vnd.api+json
Date:          Wed, 14 Sep 2022 05:38:55 GMT

{
    "data": {
        "type": "workplace",
        "id": "493f3999-2872-4beb-bd80-53517a259b9d",
        "attributes": {
            "organization": "5b0a13b6-d6e3-4841-9a13-d152f61d474a",
            "name": "Adams-Reichel",
            "country": "SE",
            "region": "Stockholms l\u00e4n",
            "city": "Stockholm",
            "address": "Drottninggatan 75"
        }
    }
}

Delete

Delete a workplace.

Request

DELETE /api/workplaces/[workplace_id]
Host:          api.happyrmatch.com
Authorization: Bearer eyJ0eXAi1QiLCJ...
Accept:        application/vnd.api+json

Response

HTTP/1.0 204 No Content
Cache-Control: no-cache, private
Date:          Wed, 14 Sep 2022 05:38:55 GMT