NAV
bash javascript

Info

Welcome to the generated API reference. Get Postman Collection

general

Login user and get token

Provide user email and password as a json request

Set Header with Content-Type: application/json and X-Requested-With: XMLHttpRequest

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/login" \
    -H "Content-Type: application/json" \
    -d '{"email":"jhon.doe@email.com","password":"123456"}'
const url = new URL("https://chatbot.meera.ai/api/v1/login");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "email": "jhon.doe@email.com",
    "password": "123456"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "api_token": "Nm91aU9FQTVqdnl0V3NzWA==5ca32fd1d8827"
}

Example response (400):

{
    "status": false,
    "message": "Invalid login details"
}

HTTP Request

POST api/v1/login

Body Parameters

Parameter Type Status Description
email string required User Email Id
password string required Password

Client's Campaign List

Return all campaign details with required campaign-lead fields

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X GET -G "https://chatbot.meera.ai/api/v1/campaign/lists" \
  -H "Content-Type: application/json" \
  -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566"
const url = new URL("https://chatbot.meera.ai/api/v1/campaign/lists");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Success",
    "campaign_data": [
        {
            "campaign_id": 3,
            "campaign_name": "Uni Test Campaign",
            "campaign_type": "live",
            "leads_form_fields": [
                "campaign_id",
                "first_name",
                "last_name",
                "mobile_number",
                "email",
                "external_system_id",
                "registration_date",
                "countrycode",
                "statecode",
                "external_caller_id",
                "agent_name",
                "time_line",
                "program_name"
            ]
        },
        {
            "campaign_id": 4,
            "campaign_name": "EG Campaign",
            "campaign_type": "aged",
            "leads_form_fields": [
                "campaign_id",
                "first_name",
                "last_name",
                "mobile_number",
                "email",
                "external_system_id",
                "registration_date",
                "countrycode",
                "statecode",
                "external_caller_id"
            ]
        }
    ]
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

HTTP Request

GET api/v1/campaign/lists

Response Body Parameter Descriptions

Parameter Value Description
campaign_id Integer Unique Id of Campaign
campaign_name String Campaign Name
campaign_type (aged, live) Campaign Type
leads_form_fields array Required fields with custom script code parameters to import campaign leads.

Post Campaign Leads

Post Campaign Leads data associate with campaign_id

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/campaign-leads/import" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566"\
    -d '[
            {
                "campaign_id": 4,
                "first_name": "NIA",
                "last_name": "MOORE",
                "mobile_number": "+12282437217",
                "external_system_id": 6897022,
                "registration_date": "12/05/2018",
                "countrycode": "US",
                "statecode": "NY",
                "email":"moore@test.com",
                "external_caller_id":"Test1234",
                "source": 323747,
                "agent_name": "Abc",
                "time_line": "23",
                "program_name": "xyz"
            }
        ]'
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/import");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "[{ "campaign_id": 4, "first_name": "NIA", "last_name": "MOORE", "mobile_number": "+12282437217", "external_system_id": 6897022, "registration_date": "12/05/2018", "countrycode": "US", "statecode": "NY", "email":"moore@test.com", "external_caller_id":"Test1234", "source": 323747, "agent_name": "Abc", "time_line": "23", "program_name": "xyz"}, { "campaign_id": 4, "first_name": "Jhon", "last_name": "MOORE", "mobile_number": "+12282437280", "external_system_id": 6897020, "registration_date": "12/05/2018", "countrycode": "US", "statecode": "NY", "email":"jhon@test.com", "external_caller_id":"Test1234", "source": 323747, "agent_name": "Abc", "time_line": "23", "program_name": "xyz" }]"
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Success",
    "duplicate_data": [
       {
            "campaign_id": 4,
            "mobile_number": "+12282437217"
       },
       {
            "campaign_id": 4,
            "mobile_number": "+13214374266"
       }
     ],
    "failed_leads": [
        {
            "campaign_id": 4,
            "mobile_numbers": "+19077644479",
            "missing_fields": [
                "countrycode",
                "statecode"
            ]
        },
        {
            "campaign_id": 4,
            "mobile_numbers": "+14802392959",
            "missing_fields": [
                "countrycode",
                "statecode"
            ]
        }
      ]
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

HTTP Request

POST api/v1/campaign-leads/import

Required Parameters

Parameter Type Status Description
campaign_id integer required Campaign Id
first_name string required First Name of users
last_name string required Last Name of users
mobile_number string required 10 digit mobile number with country code
external_system_id string required External System Id (Unique ID) of the leads from other source. Note: No external system id, pass NA
registration_date string required Lead registered date
countrycode string required 2 character country code eg: US
statecode string required 2 character state code eg: NY
email string optional Email ID of the users
external_caller_id string optional Agent ID
source string optional Source information (eg: SalesForce, HubSpot and etc.)

Required Parameters, if Custom Script Code Present in Campaign

Example :

Parameter (Custom Script Code) Type Description
agent_name string Agent Name
time_line string Time Line
program_name string Program Name

Get Campaign Leads

List all campaign leads and also list campaign leads associate with campaign_id

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X GET -G "https://chatbot.meera.ai/api/v1/campaign-leads/get_data/{campaign_id}" \
  -H "Content-Type: application/json" \
  -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566" 
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/get_data/{campaign_id}");

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Success",
    "total_record": 5828,
    "current_page": 1,
    "total_pages": 6,
    "next_page": "https://chatbot.meera.ai/api/v1/campaign-leads/get_data/4?page=2",
    "prev_page": null,
    "campaign_leads": [
        {
            "lead_id": 6980,
            "external_system_id": "1741423",
            "lead_phone": "+17244802553",
            "first_name": "Alexis",
            "last_name": "Schoedel",
            "client_name": "Uni Test",
            "campaign_id": 4,
            "campaign_name": "EG Campaign",
            "lead_status": 1,
            "leads_date": "2019-04-02"
        },
        {
            "lead_id": 6974,
            "external_system_id": "1741423",
            "lead_phone": "+18435972746",
            "first_name": "Charles",
            "last_name": "Mitchell",
            "client_name": "Uni Test",
            "campaign_id": 4,
            "campaign_name": "Test Campaign",
            "lead_status": 0,
            "leads_date": "2019-04-02"
        }
    ]
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

HTTP Request

GET api/v1/campaign-leads/get_data/{campaign_id}

(Optional) Request Query Parameter Descriptions

Parameter Type Value
filter_lead_status Integer 0 => Close, 1 => Open
filter_dnc String yes or no
filter_user_response String not_reponded or responded
filter_rsvp_confirm_leads String yes or no
filter_from_date Date 2019-06-23 => lead created at date in Meera
filter_to_date Date 2019-06-23 => lead created at date in Meera
filter_scheduled String yes or no
filter_call_status Integer 1 => Connected to REP
filter_call_status Integer 2 => Calls > 90 Sec
filter_call_status Integer 3 => Called but not Transferred
filter_call_status Integer 4 => Scheduled Calls Pending
filter_call_status Integer 5 => No Rep Response
filter_call_status Integer 6 => Called But No User Answer
filter_call_status Integer 7 => User Busy
filter_call_status Integer 8 => User Answered But No Press of a Key

Sample format of using query parameters

Response Body Parameter Descriptions

Parameter Value Description
total_record Integer Total count of leads
current_page Integer Describes the current page number
total_pages Integer Describes total number of pages
next_page String Next page url
prev_page String Previous page url
lead_id Integer Unique Id of the lead in Meera
external_system_id String External System Id (Unique ID) of the leads from other source
lead_phone String Mobile number of the lead
first_name String First name of the lead
last_name String Last name of the lead
client_name String Client name
campaign_id String Unique Id of the Campaign
campaign_name String Campaign Name
lead_status Integer 0 => Close, 1 => Open
leads_date Date Created date of lead in Meera

Get Lead's Message Logs

Provide campaign_id and user's mobile number as a json request

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/campaign-leads/get_message_log" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566" 
    -d '{"campaign_id":"4","mobile":"+14168549569"}'
        or
    -d '{"campaign_id":"4","external_system_id":"549569"}'
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/get_message_log");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "campaign_id": "4",
    "mobile": "+14168549569"
}

(or)

let body = {
    "campaign_id": "4",
    "external_system_id":"549569"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Success",
    "message_logs": [
        {
            "type": "message",
            "msg_from": "Bot LM",
            "msg": "Hi Andrew - this is Danielle from XYZ Co. You recently applied to one of our programs, but you haven't registered for classes. Are you available now to discuss?",
            "msg_time": "2019-06-03 09:00:20 AM PDT"
        },
        {
            "type": "message",
            "msg_from": "User",
            "msg": "Yes",
            "msg_time": "2019-06-03 13:13:17 PM PDT"
        },
        {
            "type": "message",
            "msg_from": "Bot LM",
            "msg": "Great! I will call you in 1-2 minutes.",
            "msg_time": "2019-06-03 13:13:17 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "initiated",
            "call_time": "2019-06-03 13:13:18 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "ringing",
            "call_time": "2019-06-03 13:13:19 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "in-progress",
            "call_time": "2019-06-03 13:13:50 PM PDT"
        },
        {
            "type": "message",
            "msg_from": "User",
            "msg": "Via text. Wont be available to call until after 3",
            "msg_time": "2019-06-03 13:13:59 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "completed",
            "call_duration": "16 Sec",
            "call_time": "2019-06-03 13:14:07 PM PDT"
        },
        {
            "type": "call_recording",
            "recording_url": "https:\/\/api.twilio.com\/2010-04-01\/Accounts\/ACb1b5a4d22dxxxxxxxxaxxxxxxxxx\/Recordings\/RE908af0d1dfc0216ed532034bc8f0001r"
        },
        {
            "type": "message",
            "msg_from": "Bot LM",
            "msg": "Hi Andrew, we tried reaching out but could not connect with you. If you are currently busy when would be a good time to reschedule?",
            "msg_time": "2019-06-03 13:14:08 PM PDT"
        },
        {
            "type": "message",
            "msg_from": "User",
            "msg": "3",
            "msg_time": "2019-06-03 13:14:26 PM PDT"
        },
        {
            "type": "message",
            "msg_from": "Jhon",
            "msg": "Call Scheduled By Jhon",
            "msg_time": "2019-06-03 13:23:29 PM PDT",
            "assist_by": "Jhon"
        },
        {
            "type": "message",
            "msg_from": "User",
            "msg": "Call Scheduled on June 3, 2019 at 03:00 PM",
            "msg_time": "2019-06-03 13:23:30 PM PDT"
        },
        {
            "type": "message",
            "msg_from": "Bot LM",
            "msg": "Great! Our admissions team will call you Today at 03:00 PM PDT",
            "msg_time": "2019-06-03 13:23:30 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "initiated",
            "call_time": "2019-06-03 15:02:13 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "ringing",
            "call_time": "2019-06-03 15:02:14 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "in-progress",
            "call_time": "2019-06-03 15:02:47 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "completed",
            "call_duration": "17 Sec",
            "call_time": "2019-06-03 15:03:03 PM PDT"
        },
        {
            "type": "message",
            "msg_from": "Bot LM",
            "msg": "Hi Andrew, we tried reaching out but could not connect with you. If you are currently busy when would be a good time to reschedule?",
            "msg_time": "2019-06-03 15:03:04 PM PDT"
        },
        {
            "type": "message",
            "msg_from": "User",
            "msg": "Oops I'm available now!",
            "msg_time": "2019-06-03 15:14:00 PM PDT"
        },
        {
            "type": "message",
            "msg_from": "User",
            "msg": "330",
            "msg_time": "2019-06-03 15:21:47 PM PDT"
        },
        {
            "type": "message",
            "msg_from": "Jhon",
            "msg": "Thanks for the update",
            "msg_time": "2019-06-03 15:29:38 PM PDT",
            "assist_by": "Jhon"
        },
        {
            "type": "message",
            "msg_from": "Jhon",
            "msg": "ok, I will connect you in a few seconds.",
            "msg_time": "2019-06-03 15:30:02 PM PDT",
            "assist_by": "Jhon"
        },
        {
            "type": "message",
            "msg_from": "Bot LM",
            "msg": "Call Started By ",
            "msg_time": "2019-06-03 15:30:17 PM PDT",
            "assist_by": "Jhon"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "initiated",
            "call_time": "2019-06-03 15:30:18 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "ringing",
            "call_time": "2019-06-03 15:30:19 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "in-progress",
            "call_time": "2019-06-03 15:30:28 PM PDT"
        },
        {
            "type": "call",
            "caller": "Representative",
            "call_status": "initiated",
            "call_time": "2019-06-03 15:30:40 PM PDT"
        },
        {
            "type": "call",
            "caller": "Representative",
            "call_status": "ringing",
            "call_time": "2019-06-03 15:30:42 PM PDT"
        },
        {
            "type": "call",
            "caller": "Representative",
            "call_status": "completed",
            "call_duration": "1072 Sec",
            "call_time": "2019-06-03 15:48:34 PM PDT"
        },
        {
            "type": "call",
            "caller": "User",
            "call_status": "completed",
            "call_duration": "1086 Sec",
            "call_time": "2019-06-03 15:48:35 PM PDT"
        }
    ]
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

Example response (400):

{
    "status": false,
    "message": "All fields are required."
}

HTTP Request

POST api/v1/campaign-leads/get_message_log

Body Parameters

Parameter Type Status Description
campaign_id string required Campaign Id
mobile string required User Mobile Number
Parameter Type Status Description
external_system_id string required External System ID

Response Body Parameter Descriptions

Parameter Value Description
type message or call Type of message log
msg_from User or Bot LM or Jhon (assistant user name) user or bot or assisted user name (eg: Jhon)
msg_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
msg Message String Message string from user or bot or assisted user
assist_by Assisted user name Name of assisted user eg: Jhon
call_status ringing, in-progress, completed, failed Call status of the user or representatives
caller Representative, User Caller identity
call_duration values in secs Call duration on complete status eg: 1086 Sec
call_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
recording_url URL Call Recording URL

Get Campaign Lead Status

Lead Status of particular lead

Provide campaign_id and user's mobile number as a json request

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/campaign-leads/get_lead_status" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566"
    -d '{"campaign_id":"4","mobile":"+14168549569"}'
        or
    -d '{"campaign_id":"4","external_system_id":"549569"}'
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/get_lead_status");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "campaign_id": "4",
    "mobile": "+14168549569"
}

(or)

let body = {
    "campaign_id": "4",
    "external_system_id":"549569"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Success",
    "lead_status": "Responded",
    "lead_details": {
        "current_status": "open",
        "lead_id": 6807,
        "status": "Responded",
        "posted_date": "2019-03-04",
        "full_name": "ABC XYZ",
        "user_timezone": "America\/Chicago",
        "mobile_number": "+14168549569",
        "ps_id": null,
        "campaign_name": "EG Campaign",
        "campaign_timezone": "America\/Chicago",
        "campaign_id": 4,
        "message_status": "none",
        "send_welcome_msg": "Yes",
        "dnd_status": "No",
        "responded": "Yes",
        "responded_date_time": "2019-03-14 01:20:50 AM CDT",
        "confirm_rsvp": "",
        "rsvp_session": "",
        "scheduled": "No",
        "scheduled_date_time": "",
        "call_attempt": 2,
        "called": "No",
        "call_status": "Busy",
        "called_date_time": "",
        "transfered": "No",
        "transfered_date_time": "",
        "all_converted": "No",
        "all_converted_date_time": "",
        "converted_inbound": "No",
        "converted_outbound": "No",
        "total_call_duration": null,
        "representative_call_duration": null
    }
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

Example response (400):

{
    "status": false,
    "message": "All fields are required."
}

HTTP Request

POST api/v1/campaign-leads/get_lead_status

Request Body Parameters

Parameter Type Status Description
campaign_id string required Campaign Id
mobile string required User Mobile Number
Parameter Type Status Description
external_system_id string required External System ID

Response Body Parameter Descriptions

(Note: Scroll left or right to view Descriptions)

Parameter Value Description
lead_status (Undelivered, Contacted, Responded, Scheduled, Called, Transfered, DNC, Converted, NoRepResponse, Delivered, ClosedAfterFollowup, ClosedByClient, BadPhone, RepCall30SEC) Over all status of particular lead
current_status 'open','close' Lead's current status open or close
lead_id Integer Unique Id of leads
status (Undelivered, Contacted, Responded, Scheduled, Called, Transfered, DNC, Converted, NoRepResponse, Delivered, ClosedAfterFollowup, ClosedByClient, BadPhone, RepCall30SEC) Over all status of particular lead
posted_date Date Format (Y-m-d) Posted date of lead in Meera AI
full_name String First name and Last name of the lead
user_timezone String Lead's Time Zone eg:("America/Chicago")
mobile_number String Lead's Mobile Number
ps_id String External id of leads. null if no ps_id
campaign_name String Campaign Name, where the lead belongs to
campaign_timezone String Campaign's Time Zone eg:("America/Chicago")
campaign_id Integer Unique Id of Campaign
message_status 'queued','failed','sent','undelivered','none' Status of message sent to lead
send_welcome_msg 'Yes','No' Start Prompt message sent status
dnd_status 'Yes','No' Lead's DNC/DND status
responded 'Yes','No' User (Lead) replied status
responded_date_time Date time User (Lead) responded Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
confirm_rsvp 'Yes','No' RSVP Lead Status. Confirmed or not
rsvp_session '10:00','05-06' RSVP Session - Time (HH:MM) or Date (mm-dd)
scheduled 'Yes','No' Call set status
scheduled_date_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
call_attempt Integer Call Attempt Count
called 'Yes','No' Call to User (lead) status
call_status (busy, no-answer, completed, failed, notdone) Call status
called_date_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
transfered 'Yes','No' Connected to Representative status
transfered_date_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
all_converted 'Yes','No' Yes -> (Call Conversion > 90 secs)
all_converted_date_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT.( Call end date time)
converted_inbound 'Yes','No' User (Lead) directly call to Representative. Yes -> (Call Conversion > 90 secs)
converted_outbound 'Yes','No' Meera AI call to User (Lead) and connect to Representative. Yes -> (Call Conversion > 90 secs)
total_call_duration Integer Total call duration of Lead in secs eg:(215)
representative_call_duration Integer Total call duration of Representative in secs eg:(200)

Get Message Attempt

Get Lead's Message Attempt

Provide campaign_id and user's mobile number as a json request

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/campaign-leads/get_message_attempt" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566" 
    -d '{"campaign_id":"4","mobile":"+14168549569"}'
        or
    -d '{"campaign_id":"4","external_system_id":"549569"}'
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/get_message_attempt");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "campaign_id": "4",
    "mobile": "+14168549569"
}

(or)

let body = {
    "campaign_id": "4",
    "external_system_id":"549569"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Success",
    "message_status": "Contacted",
    "lead_details": {
        "message_attempt": 1,
        "responded": "No"
    }
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

Example response (400):

{
    "status": false,
    "message": "All fields are required."
}

HTTP Request

POST api/v1/campaign-leads/get_message_attempt

Body Parameters

Parameter Type Status Description
campaign_id string required Campaign Id
mobile string required User Mobile Number
Parameter Type Status Description
external_system_id string required External System ID

Response Body Parameter Descriptions

Parameter Value Description
message_attempt Integer No. of times messages sent to user
responded String User responded to the message sent

Close The Leads

Close the particular campaign leads

Provide campaign_id and user's mobile number as a json request

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/campaign-leads/close_lead" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566"
    -d '{"campaign_id":"4","mobile":"+14168549569","message":"Already Contacted"}'
        or
    -d '{"campaign_id":"4","external_system_id ":"549569","message":"Already Contacted"}'
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/close_lead");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "campaign_id": "4",
    "mobile": "+14168549569",
    "message": "Already Contacted"
}

(or)

let body = {
    "campaign_id": "4",
    "external_system_id ": "549569",
    "message": "Already Contacted"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Lead Closed"
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

Example response (400):

{
    "status": false,
    "message": "All fields are required."
}

Example response (508):

{
    "status": false,
    "message": "Lead Already Closed."
}

HTTP Request

POST api/v1/campaign-leads/close_lead

Body Parameters

Parameter Type Status Description
campaign_id string required Campaign Id
mobile string required User Mobile Number
message string optional Message If Any Number
Parameter Type Status Description
external_system_id string required External System ID

Update Call Status

Update call status of particular campaign leads

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/campaign-leads/set_call_status" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566" 
    -d '{"campaign_id":4,"mobile":"+14168549569","call_status":"completed","call_attempt":"1","call_duration":122,"representative_call_status":"Yes","representative_call_duration":120,"call_start_time":"2019-03-14 01:20:50 PM CDT","call_end_time":"2019-03-14 02:20:50 PM CDT"}'
        or
    -d '{"campaign_id":4,"external_system_id ":"549569","call_status":"completed","call_attempt":"1","call_duration":122,"representative_call_status":"Yes","representative_call_duration":120,"call_start_time":"2019-03-14 01:20:50 PM CDT","call_end_time":"2019-03-14 02:20:50 PM CDT"}'
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/set_call_status");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "campaign_id": 4,
    "mobile": "+14168549569",
    "call_status": "completed",
    "call_attempt": "1",
    "call_duration": 122,
    "representative_call_status": "Yes",
    "representative_call_duration": 120,
    "call_start_time": "2019-03-14 01:20:50 PM CDT",
    "call_end_time": "2019-03-14 02:20:50 PM CDT"
}

(or)

let body = {
    "campaign_id": 4,
    "external_system_id ": "549569",
    "call_status": "completed",
    "call_attempt": "1",
    "call_duration": 122,
    "representative_call_status": "Yes",
    "representative_call_duration": 120,
    "call_start_time": "2019-03-14 01:20:50 PM CDT",
    "call_end_time": "2019-03-14 02:20:50 PM CDT"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Called Status Updated successfully"
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

Example response (400):

{
    "status": false,
    "message": "All fields are required."
}

HTTP Request

POST api/v1/campaign-leads/set_call_status

Body Parameters

Parameter Type Status Description
campaign_id integer required Campaign Id
mobile string required User Mobile Number
call_status string required Called Status : (busy, no-answer, completed, failed, notdone)
call_attempt integer required Call Attempts : default pass (0)
call_duration integer required Call Duration : default pass (null)
representative_call_status string required Rep Call Status : Yes/No
representative_call_duration integer required Rep Call Duration : default pass (null)
call_start_time string required Call Start Time with TZ
call_end_time string required Call End Time with TZ
Parameter Type Status Description
external_system_id string required External System ID

Update DND Status

Update DND status of particular campaign leads

Provide campaign_id and user's mobile number as a json request

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/campaign-leads/set_dnc_status" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566"
    -d '{"campaign_id":"4","mobile":"+14168549569","dnd_status":"No"}'
        or
    -d '{"campaign_id":"4","external_system_id ":"549569","dnd_status":"No"}'
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/set_dnc_status");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "campaign_id": "4",
    "mobile": "+14168549569",
    "dnd_status": "No"
}

(or)

let body = {
    "campaign_id": "4",
    "external_system_id ": "549569",
    "dnd_status": "No"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "DND Status Updated successfully"
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

Example response (400):

{
    "status": false,
    "message": "All fields are required."
}

HTTP Request

POST api/v1/campaign-leads/set_dnc_status

Body Parameters

Parameter Type Status Description
campaign_id string required Campaign Id
mobile string required User Mobile Number
dnd_status string required DND Status : Yes/No
Parameter Type Status Description
external_system_id string required External System ID

Update Call Scheduled Status

Update call Schedule status of particular campaign leads

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/campaign-leads/set_scheduled_status" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566"
    -d '{"campaign_id":4,"mobile":"+14168549569","scheduled":"Yes","scheduled_date_time":"2019-03-14 01:20:50 PM CDT"}'
        (or)
    -d '{"campaign_id":4,"external_system_id ":"549569","scheduled":"Yes","scheduled_date_time":"2019-03-14 01:20:50 PM CDT"}'
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/set_scheduled_status");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "campaign_id": 4,
    "mobile": "+14168549569",
    "scheduled": "Yes",
    "scheduled_date_time": "2019-03-14 01:20:50 PM CDT"
}

(or)

let body = {
    "campaign_id": 4,
    "external_system_id ": "549569",
    "scheduled": "Yes",
    "scheduled_date_time": "2019-03-14 01:20:50 PM CDT"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Call Scheduled Status Updated successfully"
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

Example response (400):

{
    "status": false,
    "message": "All fields are required."
}

HTTP Request

POST api/v1/campaign-leads/set_scheduled_status

Body Parameters

Parameter Type Status Description
campaign_id integer required Campaign Id
mobile string required User Mobile Number
scheduled string required Schedule Status : Yes/No
scheduled_date_time string required Schedule Call Date Time with TZ
Parameter Type Status Description
external_system_id string required External System ID

Update Contacted Status

Update Contacted status of particular campaign leads

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/campaign-leads/set_contacted_status" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566"
    -d '{"campaign_id":4,"mobile":"+14168549569","send_welcome_msg":"Yes","message_status":"delivered"}'
        or
    -d '{"campaign_id":4,"external_system_id ":"549569","send_welcome_msg":"Yes","message_status":"delivered"}'
const url = new URL("https://chatbot.meera.ai/api/v1/campaign-leads/set_contacted_status");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "campaign_id": 4,
    "mobile": "+14168549569",
    "send_welcome_msg": "Yes",
    "message_status": "delivered"
}

(or)

let body = {
    "campaign_id": 4,
    "external_system_id ": "549569",
    "send_welcome_msg": "Yes",
    "message_status": "delivered"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message": "Contacted Status Updated successfully"
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource."
}

Example response (400):

{
    "status": false,
    "message": "All fields are required."
}

HTTP Request

POST api/v1/campaign-leads/set_contacted_status

Body Parameters

Parameter Type Status Description
campaign_id integer required Campaign Id
mobile string required User Mobile Number
send_welcome_msg string required Start Prompt Send Status : Yes/No
message_status string required Message Sent Status ('queued','failed','sent','undelivered', 'delivered')
Parameter Type Status Description
external_system_id string required External System ID

NLP Message (Send and Receive)

Send Message to Meera NLP

Provide the webhook to receive the message activity log. This allows Meera NLP to understand the conversation context whenever there is a user response.

Set Header with Accept: application/json and Authorization: {api_token}

Example request:

curl -X POST "https://chatbot.meera.ai/api/v1/nlp/send" \
    -H "Content-Type: application/json" \
    -H "Authorization: cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566"
    -d '{"campaign_id":4,"external_system_id":"88998","message":"who is this?","short_codes":"{\"[Sms_number]\": \"+1324567898\",\"[Sms_number_plain]\": \"+1324567898\"}}"}'
const url = new URL("https://chatbot.meera.ai/api/v1/nlp/send");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "cVpFWEZ4OGphM1ZnSU5zdA==5ca32fd21b566",
}

let body = {
    "campaign_id": 4,
    "external_system_id": "88998",
    "message": "who is this?",
    "short_codes": "{\"[Sms_number]\": \"+1324567898\",\"[Sms_number_plain]\": \"+1324567898\"}}"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "message_id": "bb000c55cd1"
}

Example response (401):

{
    "status": false,
    "message": "Unauthorized to access the requested resource"
}

Example response (400):

{
    "status": false,
    "message": "All fields are required."
}

HTTP Request

POST api/v1/nlp/send

Body Parameters

Parameter Type Status Description
campaign_id integer required Campaign Id
external_system_id string required Unique Id of the leads provided by the client
message string required Send message
short_codes array optional optional Send your ShortCode/ Custom Tokens to replace with values

Receive Message from Meera NLP

Meera will POST the response to the provided webhook for each message.

Responses and Descriptions of response parameters receive from Meera NLP are as follows.

Example response (200):

{
    "status": true,
    "external_system_id": "12345",
    "campaing_id": "123",
    "reply_details": {
        "message_id": "f70c01ac5ce",
        "reply_string": "Great. I will call you [date] at [time] [timezone]",
        "intent": "[datetime]",
        "action": "schedule_call",
        "schedule_details": "2019-03-14 01:20:50 PM CDT"
        }
}

Example response (200):

{
    "status": true,
    "external_system_id": "12345",
    "campaing_id": "123",
    "reply_details":{
        "message_id": "f70c01ac5ce",
        "reply_string": "Great! I will connect you with a [CompanyName] advisor in 1-2 minutes.",
        "intent": "[positive]",
        "action": "trigger_call"
        }
}

Response Body Parameter Descriptions

Parameter Type Description
status Boolean true or false
external_system_id String External System Id (Unique ID) of the leads from other source.
campaing_id Integer Unique ID of campaigns created in Meera AI
reply_details JSON object Detailed JSON object
message_id Integer Provided by Meera
reply_string String Reply string based on client message after processed to NLP
intent String NLP Intent name for further process.(Intent Name: positive_reply, negative_reply, enquiry_statement, exit_statement, date_time, Location_Request, Financial_aid)
action String States what action performed on a sent message. (action : send_message, schedule_call, dnc, reset_schedule_call, update, trigger_call)
schedule_details String Schedule Call Date Time with Time Zone (Campaign TimeZone). (Note: Appears when action: 'schedule_call')

Webhook

Meera will push the Live lead status to client webhook

Meera will POST the response to the provided webhook.

Responses and Descriptions of response parameters received as follows.

Example response (200):

{
    "status": true,
    "message": "Success",
    "lead_status": "Responded",
    "lead_details": {
        "current_status": "open",
        "lead_id": 6807,
        "status": "Responded",
        "posted_date": "2019-03-04",
        "full_name": "ABC XYZ",
        "user_timezone": "America\/Chicago",
        "mobile_number": "+14168549569",
        "ps_id": null,
        "campaign_name": "EG Campaign",
        "campaign_timezone": "America\/Chicago",
        "campaign_id": 4,
        "message_status": "none",
        "send_welcome_msg": "Yes",
        "dnd_status": "No",
        "responded": "Yes",
        "responded_date_time": "2019-03-14 01:20:50 AM CDT",
        "confirm_rsvp": "",
        "rsvp_session": "",
        "scheduled": "No",
        "scheduled_date_time": "",
        "call_attempt": 2,
        "called": "No",
        "call_status": "Busy",
        "called_date_time": "",
        "transfered": "No",
        "transfered_date_time": "",
        "all_converted": "No",
        "all_converted_date_time": "",
        "converted_inbound": "No",
        "converted_outbound": "No",
        "total_call_duration": null,
        "representative_call_duration": null
    }
}

Response Body Parameter Descriptions

(Note: Scroll left or right to view Descriptions)

Parameter Value Description
lead_status (Undelivered, Contacted, Responded, Scheduled, Called, Transfered, DNC, Converted, NoRepResponse, Delivered, ClosedAfterFollowup, ClosedByClient, BadPhone, RepCall30SEC) Over all status of particular lead
current_status 'open','close' Lead's current status open or close
lead_id Integer Unique Id of leads
status (Undelivered, Contacted, Responded, Scheduled, Called, Transfered, DNC, Converted, NoRepResponse, Delivered, ClosedAfterFollowup, ClosedByClient, BadPhone, RepCall30SEC) Over all status of particular lead
posted_date Date Format (Y-m-d) Posted date of lead in Meera AI
full_name String First name and Last name of the lead
user_timezone String Lead's Time Zone eg:("America/Chicago")
mobile_number String Lead's Mobile Number
ps_id String External id of leads. null if no ps_id
campaign_name String Campaign Name, where the lead belongs to
campaign_timezone String Campaign's Time Zone eg:("America/Chicago")
campaign_id Integer Unique Id of Campaign
message_status 'queued','failed','sent','undelivered','none' Status of message sent to lead
send_welcome_msg 'Yes','No' Start Prompt message sent status
dnd_status 'Yes','No' Lead's DNC/DND status
responded 'Yes','No' User (Lead) replied status
responded_date_time Date time User (Lead) responded Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
confirm_rsvp 'Yes','No' RSVP Lead Status. Confirmed or not
rsvp_session '10:00','05-06' RSVP Session - Time (HH:MM) or Date (mm-dd)
scheduled 'Yes','No' Call set status
scheduled_date_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
call_attempt Integer Call Attempt Count
called 'Yes','No' Call to User (lead) status
call_status (busy, no-answer, completed, failed, notdone) Call status
called_date_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
transfered 'Yes','No' Connected to Representative status
transfered_date_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT
all_converted 'Yes','No' Yes -> (Call Conversion > 90 secs)
all_converted_date_time Date time Date time with timezone eg: 2019-04-04 04:04:09 AM CDT.( Call end date time)
converted_inbound 'Yes','No' User (Lead) directly call to Representative. Yes -> (Call Conversion > 90 secs)
converted_outbound 'Yes','No' Meera AI call to User (Lead) and connect to Representative. Yes -> (Call Conversion > 90 secs)
total_call_duration Integer Total call duration of Lead in secs eg:(215)
representative_call_duration Integer Total call duration of Representative in secs eg:(200)