Mission-Prerna / uci-chatbot-helper

NL system helper APIs to run a UCI powered Chatbot in the NL app
0 stars 0 forks source link

(Samwad)Creating segment within Samwad Admin Panel #28

Closed karntrehan closed 3 weeks ago

karntrehan commented 1 month ago

As an admin I can send an outbound message to all teachers or geographical segments.

Refer to the 4th point of PRD and mockups

https://docs.google.com/document/d/1YDa282_wqMBW2XipiMEecck0ivroh9QPkyUGEkwSIJo/edit

UCI FE

NL BE

karntrehan commented 1 month ago

Get segment filters

API:

@GET(/segment-filters)

Query Params:

^ All optional

Response:

{
  "actors": [
    {
      "id": "1",
      "label": "Teacher"
    },
    {
      "id": "2",
      "label": "Mentor"
    }
  ],
  "districts": [
    {
      "id": "1",
      "label": "Agra"
    },
    {
      "id": "2",
      "label": "Unao"
    }
  ],
  "blocks": [
    {
      "id": "1",
      "label": "Aaspur Devsara"
    },
    {
      "id": "2",
      "label": "Abholi"
    }
  ],
  "schools": [
    {
      "id": "9430702904",
      "label": "P S VAJEERPUR"
    },
    {
      "id": "09112900802",
      "label": "Local Body (Basic Shiksha Paraishad )"
    }
  ]
}
karntrehan commented 1 month ago

Create segment

API:

@POST(/segment-filters/create)

Body:

{
  "actors": "1",
  "districts": "3,7",
  "blocks": "9,10,21,11",
  "schools": "U1,U8,U9",
  "name": "Segment for teacher training",
  "description": "Segment for teacher training"
}
{
  "actors": "1,9",
  "districts": "3,7",
  "blocks": "9,10,21,11",
  "schools": "-1",
  "name": "Segment for teacher training All schools",
  "description": "Segment for teacher training"
}

^ All mandatory

Response:

{
  "segment_id": 1
}
{
  "error_code": "",
  "error_message": ""
}
Ajay-Maury commented 1 month ago

For API: @POST(/segment-filters/create)

and in the API body payload expecting actors , districts , blocks , and schools as an array instead of comma-separated string

cc:- @karntrehan @ankitmlesmagico

AakashSatpute119 commented 1 month ago
karntrehan commented 3 weeks ago

Release getting tracked in https://github.com/Mission-Prerna/prerna-lakshya-app/issues/486