curl --location '{{HOST-URL}}/health'
Response:
{
"status": "ok",
"info": {
"database": {
"status": "up"
}
},
"error": {},
"details": {
"database": {
"status": "up"
}
}
}
curl --location '{{HOST-URL}}/segments' \
--header 'conversation-authorization: <admin-token>'
Response:
[
{
"id": 1,
"name": "Test 1",
"description": "Test 1 segmentation",
"created_at": "2023-03-03T09:40:01.711Z",
"updated_at": "2023-03-03T09:40:17.376Z"
},
{
"id": 2,
"name": "Test 2",
"description": "Test 2 segmentation",
"created_at": "2023-04-12T10:59:54.615Z",
"updated_at": "2023-04-12T10:59:54.615Z"
}
]
curl --location '{{HOST-URL}}/segment-bot-mapping' \
--header 'conversation-authorization: <admin-token>' \
--header 'Content-Type: application/json' \
--data '{
"botId":"0f90a738-768d-4cd6-91e1-e66a3b8be508",
"segmentId":1
}'
Response:
{
"data": {
"insert_segment_bots_one": {
"id": 9,
"segment_id": 2,
"bot_id": "93abe780-ab8a-4619-a0da-8f4f16156231",
"created_at": "2023-03-07T07:26:38.738862+00:00"
}
}
}
curl --location '{{HOST-URL}}/segments/{:segmentId}/mentors?title=Test%20Title&deepLink=https%3A%2F%2Fgoogle.com&limit=1&offset=0&description=Test%20description' \
--header 'conversation-authorization: <admin-token>'
fcmClickActionUrl
in the response body)Response:
{
"data": [
{
"fcmToken": "xxxx",
"phoneNo": "xxxx",
"name": "xxxx",
"title": "Test Title",
"description": "Some Description",
"fcmClickActionUrl": "https://google.com"
}
]
}
curl --location '{{HOST-URL}}/segments/{:segmentId}/mentors/count' \
--header 'conversation-authorization: <admin-token>'
Response:
{
"totalCount": 37
}
curl --location '{{HOST-URL}}/segment/phone' \
--header 'conversation-authorization: <admin-token>' \
--header 'Content-Type: application/json' \
--data '{
"segment_name":"Test segment",
"segment_description":"Test segments description",
"phone_numbers":["1234567890"]
}'
phone_numbers
contains multiple mentors number in an arraycurl --location '{{HOST-URL}}/v2/segment-bot-mapping' \
--header 'conversation-authorization: <admin-token>' \
--header 'Content-Type: application/json' \
--data '
{
"botId": "0f90a738-768d-4cd6-91e1-e66a3b8be508",
"segmentId": "1,2"
}
'
segmentId
contains multiple segments ids in a comma-separated stringcurl --location '{{HOST-URL}}/v2/segments/{:segmentIds}/mentors' \
--header 'conversation-authorization: <admin-token>'
segmentIds
are comma-separated segments IdsfcmClickActionUrl
in the response body)Response:
{
"data": [
{
"fcmToken": "xxxx",
"phoneNo": "xxxx",
"name": "xxxx",
"title": "Test Title",
"description": "Some Description",
"fcmClickActionUrl": "https://google.com"
}
]
}
curl --location '{{HOST-URL}}/v2/segments/{:segmentIds}/mentors/count' \
--header 'conversation-authorization: <admin-token>'
segmentIds
are comma-separated segments IdsResponse:
{
"totalCount": 439389,
"segment_id": {
"1": 37,
"2": 439352
}
}
.env
& configure the variables as needed. (refer sample.env
for format)docker-compose up -d
Ensure to replace <admin-token>
in the headers with your actual admin token for authorization.