Skip to content

List workplaces

Introduction

The workplace API allows you to list all workplaces ("arbetsplatser") related to the company which the authentication credentials are assigned to.

https://personalkollen.se/api/workplaces/ provides a list of all workplaces.

Example request and response

Here is a basic example using httpie client:

http GET https://personalkollen.se/api/workplaces/ "Authorization: Token demo" --verbose

GET /api/workplaces/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Token demo
Connection: keep-alive
Host: personalkollen.se
User-Agent: HTTPie/0.9.9

HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 332
Content-Type: application/json
Date: Tue, 18 Jun 2014 11:01:09 GMT
Expires: Tue, 18 Jun 2014 11:01:09 GMT
Vary: Cookie
X-Frame-Options: SAMEORIGIN

{
    "next": null,
    "previous": null,
    "results": [
        {
            "company": "https://personalkollen.se/api/companies/678/",
            "description": "Foo Bar",
            "short_identifier": 123,
            "url": "https://personalkollen.se/api/workplaces/123/"
        }
    ]
}

Result description

The actual data can be found as a list of objects in the results field. Each object contains the fields listed below.

url

This value is a unique identifier to this particular workplace.

short_identifier

This value is a short yet unique identifier to this particular workplace expressed as a number.

description

This is the name of the workplace.

company

Unique identifier of the company that the workplace belongs to. This will always have the same value for all objects as long as the same API secret is used, since secrets belongs to a single company.