Output webhook doesn't work

(Евгений Лучинин) #1

Hello I have very simple task – First message is asking users one question, then I need to send conversation to human. I have webhook for sending messages to service Blinger, but messages dent go there. I need help to understand that I am doing everything right from FlowXO side.

Again – basically I need to send all messages to webhook after I ask one question via FloXO.

This is my shared flow – https://flowxo.com/share/p3gypzar

(Andrew Karanda) #2

Look at what he writes in Interactions.
P.s. At Blinger Api, the end point looks like this: https://api.blinger.ru/1.0/
A header should also be specified in the “Make a http request” of the form:
“Authorization”: “your token”
where “your Token” is the Token issued at registration
And you do not send anything to your webhook (since nothing is specified either in the string or in the data field)

(Евгений Лучинин) #3

thanks, here is what flow logs says

Webhook URL
https://api.blinger.ru/telegram_bot_webhook?user_id=813656
HTTP Method
POST
Content Type
JSON
Body
{
“5851cda1dde38a000ca02ded”: {
“channel_id”: 31471495,
“user_id”: 31471495,
“user_handle”: “alyonaruban”,
“user_name”: “Alyona Ruban”,
“user_first_name”: “Alyona”,
“user_last_name”: “Ruban”,
“message_type”: “direct_message”,
“message”: “Chi”,
“response_path”: “5a755d7902532a0034c305ce/c/31471495”,
“bot_id”: “5a755d7902532a0034c305ce”,
“bot_connection_id”: “5a755d7902532a0034c305ce”,
“bot_name”: “1”,
“bot_handle”: “locals rent_bot”,
“bot_user_id”: “locals rent_bot”,
“bot_mention_token”: “@locals rent_bot”,
“bot_type”: “custom_parent”,
“bot_platform”: “telegram”,
“bot_lang”: “en”,
“datetime”: “Sat Feb 03 2018 07:01:14 GMT+0000 (UTC)”,
flowxo_task_name”: “Unrecognised phrase or bot started”
},
“5851d063a1c643000cbdcf0d”: {
“result”: “Alyona”,
flowxo_task_name”: “Get the user’s first name or use a default”
}
}

and the answer is

Status Code
200
Body
error get message

(Daniel Beckett) #4

Hi @11114

It looks like you aren’t matching the expected format for what the Blinger API is expecting. Based on their docs it seems as though you should be sending the request to: https://api.blinger.ru/1.0/SOME-METHOD where the method would be whatever is required from their docs.

In your headers on the request you’ll also need to specify Authorization and Bearer {token_here}. If you’re going to pass values in the URL, e.g. user_id=813656 then you should use the GET method instead of POST.

(Евгений Лучинин) #5

Thanks Daniel. Blinger answered they can get only original telegram request format. It looks like this:

{“update_id”:293198921,“message”:{“message_id”:476,“from”:{“id”:34713977,“is_bot”:false,“first_name”:“Vitali”,“last_name”:“Mikhailouski”,“username”:“for2ne”,“language_code”:“en-BY”},“chat”:{“id”:34713977,“first_name”:“Vitali”,“last_name”:“Mikhailouski”,“username”:“for2ne”,“type”:“private”},“date”:1517920201,“text”:“Hello!”},“user_id”:“154”}

is there any way to make web hook request looks like this?

(Daniel Beckett) #6

You could try a POST request and specify each of fields as a separate data entry, e.g.
first_name {{unrecognised_phrase_or_bot_started.user_first_name}}
last_name {{unrecognised_phrase_or_bot_started.user_last_name}}