How to send welcome messages using the Viber API

208 Views Asked by At

I'm trying to send a welcome message to the particular contact number using Viber API. Can someone please help me to achieve this?? Here is what I have tried so far...

  • I did setup my webhook using this https://pipedream.com/
  • after that, I called these API endpoints as mentioned on Viber docs

https://chatapi.viber.com/pa/conversation_started

{
    "sender": {
        "name": "John McClane",
        "avatar": "http://avatar.example.com"
    },
    "tracking_data": "tracking data",
    "type": "picture",
    "text": "Welcome to our bot!",
    "media": "http://www.images.com/img.jpg",
    "thumbnail": "http://www.images.com/thumb.jpg"
}
  • I got this Postman response which was a successful response
{
    "about": "Pipedream is the fastest way to connects APIs. Build and run workflows with code-level control when you need it — and no code when you don't.",
    "event_id": "2RszjQbXgUMjhRghbTkc8gQi2A3",
    "workflow_id": "p_6lCDKbo",
    "owner_id": "o_9WIMqv1",
    "deployment_id": "d_V1sQWL36",
    "timestamp": "2023-06-29T15:48:30.167Z",
    "inspect": "https://pipedream.com/@/p_6lCDKbo",
    "quickstart": "https://pipedream.com/quickstart/"
}

But in pipedream callback response, can't find receiver's detail

 {
    "event": {
        "method": "POST",
        "path": "/",
        "query": {},
        "client_ip": "112.134.137.183",
        "url": "https://eokz9uztwdnmzoi.m.pipedream.net/",
        "headers": {
            "host": "eokz9uztwdnmzoi.m.pipedream.net",
            "content-length": "394",
            "content-type": "application/json",
            "user-agent": "PostmanRuntime/7.32.3",
            "accept": "*/*",
            "postman-token": "38508e4f-815e-4a33-85f4-8f37db80ff34",
            "accept-encoding": "gzip, deflate, br"
        },
        "body": {
            "event": {
                "event": "conversation_started",
                "timestamp": 1654990300,
                "type": "open",
                "context": "context information",
                "sender": {
                    "id": "UieTlBq7hUsZKsSMW6QnxA==",
                    "name": "John Doe",
                    "avatar": "https://example.com/avatar.jpg",
                    "country": "US",
                    "language": "en",
                    "api_version": 10
                },
                "subscribed": false
            }
        }
    },
    "context": {
        "id": "2RtBau3KktblUB694cqtt79Hev8",
        "ts": "2023-06-29T17:26:03.015Z",
        "pipeline_id": null,
        "workflow_id": "p_6lCDKbo",
        "deployment_id": "d_V1sQWL36",
        "source_type": "COMPONENT",
        "verified": false,
        "hops": null,
        "test": false,
        "replay": false,
        "owner_id": "o_9WIMqv1",
        "platform_version": "3.41.1",
        "workflow_name": "RequestBin",
        "resume": null,
        "trace_id": "2RtBaswJJdKfideJrvAogh6sDRF"
    }
}

TIA!!

0

There are 0 best solutions below