Smiley

Required product: Switch

Smileys are the feedback from people who have contacted a reception.

After the call or chat has ended, the caller will receive an SMS or email asking for feedback on how the conversation went. This feedback is called a smiley.

  1. Properties
  2. Get smileys
  3. Get smiley statistics

Smiley properties

Name Description
id
{"id":1}
Smiley ID.
call_uuid [Deprecated] The UUID of the conversation, if it was a call.
conversation_type
{"conversation_type":"chat"}
{"conversation_type":"call"}
The type of conversation.
conversation_uuid
{"conversation_uuid":"218ec3b2-6403-11e7-2bbf-9da5cece18a5"}
The UUID of the call or chat.
rated_at
{"rated_at":"2014-11-12T16:14:33+01:00"}
The time the smiley was given in ISO-8601.
sort_value
{"sort_value":"2014-11-12T16:14:33+01:00"}
Same as rated_at.
rating
{"rating":1}
The rating itself.
0
Angry smiley
1
Happy smiley
net_promoter_score
{"net_promoter_score":0}
{"net_promoter_score":5}
{"net_promoter_score":8}
{"net_promoter_score":10}
The rating as NPS. A value between 0 and 10 (inclusive)
kind
{"kind":"negative"}
Human-readable version of net_promoter_score
negative
Angry smiley
neutral
Neutral smiley
positive
Happy smiley
emoji Emoji version of net_promoter_score.
negative
👎
neutral
🤷
positive
👍
comment
{"comment":"Very nice people."}
{"comment":null}
Free text that the caller can write. If the user did not specify text, this will be null
number
{"number":"4571999999"}
The number of the caller, if the conversation was a call.
number_formatted
{"number_formatted":"71 99 99 99"}
The number of the caller formatted for readability.
email
{"email":"peter@example.com"}
The email of the caller, if the conversation was a chat.
contact
{"contact":{"id":1,"name":"Relatel A/S","number":"4571999999","number_formatted":"71 99 99 99","email":"kundeservice@relatel.dk"}}
The full contact object. See the Contact for properties.
endpoint
{"endpoint":"Reception#2"}
{"endpoint":"ChatReception#3"}
The name of the Endpoint that was contacted.
reception_id
{"reception_id":4}
[Deprecated] The ID of the Reception that was contacted.
employee_id
{"employee_id":432}
The ID of the Employee that handled the conversation.
call_recording
{"call_recording":{"id":234,"started_at":"2014-11-12T16:10:02+01:00","duration":101,"sound":{"formats":["audio/mpeg"],"url":"https://app.relatel.dk/api/v2/call_recordings/234/sound"}}}
An object containing information about a call recording.

Get smileys

Get smileys. Filter with these parameters.

Name Description Example
limit Number of Smileys returned.
default: 10, max: 100
2
number Number on caller. Only return smileys given by this number. 4571999999
rated_at_lt_or_eq Return smileys where rated_at is less than or equal to this. Given in ISO 8601. 2014-11-12T16:14:33+01:00
rated_at_gt_or_eq Return smileys where rated_at is greater than or equal to this. Given in ISO 8601. 2014-11-12T16:14:33+01:00
endpoint Return smileys related to this Endpoint name. Reception#2
reception_id [Deprecated] Return smileys related to this Reception ID. 2
employee_id Return smileys related to this Employee ID. 3
rating Return smileys with this rating.
0: Angry smiley, 1: Happy smiley
0 1
commented If this parameter is given (with any value), only return smileys that has a comment. 1

The paramters are all optional, and can be mixed and matched.

For example; give me all smileys given to Employee with ID 55, that are “happy” and have a comment.

GET /api/v2/smileys

Response

Status: 200 OK
{
  "smileys": [
    {
      "id": 2,
      "call_uuid": "218ec3b2-6403-11e7-2bbf-9da5cece18a5",
      "conversation_type": "call",
      "conversation_uuid": "218ec3b2-6403-11e7-2bbf-9da5cece18a5",
      "rated_at": "2014-11-12T16:14:33+01:00",
      "sort_value": "2014-11-12T16:14:33+01:00",
      "rating": 1,
      "net_promoter_score": 9,
      "kind": "positive",
      "comment": "A nice experience.",
      "number": "4571999999",
      "emoji": "👍",
      "number_formatted": "71 99 99 99",
      "email": null,
      "contact": {
        "id": 3277849,
        "number": "4571999999",
        "number_formatted": "71 99 99 99",
        "name": "John Doe",
        "email": "doe@example.com"
      },
      "employee_id": 123,
      "endpoint": "Reception#2",
      "reception_id": 2,
      "call_recording": {
        "id": 234,
        "started_at": "2014-11-12T16:10:02+01:00",
        "duration": 101,
        "sound": {
          "formats": [
            "audio/mpeg"
          ],
          "url": "https://app.relatel.dk/api/v2/call_recordings/234/sound"
        }
      }
    }
  ]
}

Get smiley statistics

Get statistics for a given period.

URL parameters

Name Description Example
from_time [Required] The ISO 8601 representation of wanted start of time interval. 2014-11-12T16:14:33+01:00
to_time [Required] The ISO 8601 representation of wanted end of time interval. 2014-11-14T16:14:33+01:00
endpoint If given, only calculate statistics for the Endpoint with this name. Reception#2 ChatReception#3
reception_id [Deprecated] If given, only calculate statistics for the Reception with this ID. 2
employee_id If given, only calculate statistics for the Employee with this ID. 4

Response properties

Name Description
smiley_requests_count
{"smiley_requests_count":10}
The count of requested smileys.
smileys_count
{"smileys_count":4}
The count of given smileys.
positive_smileys_count
{"positive_smileys_count":2}
The count of positive smileys.
negative_smileys_count
{"negative_smileys_count":2}
The count of negative smileys.
commented_smileys_count
{"commented_smileys_count":4}
The count of commented smileys regardless of rating.
average_rating
{"average_rating":0.75}
The average of all given smileys. A number between 0 and 1.
GET /api/v2/smileys/statistics?from_time=:from_time&to_time=:to_time

Response

Status: 200 OK
{
  "statistics": {
    "receptions": [
      {
        "id": 2,
        "endpoint": "Reception#2",
        "smileys_count": 40,
        "positive_smileys_count": 38,
        "negative_smileys_count": 2,
        "commented_smileys_count": 20,
        "smiley_requests_count": 100,
        "average_rating": 0.95,
        "employees": [
          {
            "id": 441,
            "average_rating": 0.95,
            "smileys_count": 40,
            "positive_smileys_count": 38,
            "negative_smileys_count": 2,
            "commented_smileys_count": 20
          }
        ]
      }
    ]
  }
}