NAV
http

Introduction

This is the documentation for the API of CompanyMood.

This API follows the JSONAPI specification but without hypermedia.

There are a lot of different libraries for all kinds of languages out there to consume JSON-API APIs.

API Request and Versions

GET / HTTP/1.1
Host: api.company-mood.com
Accept: application/vnd.company-mood-v2+json

You need to specify the API version you want use via the Accept header.

Format

application/vnd.company-mood-v<VERSION>+json

Application Token

GET / HTTP/1.1
Host: api.company-mood.com
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

You need to send your application token with every request in the X-App-Token header.

Authentication

GET / HTTP/1.1
Host: api.company-mood.com
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406

For every authenticated request (all but /sessions, /oauth and /password-resets) you need to send the auth_token (see /sessions endpoint) in the Authorization header as a Bearer token.

Heartbeat

Get the heartbeat

GET /heartbeat HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

A heartbeat endpoint which return a 200 status if the API is operational.

Sessions

Create a new session

POST /sessions HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data": {
    "type": "sessions",
    "attributes": {
      "email": "valid@example.com",
      "password": "secret"
    }
  }
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
  "data": {
    "id": "1d7f7eea-b088-46dd-b29c-51ccfa4085e7",
    "type": "users",
    "attributes": {
      "firstname": "John",
      "lastname": "Doe",
      "email": "j.doe1@example.com",
      "locale": "de",
      "image_url": "https://gravatar.com/avatar/829afce351884fcde132544bf9686221",
      "role": "admin",
      "auth_token": "5c3dad26-31a4-4f6d-a799-b3cd9053dc83",
      "company_id": "8f40670c-9927-4712-979f-81a2fa4c7253",
      "mood_creation_notification_email_active": true,
      "mood_creation_reminder_email_active": true,
      "mood_creation_notification_push_notification_active": true,
      "mood_creation_reminder_push_notification_active": true,
      "weekly_status_notification_active": true
    }
  }
}

You can create a new session and get the auth_token and other important informations about the just logged in user by sending the email and password to this endpoint.

The returned role can be “admin”, “employee” or “department_manager”.

POST Attributes

Parameter Description
email Email for session
password Password for session

Response Attributes

Parameter Description
firstname Firstname of the sessions user
lastname Lastname of the sessions user
email Email of the sessions user
locale Locale of the sessions user
image_url Url to the profile image of the sessions user
role Role of the sessions user (admin, department_manager or employee)
auth_token Auth token for users session, use this for further authorization on endpoints
company_id ID of the company, the user belongs to. Empty if the user does’t belong to a company, yet.
mood_creation_notification_email_active Will the user receive notifications for mood reviews per email?
mood_creation_reminder_email_active Will the user receive reminder for mood reviews per email if he didn’t give an answer already?
mood_creation_notification_push_notification_active Will the user receive push notifications for mood reviews on mobile phones?
mood_creation_reminder_push_notification_active Will the user receive push notifications to remind him to answer the review question on mobile phone?
weekly_status_notification_active Will the user receive a weekly status report per mail? (Attribute is not present for users without a report role)

Oauth

Sign in via google oauth

POST /oauth/google_oauth2 HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data": {
    "type": "oauth",
    "attributes": {
      "id_token": "INSERT ID TOKEN HERE"
    }
  }
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
  "data": {
    "id": "1d7f7eea-b088-46dd-b29c-51ccfa4085e7",
    "type": "users",
    "attributes": {
      "firstname": "John",
      "lastname": "Doe",
      "email": "j.doe1@example.com",
      "locale": "de",
      "image_url": "https://gravatar.com/avatar/829afce351884fcde132544bf9686221",
      "role": "admin",
      "auth_token": "5c3dad26-31a4-4f6d-a799-b3cd9053dc83",
      "company_id": "8f40670c-9927-4712-979f-81a2fa4c7253"
    }
  }
}

You can create a new oauth session and get the auth_token and other important informations about the just logged in user by sending a id_token to this endpoint.

The returned role can be “admin”, “employee” or “department_manager”.

POST Attributes

Paramteter Description
id_token Request this token from google auth api (see https://developers.google.com/identity/sign-in/web/sign-in)

Response Attributes

Paramteter Description
firstname Firstname of the sessions user
lastname Lastname of the sessions user
email Email of the sessions user
locale Locale of the sessions user
image_url Url to the profile image of the sessions user
role Role of the sessions user (admin, department_manager or employee)
auth_token Auth token for users session, use this for further authorization on endpoints
company_id ID of the company, the user belongs to. Empty if the user does’t belong to a company, yet.

Companies

Retrieve the company stats for given company id

Returns with an 401 if the user does not belong to the company or isn’t an admin of the company.

GET /company/{company_id} HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
     {
       "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
       "type": "companies",
       "attributes": {
         "name": "CompanyMood",
         "anonymous_tracking": false,
         "certificate_active": true,
         "certificate_type": "green",
         "certificate_id": "3d34dbca-ed95-4341-ac59-b4577311784b",
         "created_at": "2015-03-13T11:46:40.196Z",
         "frequency_period": "months",
         "frequency_amount": 3,
         "mood_creation_notification_on": 4,
         "mood_creation_notification_on_hours": 9,
         "mood_creation_notification_on_weeks": 4,
         "mood_creation_reminder_on": 5,
         "mood_creation_reminder_on_hours": 17,
         "mood_creation_reminder_on_weeks": 2,
         "allow_anonymous_suggestions": true
       }
     }
  ]
}

Response Attributes

Parameter Description
id id of the company
name name of the company
anonymous_tracking Does the company track anonymous?
certificate_active Is the companies certificate active?
certificate_type Certificate type [“green”, “gold”]
certificate_id The certificated UUID
created_at Timestamp of the company creation
frequency_period Tracking frequency period [“daily”, “weeks”, “months”]
frequency_amount Tracking frequency amount [1..3]
mood_creation_notification_on Weekday for mood creation (notification and creation forcing)
mood_creation_notification_on_hours Hour for the mood creation (notification and creation forcing)
mood_creation_notification_on_weeks Week for the mood creation (notification and creation forcing)
mood_creation_reminder_on Weekday for mood creation reminder notification
mood_creation_reminder_on_hours Hour for the mood creation reminder notification
mood_creation_reminder_on_weeks Week for the mood creation reminder notification
allow_anonymous_suggestions Is it allowed to create anonymous suggestions for this company? If false, all suggestions will be created with not_anonymous set to true.

Update a company

PUT /companies/{company_id} HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data": [
     {
       "type": "companies",
       "attributes": {
         "name": "CompanyMood",
         "certificate_active": true,
         "frequency_period": "months",
         "frequency_amount": 3,
         "mood_creation_notification_on": 4,
         "mood_creation_notification_on_hours": 9,
         "mood_creation_notification_on_weeks": 4,
         "mood_creation_reminder_on": 5,
         "mood_creation_reminder_on_hours": 17,
         "mood_creation_reminder_on_weeks": 2,
         "allow_anonymous_suggestions": false
       }
     }
  ]
}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
     {
       "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
       "type": "companies",
       "attributes": {
         "name": "CompanyMood",
         "anonymous_tracking": false,
         "certificate_active": true,
         "certificate_type": "green",
         "certificate_id": "3d34dbca-ed95-4341-ac59-b4577311784b",
         "created_at": "2015-03-13T11:46:40.196Z",
         "frequency_period": "months",
         "frequency_amount": 3,
         "mood_creation_notification_on": 4,
         "mood_creation_notification_on_hours": 9,
         "mood_creation_notification_on_weeks": 4,
         "mood_creation_reminder_on": 5,
         "mood_creation_reminder_on_hours": 17,
         "mood_creation_reminder_on_weeks": 2,
         "allow_anonymous_suggestions": false
       }
     }
  ]
}

PUT Attributes

Parameter Description
name name of the company
certificate_active Is the companies certificate active?
frequency_period Tracking frequency period [“daily”
frequency_amount Tracking frequency amount [1..3]
mood_creation_notification_on Weekday for mood creation (notification and creation forcing)
mood_creation_notification_on_hours Hour for the mood creation (notification and creation forcing)
mood_creation_notification_on_weeks Week for the mood creation (notification and creation forcing)
mood_creation_reminder_on Weekday for mood creation reminder notification
mood_creation_reminder_on_hours Hour for the mood creation reminder notification
mood_creation_reminder_on_weeks Week for the mood creation reminder notification
allow_anonymous_suggestions Is it allowed to create anonymous suggestions for this company? If false, all suggestions will be created with not_anonymous set to true.

Response Attributes

Parameter Description
id id of the company
name name of the company
anonymous_tracking Does the company track anonymous?
certificate_active Is the companies certificate active?
certificate_type Certificate type [“green”
certificate_id The certificated UUID
created_at Timestamp of the company creation
frequency_period Tracking frequency period [“daily”
frequency_amount Tracking frequency amount [1..3]
mood_creation_notification_on Weekday for mood creation (notification and creation forcing)
mood_creation_notification_on_hours Hour for the mood creation (notification and creation forcing)
mood_creation_notification_on_weeks Week for the mood creation (notification and creation forcing)
mood_creation_reminder_on Weekday for mood creation reminder notification
mood_creation_reminder_on_hours Hour for the mood creation reminder notification
mood_creation_reminder_on_weeks Week for the mood creation reminder notification
allow_anonymous_suggestions Is it allowed to create anonymous suggestions for this company? If false, all suggestions will be created with not_anonymous set to true.

CustomTags

Retrieve the tags pool for logged in user

Custom tags specify the tags you can use to describe your mood. Returns with an 401 if the user does not belong to a company.

GET /custom_tags HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
     {
       "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
       "type": "custom_tags",
       "attributes": {
         "name": "Workload",
         "labels": {
           "de": "Auslastung",
           "en": "Workload",
           "fr": "Charge de travail",
           "es": "Carga de trabajo",
           "it": "Carico di lavoro",
           "nl": "Werkbelasting",
           "pl": "Obciążenie pracą",
           "pt": "Carga de trabalho",
           "ru": "Рабочая нагрузка"
         },
         "de_translation": "Auslastung",
         "en_translation": "Workload",
         "fr_translation": "Charge de travail"
       }
     },
     {
       "id": "c23e5e7d-162f-4fdc-9243-5e6349ce2bd1",
       "type": "custom_tags",
       "attributes": {
         "name": "Privat",
         "labels": {
           "de": "Privat",
           "en": "Private",
           "fr": "Privé",
           "es": null,
           "it": null,
           "nl": null,
           "pl": null,
           "pt": null,
           "ru": null
         },
         "de_translation": "Privat",
         "en_translation": "Private",
         "fr_translation": "Privé"
       }
     },
     {
       "id": "a9767fd1-a187-40e2-954c-872cebff5e70",
       "type": "custom_tags",
       "attributes": {
         "name": "Management",
         "labels": {
           "de": "Führungskräfte",
           "en": "Managers",
           "fr": "Managers / Responsables",
           "es": "personal directivo",
           "it": "Personale direttivo",
           "nl": "Leidinggevenden",
           "pl": "Menedżerowie",
           "pt": "Gerentes",
           "ru": "Менеджеры"
         },
         "de_translation": "Vorgesetzte",
         "en_translation": "Management",
         "fr_translation": "Responsables"
       }
     }
  ]
}

Response Attributes

Paramteter Description
id id of the tag (used for custom_tag_ids in mood creation)
name name (DEPRECATED)
labels An object of translations of the custom tag name.
de_translation German translation of the tag (DEPRECATED)
en_translation English translation of the tag (DEPRECATED)
fr_translation English translation of the tag (DEPRECATED)

Departments

Retrieve the departments of the users company

Returns with an 401 if the user does not belong to a company or isn’t an admin of the company.

GET /departments HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
     {
       "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
       "type": "departments",
       "attributes": {
         "name": "Services",
         "breadcrumb": "Development > In House > Services"
       }
     },
     {
       "id": "a9767fd1-a187-40e2-954c-872cebff5e70",
       "type": "departments",
       "attributes": {
         "name": "Management",
         "breadcrumb": "Management"
       }
     }
  ]
}

Response Attributes

Paramteter Description
id id of the department
name name
breadcrumb All names in path to the department incl. it’s own

EventPins

Retrieve the event_pins of the users company

Returns with an 401 if the user does not belong to a company.

GET /event_pins HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
     {
       "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
       "type": "event_pins",
       "attributes": {
         "name": "New office manager",
         "description": "The new office manager got employed.",
         "date": "2016-03-11",
         "visible_for_role": "employee",
         "department_ids": [
           "094822c8-d81f-4639-8197-9a586f10edcd"
         ]
       }
     },
     {
       "id": "a9767fd1-a187-40e2-954c-872cebff5e70",
       "type": "event_pins",
       "attributes": {
         "name": "Off-Site in Berlin",
         "description": "We spend a week in Berlin together.",
         "date": "2016-05-27",
         "visible_for_role": "department_manager",
         "department_ids": []
       }
     }
  ]
}

Response Attributes

Paramteter Description
id id of the department
name Name of the event pin
description Description of the event pin
department_ids Department ids for departments the event pin belong. Belongs to whole company if empty
date Date of the event pin
visible_for_role Shows what users should be able to see it.

Moods

Retrieve moods of the logged in user

GET /moods HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "meta": {
    "from": "2015-01-30",
    "to": "2015-04-30"
  }
}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "meta": {
    "from": "2015-01-30",
    "to": "2015-04-30",
    "last_weeks_mood_id": "e96afc28-f27e-49b9-9f27-94dd3e2a296b"
  },
  "data": [
     {
       "id": "094822c8-d81f-4639-8197-9a586f10edcd",
       "type": "moods",
       "attributes": {
         "rating": 100,
         "calendar_week": 46,
         "year": 2015,
         "reason": "It was pretty noisy this week",
         "reasonings": [],
         "feeling": "happy",
         "department_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
         "created_at": "2015-11-21T05:59:42.517Z"
       }
     },
     {
       "id": "e96afc28-f27e-49b9-9f27-94dd3e2a296b",
       "type": "moods",
       "attributes": {
         "rating": 75,
         "calendar_week": 47,
         "year": 2015,
         "reason": "Got a new place in the basement! :)",
         "reasonings": [
           {
             "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
             "feeling": "happy",
             "reason": "The reason for happy custom tag"
           }
         ],
         "feeling": "satisfied",
         "department_id": "a9767fd1-a187-40e2-954c-872cebff5e70",
         "created_at": "2015-11-18T19:18:42.517Z"
       }
     }
  ]
}

Request the moods for the logged in user.

Possibility to filter the collection by from, to, all_in_company and deparment_idparameters.

GET META Attributes

Paramteter Description
from optional Date to limit the moods results (in ISO8601)
to optional Date to limit the moods results (in ISO8601)
all_in_company optional Return all moods of that company (true or false) - only works for company admins
department_id optional Return all moods of that department (true or false) - only works for company admins

Response META Attributes

Paramteter Description
from Date to limit the moods results (in ISO8601)
to Date to limit the moods results (in ISO8601)
last_weeks_mood_id ID of the last weeks mood for given user (can be empty, means no mood given)

Response Attributes

Paramteter Description
rating Rating as a number between 0 - 100
calendar_week Calendar week of the mood
year Year of the mood
reason Optional given reason
reasonings list of reasonings as an array
reasonings[custom_tag_id] ID of the custom tag for the reasoning
reasonings[feeling] feeling for the reasoning
reasonings[reason] reason for the reasoning as a string
feeling Feeling of the mood (happy, satisfied, ok, unhappy, sad)
department_id The moods department id
created_at Date of the mood creation (in ISO8601)

Create a new mood for last week - For the authorized user

POST /moods HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data" : {
    "type": "moods",
    "attributes": {
      "feeling": "happy",
      "reason": "Got a new place in the basement! :)",
      "tag_list": "Management",
      "reasonings": [
        {
          "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
          "feeling": "happy",
          "reason": "The reason for happy custom tag"
        }
      ]
    }
  }
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
  "data": {
    "id": "e96afc28-f27e-49b9-9f27-94dd3e2a296b",
    "type": "moods",
    "attributes": {
      "rating": 100,
      "calendar_week": 25,
      "year": 2015,
      "reason": "Got a new place in the basement! :)",
      "reasonings": [
        {
          "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
          "feeling": "happy",
          "reason": "The reason for happy custom tag"
        }
      ],
      "feeling": "happy",
      "department_id": "a9767fd1-a187-40e2-954c-872cebff5e70",
      "created_at": "2015-06-25T11:18:42.517Z"
    }
  }
}

Creates the mood for the latest calendar week.

You MUST provide a reason or at least one tag in the tag_list parameter.

POST Attributes

Parameter Description
feeling required Feeling of the mood can be (“sad”, “unhappy”, “ok”, “satisfied”, “happy”) - in rating it’s 0, 25, 50, 75, 100
reason optional Text reason for the mood
reasonings optional list of reasonings as an array
reasonings[custom_tag_id] required ID of the custom tag for the reasoning
reasonings[feeling] required feeling for the reasoning
reasonings[reason] optional reason for the reasoning as a string

Response Attributes

Paramteter Description
rating Rating as a number between 0 - 100
calendar_week Calendar week of the mood
year Year of the mood
reason Optional given reason
reasonings list of reasonings as an array
reasonings[custom_tag_id] ID of the custom tag for the reasoning
reasonings[feeling] feeling for the reasoning
reasonings[reason] reason for the reasoning as a string
feeling Feeling of the mood (happy, satisfied, ok, unhappy, sad)
department_id The moods department id
created_at Date of the mood creation (in ISO8601)

Create a new mood for last week - For a terminal (no user get assigned)

POST /moods HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data" : {
    "type": "moods",
    "attributes": {
      "feeling": "happy",
      "reason": "Got a new place in the basement! :)",
      "reasonings": [
        {
          "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
          "feeling": "happy",
          "reason": "The reason for happy custom tag"
        }
      ],
      "terminal_spot_id": "0f4d29f7-34e0-4ce9-b985-a90cccbd9f86",
      "department_id": "f53ac2a2-2917-4b4a-84ac-8874f406dc97"
    }
  }
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
  "data": {
    "id": "e96afc28-f27e-49b9-9f27-94dd3e2a296b",
    "type": "moods",
    "attributes": {
      "rating": 100,
      "calendar_week": 25,
      "year": 2015,
      "reason": "Got a new place in the basement! :)",
      "reasonings": [
        {
          "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
          "feeling": "happy",
          "reason": "The reason for happy custom tag"
        }
      ],
      "feeling": "happy",
      "department_id": "a9767fd1-a187-40e2-954c-872cebff5e70",
      "created_at": "2015-06-25T11:18:42.517Z"
    }
  }
}

Creates the mood for the latest calendar week.

You MUST provide a reason or at least one tag in the tag_list parameter.

POST Attributes

Parameter Description
feeling required Feeling of the mood can be (“sad”, “unhappy”, “ok”, “satisfied”, “happy”) - in rating it’s 0, 25, 50, 75, 100
reason required Text reason for the mood
reasonings optional list of reasonings as an array
reasonings[custom_tag_id] required ID of the custom tag for the reasoning
reasonings[feeling] required feeling for the reasoning
reasonings[reason] optional reason for the reasoning as a string
terminal_spot_id required ID of the terminal spot for which you want to track the mood
department_id required ID of the department for which you want to track the terminals mood (need to be assigned to the particular terminal)

Response Attributes

Paramteter Description
rating Rating as a number between 0 - 100
calendar_week Calendar week of the mood
year Year of the mood
reason Optional given reason
reasonings list of reasonings as an array
reasonings[custom_tag_id] ID of the custom tag for the reasoning
reasonings[feeling] feeling for the reasoning
reasonings[reason] reason for the reasoning as a string
feeling Feeling of the mood (happy, satisfied, ok, unhappy, sad)
department_id The moods department id
created_at Date of the mood creation (in ISO8601)

Update a mood

PUT /moods/{mood_id} HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data" : {
    "type": "moods",
    "attributes": {
      "feeling": "satisfied",
      "reason": "Got a new place in the basement! :)",
      "reasonings": [
        {
          "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
          "feeling": "happy",
          "reason": "The reason for happy custom tag"
        }
      ]
    }
  }
}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "e96afc28-f27e-49b9-9f27-94dd3e2a296b",
    "type": "moods",
    "attributes": {
      "rating": 75,
      "calendar_week": 25,
      "year": 2015,
      "reason": "Got a new place in the basement! :)",
      "reasonings": [
        {
          "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
          "feeling": "happy",
          "reason": "The reason for happy custom tag"
        }
      ],
      "feeling": "satisfied",
      "department_id": "a9767fd1-a187-40e2-954c-872cebff5e70",
      "created_at": "2015-06-25T11:18:42.517Z"
    }
  }
}

Update a specific mood (by mood_id in the URI)

You can only update the mood for last calendar week and if its creation (created_at) is not older than 24h.

You MUST provide a reason or at least one tag in the tag_list parameter.

PUT Attributes

Parameter Description
feeling required Feeling of the mood can be (“sad”, “unhappy”, “ok”, “satisfied”, “happy”) - in rating it’s 0, 25, 50, 75, 100
reason required Text reason for the mood
reasonings optional list of reasonings as an array
reasonings[custom_tag_id] required ID of the custom tag for the reasoning
reasonings[feeling] required feeling for the reasoning
reasonings[reason] optional reason for the reasoning as a string

Response Attributes

Paramteter Description
rating Rating as a number between 0 - 100
calendar_week Calendar week of the mood
year Year of the mood
reason Optional given reason
reasonings list of reasonings as an array
reasonings[custom_tag_id] ID of the custom tag for the reasoning
reasonings[feeling] feeling for the reasoning
reasonings[reason] reason for the reasoning as a string
feeling Feeling of the mood (happy, satisfied, ok, unhappy, sad)
department_id The moods department id
created_at Date of the mood creation (in ISO8601)

Delete a mood

DELETE /moods/{mood_id} HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

Delete a specific mood (by mood_id in the URI)

You can only delete the mood for last calendar week.

Tasks

Get all tasks for current user

GET /tasks HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
     {
       "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
       "type": "tasks",
       "attributes": {
         "name": "Implement CompanyMood",
         "description": "Implement continuous Mood monitoring",
         "percent": 100,
         "state": "implemented",
         "created_at": "2018-03-11"
       }
     },
     {
       "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
       "type": "tasks",
       "attributes": {
         "name": "Teamevent",
         "description": "Big office party",
         "percent": 10,
         "state": "idea",
         "created_at": "2018-03-15"
       }
     }
  ]
}

Response Attributes

Paramteter Description
id id of the task
name Name of the task
description Description of the task
percent Progress of the task in percent
state State of the task
created_at create at date of task

TerminalSpots

Retrieve the terminal spots of the users company

Returns with an 401 if the user does not belong to a company

You’ll need the terminal_spot_id and its accorind department_id if you want to track a terminal mood. More under /moods

Note

In this endpoint you’ll get all dependend departments and terminal_spot_department_settings as sideloaded relationships and includes.

GET /terminal_spots HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [{
     "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
     "type": "terminal_spot",
     "attributes": {
       "name": "Production exit terminal",
       "description": "This terminal gets placed at the facility A.1-5s exits",
       "soft_cap_rate": 10,
       "hard_cap_rate": 25
     },
     "relationships": {
       "terminal_spot_department_settings": {
         "data": [
           {
             "id": "0cc30da9-ffc7-40ff-9c88-ef03aa692b98",
             "type": "terminal_spot_department_settings"
           }
         ]
       }
     }
   }],
   "included": [{
    "id": "0cc30da9-ffc7-40ff-9c88-ef03aa692b98",
    "type": "terminal_spot_department_settings",
    "attributes": {
      "users_count": 9,
      "department_id": "ea985df4-2c38-4c44-bda9-5bbe031f6755"
    },
    "relationships": {
      "department": {
        "data": {
          "id": "ea985df4-2c38-4c44-bda9-5bbe031f6755",
          "type": "departments"
        }
      }
    }
  },{
    "id": "ea985df4-2c38-4c44-bda9-5bbe031f6755",
    "type": "departments",
    "attributes": {
      "name": "Design",
      "breadcrumb": "German HQ > Development > Design"
    }
  }]
}

Response Attributes

terminal_spot

Paramteter Description
id id of the terminal spot
name name of the terminal spot
description description of the terminal spot
soft_cap_rate Soft cap rate defines at what rate (not amount) of overtracked moods, a warning should get shown fir a terminals department
hard_cap_rate Hard cap rate defines at what rate (not amount) of overtracked moods, a terminal should not allow the tracking for a terminals department

side loaded department

Paramteter Description
id id of the terminal spot
name name of the terminal spot
breadcrumb All names in path to the department incl. it’s own

side loaded terminal_spot_department_settings

Paramteter Description
id id of the terminal spot
users_count how much users are supposed to track via this terminal_spot_department_setting
department_id department id for this terminal_spot_department_setting (needed for tracking terminal mood)

Settings

Retrieve the current user settings

GET /settings HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "70d17931-a3f0-4aa3-b432-c46f4b763d4f",
    "type": "settings",
    "attributes": {
      "mood_creation_notification_email_active": true,
      "mood_creation_reminder_email_active": true,
      "mood_creation_notification_push_notification_active": true,
      "mood_creation_reminder_push_notification_active": true,
      "weekly_status_notification_active": true,
      "locale": true
    }
  }
}

Response Attributes

Parameter Description
id Current user ID
mood_creation_notification_email_active Will the user receive notifications for mood reviews per email?
mood_creation_reminder_email_active Will the user receive reminder for mood reviews per email if he didn’t give an answer already?
mood_creation_notification_push_notification_active Will the user receive push notifications for mood reviews on mobile phones?
mood_creation_reminder_push_notification_active Will the user receive push notifications to remind him to answer the review question on mobile phone?
weekly_status_notification_active Will the user receive a weekly status report per mail? (Attribute is not present for users without a report role)
locale Locale of the current user

Update current user settings

PUT /settings HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data": {
    "type": "settings",
    "attributes": {
      "mood_creation_notification_email_active": false,
      "mood_creation_reminder_email_active": false,
      "mood_creation_notification_push_notification_active": false,
      "mood_creation_reminder_push_notification_active": false,
      "weekly_status_notification_active": false,
      "locale": false
    }
  }
}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "70d17931-a3f0-4aa3-b432-c46f4b763d4f",
    "type": "settings",
    "attributes": {
      "mood_creation_notification_email_active": false,
      "mood_creation_reminder_email_active": false,
      "mood_creation_notification_push_notification_active": false,
      "mood_creation_reminder_push_notification_active": false,
      "weekly_status_notification_active": false,
      "locale": false
    }
  }
}

PUT Attributes

Parameter Description
mood_creation_notification_email_active Will the user receive notifications for mood reviews per email?
mood_creation_reminder_email_active Will the user receive reminder for mood reviews per email if he didn’t give an answer already?
mood_creation_notification_push_notification_active Will the user receive push notifications for mood reviews on mobile phones?
mood_creation_reminder_push_notification_active Will the user receive push notifications to remind him to answer the review question on mobile phone?
weekly_status_notification_active Will the user receive a weekly status report per mail? (Attribute is not present for users without a report role)
locale Locale of the current user

Response Attributes

Parameter Description
mood_creation_notification_email_active Will the user receive notifications for mood reviews per email?
mood_creation_reminder_email_active Will the user receive reminder for mood reviews per email if he didn’t give an answer already?
mood_creation_notification_push_notification_active Will the user receive push notifications for mood reviews on mobile phones?
mood_creation_reminder_push_notification_active Will the user receive push notifications to remind him to answer the review question on mobile phone?
weekly_status_notification_active Will the user receive a weekly status report per mail? (Attribute is not present for users without a report role)
locale Locale of the current user

Suggestions

Create suggestion

POST /suggestions HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data" : {
    "type": "suggestions",
    "attributes": {
      "content": "Free coffee plz!",
      "feeling": "happy",
      "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
      "not_anonymous": false,
      "terminal_spot_id": "7842e27e-a6dc-4cb7-9818-42a507410b1d"
    }
  }
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
  "data": {
    "id": "e23sed23-f27e-49b9-9f27-94dd3e2a296b",
    "type": "suggestions",
    "attributes": {
      "content": "Free coffee plz!",
      "feeling": "happy",
      "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
      "not_anonymous": false,
      "terminal_spot_id": "7842e27e-a6dc-4cb7-9818-42a507410b1d",
      "created_at": "2018-06-25T11:18:42.517Z"
  }
}

Creates a suggestion for the current user with the given details.

You MUST provide a feeling, content and a custom_tag. The suggestion will be anonymous by default if you don’t provide a not_anonymous parameter. If your company is setup to not allow anonymous suggestions it will be always true.

POST Attributes

Paramteter Description
content required The suggestion content.
feeling required Feeling of the suggestion can be (“sad”, “unhappy”, “ok”, “satisfied”, “happy”).
custom_tag_id required ID of the custom tag for the suggestion.
not_anonymous optional Create not anonymous suggestion. True or false. false by default if not given. Always true if company is setup to not allow anonymous suggestions.
terminal_spot_id optional ID of the terminal spot for the suggestion.

Response Attributes

Paramteter Description
content The suggestion content
feeling Feeling of the suggestion can be (“sad”, “unhappy”, “ok”, “satisfied”, “happy”)
custom_tag_id ID of the custom tag for the suggestion
not_anonymous Boolean value. Displays if suggestion is anonymous or not.
terminal_spot_id ID of the terminal spot for the suggestion.
created_at Date of the suggestion creation (in ISO8601)

Password reset

POST /password-resets HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data": {
    "type": "password-resets",
    "attributes": {
      "email": "valid@example.com"
    }
  }
}
HTTP/1.1 202 ACCEPTED
Content-Type: application/json

To start a reset password process you have to send a POST request with the user email address to this endpoint. If the request was successful, you’ll receive an email with a password reset link.

This endpoint does not require authentication with auth_token.

POST attributes

Parameter Description
email User email for whom the process will be started

Public Announcements

Get all public announcements

GET /public_announcements HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
    {
      "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
      "type": "public-announcements",
      "attributes": {
        "creator_name": "Jovanni Williamson",
        "content": "Awesome public announcement",
        "task_id": "a9767fd1-a187-40e2-954c-872cebff5e70",
        "own_reaction": "up",
        "reaction_counts": {
          "up": 15,
          "down": 2
        },
        "created_at": "2018-06-25T11:18:42.517Z"
      }
    },
    {
      "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
      "type": "public-announcements",
      "attributes": {
        "creator_name": "Sammy Nonetti",
        "content": "We created a survey for our upcoming team event. Please participate.",
        "task_id": "e96afc28-f27e-49b9-9f27-94dd3e2a296b",
        "own_reaction": null,
        "reaction_counts": {
          "up": 8,
          "down": 1
        },
        "created_at": "2018-05-25T19:12:32.212Z"
      }
    }
  ]
}

Get all public announcements which are accessible by the current user.

Response Attributes

Paramteter Description
id ID of the public announcement.
creator_name Name of announcement creator.
content Content of the public announcement.
task_id ID of the associated Task.
own_reaction The reaction of the current user. Can be “up”, “down” or null.
reaction_counts An Object with details for “up” and “down” reactions.
reaction_counts[up] Amount of up votes.
reaction_counts[down] Amount of down votes.
created_at Date of the public announcement creation (in ISO8601)

Create announcement reaction

POST /public_announcements/f7559f2a-8f1c-461e-8a9b-7efea5564edb/reactions HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "data" : {
    "type": "public-announcements",
    "attributes": {
      "reaction": "down"
    }
  }
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
  "data": {
    "id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
    "type": "public-announcements",
    "attributes": {
      "creator_name": "Jovanni Williamson",
      "content": "Awesome public announcement",
      "task_id": "a9767fd1-a187-40e2-954c-872cebff5e70",
      "own_reaction": "down",
      "reaction_counts": {
        "up": 14,
        "down": 3
      },
      "created_at": "2018-06-25T11:18:42.517Z"
    }
  }
}

React on public announcements with an “up” or “down” vote.

POST attributes

Paramteter Description
reaction The reaction key. Can be “up” or “down”.

Response Attributes

Paramteter Description
id ID of the public announcement.
creator_name Name of announcement creator.
content Content of the public announcement.
task_id ID of the associated Task.
own_reaction The reaction of the current user. Can be “up”, “down” or null.
reaction_counts An Object with details for “up” and “down” reactions.
reaction_counts[up] Amount of up votes.
reaction_counts[down] Amount of down votes.
created_at Date of the public announcement creation (in ISO8601)

Widgets

Get all widgets

GET /widgets HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db

{
  "meta": {
    "type": "dashboard"
  }
}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "meta": {
    "type": "dashboard"
  },
  "data": [
    {
      "id": "company-average-mood",
      "type": "widgets"
    },
    {
      "id": "company-participation",
      "type": "widgets"
    },
    {
      "id": "company-happiness-score",
      "type": "widgets"
    },
    {
      "id": "company-custom-tags",
      "type": "widgets"
    }
    ...
  ]
}

This endpoint returns a set of available widgets for the current user. The set of returned widgets depends on the role of the current user and the optional given type filter.

To get a list with all widgets just request /widgets. If you want to get a list of widgets for the dashboard just request /widgets with type filter.

You can use the returned id’s to request the data for specific widgets with a call to /widgets/:id.

GET META Attributes

Parameter Description
type optional Filter widgets by type

Available filter types

Response META Attributes

Parameter Description
type Type of returned widgets

Response Attributes

Parameter Description
id The widget identifier

Company Average Mood

GET /widgets/company-average-mood HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "company-average-mood",
    "type": "widgets",
    "attributes": {
      "data": [
        {
          "from": "2018-10-29",
          "to": "2018-11-04",
          "participation_ratio": 33,
          "happiness_score": 20
        },
        {
          "from": "2018-11-05",
          "to": "2018-11-11",
          "participation_ratio": 36,
          "happiness_score": 25
        },
        {
          "from": "2018-11-12",
          "to": "2018-11-18",
          "participation_ratio": 40,
          "happiness_score": 19
        },
        {
          "from": "2018-11-19",
          "to": "2018-11-25",
          "participation_ratio": 38,
          "happiness_score": 35
        }
      ]
    }
  }
}

This endpoint returns average mood information for the last four tracking periods of the current users company.

Response Attributes

Parameter Description
from Start date of the tracking period
to End date of the tracking period
participation_ratio Employee participation ratio in percent
happiness_score Average happiness score for the tracking period

Department Average Mood

GET /widgets/department-average-mood HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "department-average-mood",
    "type": "widgets",
    "attributes": {
      "data": [
        {
          "from": "2018-10-29",
          "to": "2018-11-04",
          "participation_ratio": 33,
          "happiness_score": 20
        },
        {
          "from": "2018-11-05",
          "to": "2018-11-11",
          "participation_ratio": 36,
          "happiness_score": 25
        },
        {
          "from": "2018-11-12",
          "to": "2018-11-18",
          "participation_ratio": 40,
          "happiness_score": 19
        },
        {
          "from": "2018-11-19",
          "to": "2018-11-25",
          "participation_ratio": 38,
          "happiness_score": 35
        }
      ]
    }
  }
}

This endpoint returns average mood information for the last four tracking periods of the current users department.

Response Attributes

Parameter Description
from Start date of the tracking period
to End date of the tracking period
participation_ratio Employee participation ratio in percent
happiness_score Average happiness score for the tracking period

Company happiness score

GET /widgets/company-happiness-score HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "company-happiness-score",
    "type": "widgets",
    "attributes": {
      "happiness_score": 20.3,
      "feeling": "ok"
    }
  }
}

This endpoint returns the happiness score widget information for the current period and current user company.

Response Attributes

Parameter Description
happiness_score Happiness score for the current tracking period and current user company.
feeling Can be ‘sad’, 'unhappy’, 'ok’, 'satisfied’ or 'happy’.

Department happiness score

GET /widgets/department-happiness-score HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "department-happiness-score",
    "type": "widgets",
    "attributes": {
      "happiness_score": 20.3,
      "feeling": "ok"
    }
  }
}

This endpoint returns the happiness score widget information for the current period and department of the current user.

Response Attributes

Parameter Description
happiness_score Happiness score for the current tracking period and current user department
feeling Can be 'sad’, 'unhappy’, 'ok’, 'satisfied’ or 'happy’.

Company participation

GET /widgets/company-participation HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "company-participation",
    "type": "widgets",
    "attributes": {
      "moods_count": 2,
      "employee_amount": 10,
      "participation_in_percent": 20,
      "moods_details": [
        { "feeling": "sad", "percent": 50, "count": 1 },
        { "feeling": "happy", "percent": 50, "count": 1 }
      ]
    }
  }
}

This endpoint returns participation statistics for the current users company and the current tracking period.

Response Attributes

Parameter Description
moods_count Amount of moods in current tracking period for current user company.
employee_amount Current user company total employee amount
participation_in_percent Participation in percent
moods_details An array of objects with details for each mood group.

Department participation

GET /widgets/department-participation HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "department-participation",
    "type": "widgets",
    "attributes": {
      "moods_count": 2,
      "employee_amount": 10,
      "participation_in_percent": 20,
      "moods_details": [
        { "feeling": "sad", "percent": 50, "count": 1 },
        { "feeling": "happy", "percent": 50, "count": 1 },
      ]
    }
  }
}

This endpoint returns participation statistics for the current users department and the current tracking period.

Response Attributes

Parameter Description
moods_count Amount of moods in current tracking period for current user department.
employee_amount Current user department total employee amount
participation_in_percent Participation in percent
moods_details An array of objects with details for each mood group

Company custom tags

GET /widgets/company-custom-tags HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "company-custom-tags",
    "type": "widgets",
    "attributes": {
      "total_moods_count": 3,
      "custom_tag_details": [
        {
          "custom_tag_id": "7efea556-461e-8f1c-8a9b-f7559f2aedb",
          "moods_count": 2,
          "feeling_details": [
            { "name": "unhappy", "percent": 50.0, "moods_count": 1 },
            { "name": "sad", "percent": 50.0, "moods_count": 1 }
          ]
        },
        {
          "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
          "moods_count": 1,
          "feeling_details": [
            { "name": "ok", "percent": 100.0, "moods_count": 1 },
          ]
        }
      ]
    }
  }
}

This endpoint returns the custom tag widget (Top X custom tags) data for the current user company and the current tracking period. The response doesn’t include custom tags or feelings where no moods has been given in the current tracking period. The custom_tag_details attribute will be an empty Array if no custom tag has any moods.

Response Attributes

Parameter Description
total_moods_count Total amount of moods in current tracking period for current user company.
custom_tag_details An Array of objects with mood details for each custom tag.
custom_tag_details[custom_tag_id] ID of the custom tag.
custom_tag_details[moods_count] Amount of given moods for the custom tag.
custom_tag_details[feeling_details] An Array of objects with details for each feeling where moods exist.
custom_tag_details[feeling_details][name] The identifier of the feeling.
custom_tag_details[feeling_details][percent] Percentage of total given moods for the current custom tag.
custom_tag_details[feeling_details][count] Amount of moods given for the current feeling and custom tag.

Department custom tags

GET /widgets/department-custom-tags HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "department-custom-tags",
    "type": "widgets",
    "attributes": {
      "total_moods_count": 10,
      "custom_tag_details": [
        {
          "custom_tag_id": "f7559f2a-8f1c-461e-8a9b-7efea5564edb",
          "moods_count": 6,
          "feeling_details": [
            { "name": "ok", "percent": 50.0, "count": 3 },
            { "name": "happy", "percent": 50.0, "count": 3 }
          ]
        },
        {
          "custom_tag_id": "7efea556-461e-8f1c-8a9b-f7559f2aedb",
          "moods_count": 4,
          "feeling_details": [
            { "name": "sad", "percent": 50.0, "count": 2 },
            { "name": "unhappy", "percent": 50.0, "count": 2 }
          ]
        }
      ]
    }
  }
}

This endpoint returns the custom tag widget (Top X custom tags) data for the current user department and the current tracking period. The response doesn’t include custom tags or feelings where no moods has been given in the current tracking period.

Response Attributes

Parameter Description
total_moods_count Total amount of moods in current tracking period for current user department.
custom_tag_details An Array of objects with mood details for each custom tag.
custom_tag_details[custom_tag_id] ID of the custom tag.
custom_tag_details[moods_count] Amount of given moods for the custom tag.
custom_tag_details[feeling_details] An Array of objects with details for each feeling where moods exist.
custom_tag_details[feeling_details][name] The identifier of the feeling.
custom_tag_details[feeling_details][percent] Percentage of total given moods for the current custom tag.
custom_tag_details[feeling_details][count] Amount of moods given for the current feeling and custom tag.

Rankings

GET /widgets/rankings HTTP/1.1
Host: api.company-mood.com
Content-Type: application/json
Accept: application/vnd.company-mood-v2+json
Authorization: Bearer 795665b4-53da-468c-a0d7-ab2d82e58406
X-App-Token: 27f50875-9a43-4d6c-a376-6968f09858db
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": {
    "id": "rankings",
    "type": "widgets",
    "attributes": {
      "company_wide_ranking": 23,
      "company_employee_amount": 120,
      "department_wide_ranking": 12,
      "department_employee_amount": 30
    }
  }
}

The /widgets/rankings endpoint returns the ranking data for the current user.

Response Attributes

Parameter Description
company_wide_ranking Current user rank of all company employees. 0 if not available.
company_employee_amount Employee amount of current user company.
department_wide_ranking Current user rank of all. 0 if not available.
department_employee_amount Employee amount of current user department. 0 if not available.