Skip to content

Create config

The purpose of this API endpoint is to create create a new config entry. Each config item 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.

The application uses the settings associated with the user at various stages of its operation.

Requirements

Datasheet

Steps

Create new config entry

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

  • Run the command Interactive - Create config

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

  • Execute:
    curl -X 'POST' \
    'http://localhost/api/v1/configs/' \
    -H 'accept: application/json' \
    -H 'Authorization: Bearer ACCESS_TOKEN' \
    -H 'Content-Type: application/json' \
    -d '{
    "label": "Gupshup whatsapp with Tiledesk handson to human operator",
    "key": "tiledesk-ckm86efhr000i0aqyhrpuqj6v",
    "value": {
        "active": true,
        "channel": {
        "app": "superchatgupshupapi",
        "uid": "9XXXXXXXXXX4",
        "user": "",
        "password": "",
        "extra": {},
        "apikey": "6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX2",
        "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": "6XXXXXXXXXXXXXXXXXXXXXXX8",
        "allow_newchat": false,
        "shared_secret": "21eXXXXX-XXXX-XXXX-XXXX-fXXXXXXXXXXX0"
        },
        "speech_name": "Empresa de demonstração",
        "speech_name_genre": "a"
    },
    "status": 1
    }'
    
  • 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
    {
      "label": "Gupshup whatsapp with Tiledesk handson to human operator",
      "key": "tiledesk-ckm86efhr000i0aqyhrpuqj6v",
      "value": {
        "active": true,
        "channel": {
          "app": "superchatgupshupapi",
          "uid": "9XXXXXXXXXX4",
          "user": "",
          "extra": {},
          "apikey": "6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX2",
          "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"
              }
            }
          },
          "password": ""
        },
        "handson": {
          "url": "https://api.tiledesk.com",
          "module": "app.lib.handson.tiledesk",
          "plugin": "tiledesk",
          "channel": "tiledesk",
          "project_id": "6XXXXXXXXXXXXXXXXXXXXXXX8",
          "allow_newchat": false,
          "shared_secret": "21eXXXXX-XXXX-XXXX-XXXX-fXXXXXXXXXXX0"
        },
        "speech_name": "Empresa de demonstração",
        "speech_name_genre": "a"
      },
      "status": 1,
      "id": "ckn7x37n000081xoj3317xau1",
      "owner_id": "cklv8qzo1000r0cs1q0klt1vb"
    }