samagra-comms / uci-apis

Unified Communications Interface (UCI) is a system that powers governments to create and manage conversations with citizens and with its own officials. Through UCI governments can seamlessly setup simple and complex conversations using a multi-channel approach. UCI aims to democratize the use of different communication channels such as WhatsApp, Telegram, SMS, email for governance use cases through a standard configurable manner that is reusable and scalable across all governance use cases.
12 stars 30 forks source link

Create endpoint for fetching Cassandra data related to bots notification #199

Closed chinmoy12c closed 1 year ago

yuvrajsab commented 1 year ago

@chinmoy12c This is the response we are expecting.

[
  {
    "bot": {
      "id": "23293u42309423eacsdfsdf",
      "segment_url": "http://103.154.251.109:8070/segments/1/mentors?deepLink=nipunlakshya://chatbot",
      "name": "Video Samiksha",
      "form_id": "video_samiksha",
      "type": "conversation"
    },
    "success": [
      "121212",
      "12234234234",
      "2323423"
    ],
    "failure": [
      "123"
    ]
  },
  {
    "bot": {
     "id": "23293u42309423eacsdfsdf",
      "segment_url": "http://103.154.251.109:8070/segments/1/mentors?deepLink=nipunlakshya://chatbot",
      "name": "Video Samiksha",
      "form_id": "video_samiksha",
      "type": "broadcast"
    },
    "success": [
      "2323"
    ],
    "failure": [
      "23223"
    ]
  }
]
yuvrajsab commented 1 year ago

We need two apis.

  1. Get bot details.
    {
    "bot": {
      "id": "23293u42309423eacsdfsdf",
      "name": "Video Samiksha",
      "segment_url": "http://103.154.251.109:8070/segments/1/mentors?deepLink=nipunlakshya://chatbot",
      "form_id": "video_samiksha",
    }
    }

Tracked in #206

  1. delta API for fetching success and failure notifications for a given bot.
    {
    "next_page": "urlurlurlurlurl",
    "success": [
      "121212",
      "12234234234",
      "2323423"
    ],
    "failure": [
      "123"
    ]
    }

Tracked in: https://github.com/samagra-comms/inbound/issues/88

karntrehan commented 1 year ago

@chinmoy12c to upload a mock for @yuvrajsab to integrate and use.

chinmoy12c commented 1 year ago

Sharing the curl for both endpoints:

Broadcast bot config:

curl --location 'http://localhost:3002/admin/bot/f5222361-5825-47c0-9eef-1577db30f843/config' \
--header 'admin-token: {admin-token}'

Broadcast bot report:

curl --location 'http://localhost:3002/admin/bot/334c9fc0-5033-40ab-9708-1045c1d4961f/broadcastReport?nextPage=GgAKODAwNjQyNzI3NAAACjk4NzY1NDMyMTAACgAIAAABiE3tVlTwf__4L_B____3&limit=10000' \
--header 'admin-token: {admin-token}'