Can`t send multiple messages to Chatbase from PHP code

99 views Asked by At

Trying to send two messages in Chatbase, in same request, like this:

{
    "messages" : [{
            "api_key" : "XXX",
            "type" : "user",
            "user_id" : 1287,
            "time_stamp" : 1544782312,
            "platform" : "Telegram",
            "message" : "",
            "intent" : "Screen2",
            "version" : "1.1"
        }, {
            "api_key" : "XXX",
            "type" : "agent",
            "user_id" : 1287,
            "time_stamp" : 1544782312,
            "platform" : "Telegram",
            "intent" : "Screen2",
            "version" : "1.1"
        }
    ]
}

But get response error

{
    "reason" : "Error fetching parameter 'user_id': Field was empty.",
    "status" : 400
}

Do you have any thoughts what is wrong here?

1

There are 1 answers

0
Prakhar Agrawal On

I have found the issue with user_id field.

In the Chatbase API the user_id field accepts string type value and you have passed integer type of value in user_id field.