Skip to content

Quick Setup

Setting up conversational reporting using quick setup for interactions

Warning

This functionality is only available for Giosg Partners or Giosg Resellers. If you want to become a Giosg Partner/Reseller please contact us at support@giosg.com.

Conversational reporting can be set up using quick setup. This endpoint requires:

  • User id of a user that will receive notifications to giosg Groups
  • Interaction id which workflows will be tracked.
  • Target Level threshold.
  • Email address to which notifications will be sent.

When sending this information to this endpoint the following steps will be triggered:

  1. The customers UUID will be checked whether this is a customer within Giosg, the organization UUID will also be returned to be used further creating the Giosg channel required;

  2. A Conversational Reporting workflow named "Lead Forms" will be created;

  3. A Conversational Reporting target named "Amount of leads per day" will be created including the reporting query for the interaction metrics;

  4. A Giosg for mobile channel will be created for the Users Organization and named "Reporting Channel";

  5. The given user will be attached to the "Reporting Channel" in giosg;

  6. E-Mail channels will be setup for all given E-Mails;

  7. A quicksetup object will be created to give the partner a quick teardown possibility.

Warning

When deleting a Quick Setup, the process will revert all changes made from point 6 to point 1 of the above process within giosg systems before removing the quick setup object. Be very certain when removing an object.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import requests

GIOSG_SERVICE_BASE_URL = "https://api.giosg.com"
token = "<giosg account token>"
organization_id = "<uuid>"

def get_quick_setups():
    response = requests.get(
        "{}/api/objectives/v1/orgs/{}/setup/interaction".format(GIOSG_SERVICE_BASE_URL, organization_id),
        headers={'Authorization': 'Token ' + token})
    response.raise_for_status()
    return response.json()
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests

GIOSG_SERVICE_BASE_URL = "https://api.giosg.com"
token = "<giosg account token>"
organization_id = "<uuid>"
customer = "<uuid>"
interaction_id = "<uuid>"
target_level_threshold = "<number>"
reporting_mail = "<email_address>"

json = {
    "customer": customer
    "interaction_id": interaction_id
    "threshold": target_level_threshold
    "reporting_mail": reporting_mail
}

def create_quick_setup():
    response = requests.post(
        "{}/api/objectives/v1/orgs/{}/setup/interaction".format(GIOSG_SERVICE_BASE_URL, organization_id),
        headers={'Authorization': 'Token ' + token},
        json=json)
    response.raise_for_status()
    return response.json()
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import requests

GIOSG_SERVICE_BASE_URL = "https://api.giosg.com"
QUICK_SETUP = "<quick_setup_uuid>"
token = "<giosg account token>"
organization_id = "<uuid>"

def remove_quick_setup():
    response = requests.delete(
        "{}/api/objectives/v1/orgs/{}/setup/interaction/{}".format(GIOSG_SERVICE_BASE_URL, organization_id, QUICK_SETUP),
        headers={'Authorization': 'Token ' + token},
        json=json)
    response.raise_for_status()
    return response.json()

Setting up more controlled conversational reporting using quick setup

You can set up any number of workflows with any number of targets and notifications with one single API. For simplicity, the following query creates one workflow with one target that sends the notifications to one giosg group chat, one email and one slack channel.

Notice

The Giosg Mobile (BAR) notification setting now has a is_private field included, this field will dictate whether the group is private or not when this group is being created. The default is true.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  "workflows": [
    {
      "name": "Workflow 1 name",
      "description": "Description of the workflow",
      "targets": [
        {
          "name": "A Target name",
          "reporting_query": {
            "granularity": "all",
            "group_by": ["organization_id"],
            "vendor": "com.giosg.chat",
            "aggregations": ["count"],
            "filters": {
              "type": "and",
              "fields": [
                {
                  "type": "selector",
                  "dimension": "category",
                  "value": "shopping-cart"
                }
              ]
            }
          },
          "reporting_threshold": 10000,
          "reporting_field": "count",
          "period": "P1W",
          "notification_period": "P1D",
          "notifications": [
            {
              "type": "bar",
              "name": "Name",
              "description": "A description",
              "is_private": false
            },
            {
              "type": "email",
              "email": "<email adress>"
            },
            {
              "type": "slack",
              "incoming_webhook_url": "<webhook_url>"
            }
          ]
        }
      ]
    }
  ]
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import requests

GIOSG_SERVICE_BASE_URL = "https://api.giosg.com"
token = "<giosg account token>"
organization_id = "<uuid>"
json = "<insert above dictionary here>"

def create_quick_setup():
    response = requests.post(
        "{}/api/objectives/v1/orgs/{}/setup/system".format(GIOSG_SERVICE_BASE_URL, organization_id),
        headers={'Authorization': 'Token ' + token},
        json=json)
    response.raise_for_status()
    return response.json()

Endpoints used in this tutorial

  1. POST https://api.giosg.com/api/objectives/v1/orgs/<organization_id>/setup/interaction
  2. POST https://api.giosg.com/api/objectives/v1/orgs/<organization_id>/setup/system