Skip to content

Generate config template

The purpose of this API endpoint is to is to generate the necessary data to create a new communication channel configuration entry. Each configuration has a unique key and is associated with a user.

It is nothing more than a key-value system stored in the database, where the value is JSON-type content.

Each user can have their own chat settings and this makes Superchat a multi tenant application. Or multi departments, depending on the use you plan to make of it.

You can have several communication channel configurations, such as Whatsapp, SMS, Telegram and others, thus making Superchat a truly omni channel solution.

Info

This API call only generates a series of information to facilitate the creation of the configuration, it does not save anything in the database's configs table.

Requirements

Datasheet

  • Requires authentication

    Yes

  • Data to be returned

    application/json

Steps

Generate new configuration

  • Open the configs endpoint and choose Generate Config and to try it out Interactive - Go to endpoint

  • Run the command Interactive - Generate config

  • The result will be something like Interactive - Create user result

  • Execute:
    curl -X 'POST' \
    'http://localhost/api/v1/configs/generate/integration' \
    -H 'accept: application/json' \
    -H 'Authorization: Bearer ACCESS_TOKEN' \
    -H 'Content-Type: application/json' \
    -d '{
    "handson_plugin": "tiledesk",
    "channel_plugin": "gupshupwhatsapp",
    "label": "Gupshup whatsapp with Tiledesk handson to human operator",
    "webhook_base_url": "https://you.lt.superchat.com.br",
    "speech_name": "Empresa de demonstração",
    "speech_name_genre": "a"
    }'
    
  • Expected outcome:
     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
    50
    51
    52
    53
    54
    55
    56
    57
    58
    {
        "handson_webhook_url": "https://you.lt.superchat.com.br/api/v1/webhooks/cklv8qzo1000r0cs1q0klt1vb/tiledesk-ckm86efhr000i0aqyhrpuqj6v/handson/json",
        "channel_webhook_url": "https://you.lt.superchat.com.br/api/v1/webhooks/cklv8qzo1000r0cs1q0klt1vb/tiledesk-ckm86efhr000i0aqyhrpuqj6v/channel/json",
        "config": {
            "label": "Gupshup whatsapp with Tiledesk handson to human operator",
            "key": "tiledesk-ckm86efhr000i0aqyhrpuqj6v",
            "value": {
            "active": true,
            "channel": {
                "app": "GUPSHUP_APP_NAME",
                "uid": "GUPSHUP_WHATSAPP_PHONENUMBER",
                "user": "",
                "password": "",
                "extra": {},
                "apikey": "GUPSHUP_API_KEY",
                "module": "app.lib.channels.gupshupwhatsapp",
                "plugin": "gupshupwhatsapp",
                "channel": "whatsapp",
                "plugins": {
                    "in": [
                        {
                            "id": "optin_telegram",
                            "extra": {
                                "signup_url": "https://web.telegram.org"
                            },
                            "order": 0,
                            "module": "app.lib.channels.plugins.in.optin_telegram",
                            "execute": "once",
                            "description": "Optin for Telegram channel"
                        }
                    ],
                    "out": [],
                    "contact": {
                        "extra": {},
                        "default": {
                            "id": "ckkoibtlh000072xu98aqqm1r",
                            "extra": {},
                            "module": "app.lib.channels.plugins.contacts.default",
                            "description": "Get minimal contact info"
                        }
                    }
                }
            },
            "handson": {
                "url": "https://api.tiledesk.com",
                "module": "app.lib.handson.tiledesk",
                "plugin": "tiledesk",
                "channel": "tiledesk",
                "project_id": "TILEDESK_PROJECT_ID",
                "allow_newchat": false,
                "shared_secret": "TILEDESK_SHARED_SECRET"
            },
            "speech_name": "Empresa de demonstração",
            "speech_name_genre": "a"
            },
            "status": 1
        }
    }