AI Studio Resource Centre
Api referencesContacts

Website Contacts & Meta Data

This section contains the Leads and Chat API references

Get the essentials first!

To use the S10U APIs, You need to insure that you have following details with you.

A. UUID - You can get the UUID from the local web session storage as show in the image below:

🖼️ Image placeholder: /images/image-44-48879b5d.png How to get the UUDI

B. Bot ID & User ID: One can get the Bot ID and User ID from your Bot Script or Bot page URL. Below is the sample Example.

For Chatbot page URL

// Chatbot Page URL Structure

https://page.s10u.online/BotId/CustomerId

// The first value after .com is the BotId and second value is the CustomerId.

For Chatbot Script

// Chatbot Script Structure

<script id="S10U-messenger-widget" src="https://cdn.s10u.online/S10U.js" defer>BotId,CustomerId</script>

// The first value after defer> is the BotId & second value is the CustomerId.

C. Auth Token: We haven't automated everything yet. Please contact our support team to get the same.

Now you are ready to run the POC

API References

Please use the below APIs in order to play with your leads and chat data.

Create a lead in the S10U

As soon as any user opens up the Bot, It creates one UUId; pass the same along with the other required details to create and update the lead's details.

API to update a chat/lead data

PUT https://api.v7.express-chat.ai/inbox/direct/lead

As soon as any user opens up the Bot, It creates one UUId; pass the same along with the other required details to create and update the lead's details.

Headers

NameTypeDescription
x-bp-token*StringAPI Token

Request Body

NameTypeDescription
uuid*StringUnique ID of a chat user
botId*StringUnique ID of the bot
customerId*StringUnique ID of the customer account
agentIdBooleanUnique ID of the agent assigned
statusStringValid status for the chat. Available values: 'OPEN', 'INPROGRESS', 'REVIEW', 'ONHOLD', 'DEPENDANCY', 'CLOSED'
pictureStringA valid image HTTP URL
nameStringName of the lead
emailStringEmail of the lead
phoneStringPhone number of the lead
dialCodeStringDial Code including "+" sign
notesArray<{title: string, description: string}>Additional notes for the chat
tagsArray<String>Additional tags for the chat
attributesArray<{key: string, value: string}>Custom attributes for the chat
{
    "success": true,
    "message": "ok",
    "code": 200
}
{
    // Response
}
{
    // Response
}

Get leads listing and Its meta data

To get the listing of the leads and its meta data, Hit the below API with mandatory details.

API to get listing of chats/leads

GET https://api.v7.express-chat.ai/inbox/direct/chats

To get the listing of the leads and its meta data, Hit the below API with mandatory details.

Query Parameters

NameTypeDescription
botId*StringUnique ID of the bot
customerId*StringUnique ID of the customer account
page*StringPage number
type*String"lead" to fetch only leads
"non-lead" to fetch non lead chats

Headers

NameTypeDescription
x-bot-token*StringAPI Token
{
    "success": true,
    "message": "ok",
    "data": [
        {
            "_id": "63d9ffa77a8d152facbe2f2f",
            "uuid": "7e88d192-9b20-4035-9b68-d4ac3d58a34f",
            "createdAt": "2023-02-01T05:59:03.533Z",
            "isOnline": false,
            "lastMessage": {
                "at": "2023-02-01T06:00:20.000Z",
                "by": "bot",
                "text": "Welcome to S10U. I am here to help you."
            },
            "lastSeenAt": "2023-02-01T06:00:21.000Z",
            "profile": {
                "notes": [
                    {
                        "title": "Sample title",
                        "description": "Sample description",
                        "_id": "63db5c4abcbc3be2e95b20ae"
                    }
                ],
                "userDetails": {
                    "name": "Sample name",
                    "picture": "my-picture",
                    "contact": {
                        "email": "Sample email",
                        "phone": {
                            "number": "Sample number",
                            "prefix": "91"
                        }
                    },
                    "city": "Sample city",
                    "country": "Sample country",
                    "gender": "MALE",
                    "tags": [
                        "Sample tag"
                    ],
                    "attributes": [
                        {
                            "key": "ID",
                            "value": "BP001"
                        }
                    ]
                }
            },
            "status": "INPROGRESS",
            "updatedAt": "2023-02-02T06:46:34.119Z",
            "websiteVisits": 1,
            "_agentAssigned": "631aa793bcfa100487d13d0d"
        }
    ],
    "code": 200
}
{
    // Response
}
{
    // Response
}

❓ Got any questions?

If you have any questions, you can look into our repository of FAQs, most likely, you will find your answer here, If not, write us at production@S10U.co.za

On this page