Official API - V1


APIs to send messages to individual WhatsApp users. Each API is used to send messages of different types (Text, image, video, document(PDF), templated text and media messages).

Overview

Parameters

- token: Your Unique FlockSend API Token.
- number_details: List of numbers with the user’s name   to send the campaign to.
- file: image/video/document(PDF) file downloadable link to   be sent.
- message: Text to send to the user. Mandatory for 'Text' message API.
- title: File Name to send with PDF and/or caption   to send with the image/video.

Response Status Code

- 200: Success
- 400: Failure. (Missing parameters/wrong file formats)
POST Text Message

An API to send a WhatsApp text message to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/text
BODY

{
    "token": 5f0c11**********af2,
    "message": "Sample text message.",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]'
}

NOTE:

- token, message and number_details are mandatory parameters.
- name in number_details is not a mandatory parameter.
- phone in number_details must include the country code.

POST Image

An API to send an image on WhatsApp with/without caption to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/image
BODY

{
    "token": 5f0c11**********af2,
    "title": "WhatsApp Image.",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "image":"https://flocksend.com/assets/images/a1.jpg"
}

NOTE:

- token, image and number_details are mandatory parameters.
- name in number_details and title(image caption) are not mandatory parameters.
- phone in number_details must include the country code.
- Image should be a downloadable link. Google drive links and file attachments will not work!
- supported formats : ['jpeg', 'jpg', 'png', 'ico', 'gif', 'bmp', 'svg'].
- size limit : 5mb

POST Video

An API to send a video on WhatsApp to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/video
BODY

{
    "token": 5f0c11**********af2,
    "title": "WhatsApp Video.",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "video":"https://flocksend.com/welcomeMailFiles/sample.mp4"
}

NOTE:

- token, video and number_details are mandatory parameters.
- name in number_details and title(video caption) are not mandatory parameters.
- phone in number_details must include the country code.
- Video should be a downloadable link. Google drive links and file attachments will not work!
- supported formats : ['mp4', '3gp', 'mov'].
- size limit : 16mb



POST PDF

An API to send a PDF document on WhatsApp to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/file
BODY

{
    "token": 5f0c11**********af2,
    "title": "WhatsApp File.",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "file": "https://flocksend.com/welcomeMailFiles/sample.pdf"
}

NOTE:

- token, file and number_details are mandatory parameters.
- name in number_details and title(file name) are not mandatory parameters.
- phone in number_details must include the country code.
- The file should be a downloadable link. Google drive links and file attachments will not work!
- size limit : 15mb

POST Templated WhatsApp Message (HSM) - V1

An API to send pre-approved templated text messages(HSM) to users on WhatsApp.

URL : https://flocksend.com/api/connect/official/hsm
BODY

{
    "token": 5f0c11**********af2,
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"name":"Nishant","phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "arg1,arg2,arg3,arg4,arg5,arg6,arg7",
}

NOTE:

- token, number_details, template_name and template_argument are mandatory parameters.
- name in number_details is not a mandatory parameter.
- phone in number_details must include the country code.

POST Templated WhatsApp Document (HSM PDF) - V1

An API to send pre-approved templated pdf document to users on WhatsApp.

URL : https://flocksend.com/api/connect/official/hsm/file
BODY

{
    "token": 5f0c11**********af2,
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"name":"Nishant","phone":"9188********"}]',
    "title": "PDF Name"
    "file": "https://flocksend.com/welcomeMailFiles/sample.pdf"
    "template_name": "account_invoice"
    "template_argument": "arg1,arg2,arg3,arg4",
}

NOTE:

- token, number_details, template_name and template_argument are mandatory parameters.
- File should be a downloadable link. Google drive links and file attachments will not work!
- title(file name) is not a mandatory parameter.
- name in number_details is not a mandatory parameter.
- phone in number_details must include the country code.
- supported format : ['pdf']
- size limit : 15mb

Example Request
Default

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}


Example Request
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/text \
  --data '{
    "token": 5f0c11**********af2,
    "message": "Sample text message.",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]'
}

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}


Example Request
Default

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}


Example Request
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/file \
  --data '{
    "token": 5f0c11**********af2,
    "title": "WhatsApp File.",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "file": "https://flocksend.com/welcomeMailFiles/sample.pdf"
}'

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}


Example Request
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/hsm \
  --data '{
    "token": 5f0c11**********af2,
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"name":"Nishant","phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "arg1,arg2,arg3,arg4,arg5,arg6,arg7"
}'

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}


Example Request - HSM V1 PDF
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/hsm/file \
  --data '{
    "token": 5f0c11**********af2,
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"name":"Nishant","phone":"9188********"}]',
    "title": "PDF V1",
    "file": "https://flocksend.com/welcomeMailFiles/sample.pdf",
    "template_name": "account_sign_up"
    "template_argument": "arg1,arg2,arg3,arg4,arg5,arg6,arg7"
}'

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}


Official API - V2


APIs to send messages to individual WhatsApp users. Each API is used to send messages of different types (Text, image, video, document(PDF), templated text and media messages).

Overview

Parameters

- token: Your Unique FlockSend API Token.
- number_details: List of numbers with the user’s name   to send the campaign to.
- file: image/video/document(PDF) file downloadable link to   be sent.
- message: Text to send to the user. Mandatory for 'Text' message API.
- title: File Name to send with PDF and/or caption   to send with the image/video.
- template_type (HSM): Type of template can be text, image, video, document or contact.
- button_type (HSM): There can be Quick Reply buttons, CTA Buttons or no buttons.

Response Status Code

- 200: Success
- 400: Failure. (Missing parameters/wrong file formats)
POST Session V2 Text

An API to send a WhatsApp text message to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/v2/text
BODY

{
    "token": "zHaU3Il**********",
    "message": "Hi, how are you",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]'
}

NOTE:

- token, message and number_details are mandatory parameters.
- name in number_details is not a mandatory parameter.
- phone in number_details must include the country code.

POST Session V2 Image

An API to send an image on WhatsApp with/without caption to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/v2/image
BODY

{
    "token": "zHaU3Il**********",
    "title": "WhatsApp Image",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "image": "https://flocksend.com/assets/images/a1.jpg"
}

NOTE:

- token, image and number_details are mandatory parameters.
- name in number_details and title(image caption) are not mandatory parameters.
- phone in number_details must include the country code.
- Image should be a downloadable link. Google drive links and file attachments will not work!
- supported formats : ['jpeg', 'jpg', 'png', 'ico', 'gif', 'bmp', 'svg'].
- size limit : 5mb

POST Session V2 Sticker

An API to send a sticker on WhatsApp to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/v2/sticker
BODY

{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "sticker": "https://flocksend.com/assets/images/sticker.webp"
}

NOTE:

- token, sticker and number_details are mandatory parameters.
- name in number_details is not a mandatory parameter.
- phone in number_details must include the country code.
- sticker should be a downloadable link. Google drive links and file attachments will not work!
- supported format : ['webp'].
- size limit : 100kb
- resolution : 512 X 512 pixel - sticker url should end with .webp format as specified above.

POST Session V2 Video

An API to send a video on WhatsApp to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/v2/video
BODY

{
    "token": "zHaU3Il**********",
    "title": "WhatsApp Video",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "video": "https://flocksend.com/welcomeMailFiles/sample.mp4"
}

NOTE:

- token, video and number_details are mandatory parameters.
- name in number_details and title(video caption) are not mandatory parameters.
- phone in number_details must include the country code.
- Video should be a downloadable link. Google drive links and file attachments will not work!
- supported formats : ['mp4', '3gp', 'mov'].
- size limit : 16mb



POST Session V2 PDF

An API to send a PDF document on WhatsApp to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/v2/file
BODY

{
    "token": "zHaU3Il**********",
    "title": "WhatsApp File",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "file": "https://flocksend.com/welcomeMailFiles/sample.pdf"
}

NOTE:

- token, file and number_details are mandatory parameters.
- name in number_details and title(file name) are not mandatory parameters.
- phone in number_details must include the country code.
- The file should be a downloadable link. Google drive links and file attachments will not work!
- size limit : 15mb

POST Session V2 Audio

An API to send an audio file on WhatsApp to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/v2/audio
BODY

{
    "token": "zHaU3Il**********",
    "title": "WhatsApp Audio",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "audio": "https://flocksend.com/welcomeMailFiles/sample.mp3"
}

NOTE:

- token, audio and number_details are mandatory parameters.
- name in number_details and title(video caption) are not mandatory parameters.
- phone in number_details must include the country code.
- Audio should be a downloadable link. Google drive links and file attachments will not work!
- supported formats : ['mp3', 'acc', 'amr', 'mpeg', 'ogg'].
- size limit : 16mb



POST Session V2 Location

An API to send any location on WhatsApp to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/v2/location
BODY

{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "longitude": "-73.9855" ,
    "latitude": "40.7580" ,
    "name": "Times Square" ,
    "address": "Manhattan, NY 10036, United States" ,
}

NOTE:

- token, number_details, longitude and latitude are mandatory parameters.
- name in number_details is not mandatory parameter.
- phone in number_details must include the country code.
- location name and address are optional parameters.

POST Session V2 Contact

An API to send contact information on WhatsApp to users within 24 hours of the user's last message.

URL : https://flocksend.com/api/connect/official/v2/contact
BODY

{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "name": "Contact Name" ,
    "number": "Contact Number"
}

NOTE:

- token and number_details are mandatory parameters.
- name in number_details is not mandatory parameter.
- phone in number_details must include the country code.
- contact name and number are mandatory parameters.

POST Templated WhatsApp Message (HSM) - V2

An API to send pre-approved templated text messages(HSM) to users on WhatsApp.

URL : https://flocksend.com/api/connect/official/v2/hsm
BODY

{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"name":"Nishant","phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "arg1,arg2,arg3,arg4,arg5,arg6,arg7",
    "language": "en",
}

NOTE:

- token, number_details, template_name, template_argument and language are mandatory parameters.
- name in number_details is not a mandatory parameter.
- phone in number_details must include the country code.
- for language codes, please refer here : language_codes

POST Templated Text Message (HSM) - V2

An API to send pre-approved templated text messages(HSM) to users on WhatsApp.

URL : https://flocksend.com/api/connect/official/v2/hsm/all
BODY

{
    "token": "zHaU3Il**********", 
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "1",
    "button_type": "1",
}

NOTE:

- token, number_details, template_name, template_argument, language, template_type and button_type are mandatory parameters.
- for language codes, please refer here : language_codes
- phone in number_details must include the country code.
- button_type has values: "1" for "No Button"; "2" for "Quick Reply Button" and "3" for "CTA Button"

POST Templated Image Message (HSM) - V2

An API to send pre-approved templated image messages (HSM) to users on WhatsApp.

URL : https://flocksend.com/api/connect/official/v2/hsm/all
BODY

{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "2",
    "button_type": "1",
    "file": "https://flocksend.com/assets/images/a1.jpg",
}

NOTE:

- token, number_details, template_name, template_argument, language, template_type, button_type and file are mandatory parameters.
- for language codes, please refer here : language_codes
- phone in number_details must include the country code.
- button_type has values: "1" for "No Button"; "2" for "Quick Reply Button" and "3" for "CTA Button"
- file should be a downloadable link. Google drive links and file attachments will not work!
- supported formats : ['jpeg', 'jpg', 'png', 'ico', 'gif', 'bmp', 'svg'].
- size limit : 5mb

POST Templated Video Message (HSM) - V2

An API to send pre-approved templated video messages (HSM) to users on WhatsApp.

URL : https://flocksend.com/api/connect/official/v2/hsm/all
BODY

{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "3",
    "button_type": "1",
    "file": "https://flocksend.com/welcomeMailFiles/sample.mp4",
}

NOTE:

- token, number_details, template_name, template_argument, language, template_type, button_type and file are mandatory parameters.
- for language codes, please refer here : language_codes
- phone in number_details must include the country code.
- button_type has values: "1" for "No Button"; "2" for "Quick Reply Button" and "3" for "CTA Button"
- file should be a downloadable link. Google drive links and file attachments will not work!
- supported formats : ['mp4', '3gp', 'mov'].
- size limit : 16mb

POST Templated PDF Message (HSM) - V2

An API to send pre-approved templated PDF document messages (HSM) to users on WhatsApp.

URL : https://flocksend.com/api/connect/official/v2/hsm/all
BODY

{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "4",
    "button_type": "1",
    "title": "PDF Name",
    "file": "https://flocksend.com/welcomeMailFiles/sample.pdf",
}

NOTE:

- token, number_details, template_name, template_argument, language, template_type, button_type, title and file are mandatory parameters.
- for language codes, please refer here : language_codes
- phone in number_details must include the country code.
- button_type has values: "1" for "No Button"; "2" for "Quick Reply Button" and "3" for "CTA Button"
- file should be a downloadable link. Google drive links and file attachments will not work!
- title (file name) is not a mandatory parameter.
- supported format : ['pdf']
- size limit : 15mb

POST Templated Location Message (HSM) - V2

An API to send pre-approved templated location messages (HSM) to users on WhatsApp.

URL : https://flocksend.com/api/connect/official/v2/hsm/all
BODY

{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "5",
    "button_type": "1",
    "longitude": "144.965839",
    "latitude": "-37.816642",
}

NOTE:

- token, number_details, template_name, template_argument, language, template_type, button_type, longitude and latitude are mandatory parameters.
- phone in number_details must include the country code.
- for language codes, please refer here : language_codes
- button_type has values: "1" for "No Button"; "2" for "Quick Reply Button" and "3" for "CTA Button"




Example Request - Session V2 Text
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/text \
  --data '{
    "token": "zHaU3Il**********",
    "message": "Hi, how are you",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]'
}'

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}


Example Request - Session V2 Image
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/image \
  --data '{
    "token": "zHaU3Il**********",
    "title": "WhatsApp Image",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "image": "imageFile.jpg"
}'

Example Response
200
{
"status": "success",
"message": "Your message was sent successfully.",
"data": [
            {
                "phone_number": "9195********",
                "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
                "message": "Message sent"
            },
            {
                "phone_number": "9188********",
                "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
                "message": "Message sent"
            }
    ]
}


Example Request - Session V2 Sticker
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/sticker \
  --data '{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "sticker": "https://flocksend.com/assets/images/sticker.webp"
}'

Example Response
200
{
"status": "success",
"message": "Your message was sent successfully.",
"data": [
            {
                "phone_number": "9195********",
                "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
                "message": "Message sent"
            },
            {
                "phone_number": "9188********",
                "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
                "message": "Message sent"
            }
    ]
}




Example Request - Session V2 Video
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/video \
  --data '{
    "token": "zHaU3Il**********",
    "title": "WhatsApp Video",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "video": "https://flocksend.com/welcomeMailFiles/sample.mp4"
}'

Example Response
200
{
"status": "success",
"message": "Your message was sent successfully.",
"data": [
            {
                "phone_number": "9195********",
                "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
                "message": "Message sent"
            },
            {
                "phone_number": "9188********",
                "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
                "message": "Message sent"
            }
    ]
}




Example Request - Session V2 PDF
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/file \
  --data '{
    "token": "zHaU3Il**********",
    "title": "WhatsApp File",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "file": "https://flocksend.com/welcomeMailFiles/sample.pdf"
}'

Example Response
200
{
"status": "success",
"message": "Your message was sent successfully.",
"data": [
            {
                "phone_number": "9195********",
                "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
                "message": "Message sent"
            },
            {
                "phone_number": "9188********",
                "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
                "message": "Message sent"
            }
    ]
}

Example Request - Session V2 Audio
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/audio \
  --data '{
    "token": "zHaU3Il**********",
    "title": "WhatsApp Audio",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "audio": "https://flocksend.com/welcomeMailFiles/sample.mp3"
}'

Example Response
200
{
"status": "success",
"message": "Your message was sent successfully.",
"data": [
            {
                "phone_number": "9195********",
                "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
                "message": "Message sent"
            },
            {
                "phone_number": "9188********",
                "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
                "message": "Message sent"
            }
    ]
}




Example Request - Session V2 Location
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/location \
  --data '{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "longitude": "-73.9855",
    "latitude": "40.7580",
    "name": "Times Square",
    "address": "Manhattan, NY 10036, United States"
}'

Example Response
200
{
"status": "success",
"message": "Your message was sent successfully.",
"data": [
            {
                "phone_number": "9195********",
                "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
                "message": "Message sent"
            },
            {
                "phone_number": "9188********",
                "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
                "message": "Message sent"
            }
    ]
}


Example Request - Session V2 Contact
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/contact \
  --data '{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "name": "Contact Name",
    "number": "Contact Number"
}'

Example Response
200
{
"status": "success",
"message": "Your message was sent successfully.",
"data": [
            {
                "phone_number": "9195********",
                "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
                "message": "Message sent"
            },
            {
                "phone_number": "9188********",
                "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
                "message": "Message sent"
            }
    ]
}


Example Request - HSM V2
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/hsm \
  --data '{
    "token": "zHaU3Il**********",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"name":"Nishant","phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "arg1,arg2,arg3,arg4,arg5,arg6,arg7"
    "language": "language_code"
}'

Example Response
200
{
"status": "success",
"message": "Your message was sent successfully.",
"data": [
            {
                "phone_number": "9195********",
                "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
                "message": "Message sent"
            },
            {
                "phone_number": "9188********",
                "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
                "message": "Message sent"
            }
    ]
}


Example Request - HSM V2 Text
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/hsm/all \
  --data '{
    "token": "zHaU3Il**********",
    "message": "Hi, how are you",
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "1",
    "button_type": "1",
}

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}


Example Request - HSM V2 Image
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/hsm/all \
  --data '{
    "token": "zHaU3Il**********",
    "message": "Hi, how are you",
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "2",
    "button_type": "1",
    "file": "https://flocksend.com/assets/images/a1.jpg",
}

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}




Example Request - HSM V2 Video
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/hsm/all \
  --data '{
    "token": "zHaU3Il**********",
    "message": "Hi, how are you",
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "3",
    "button_type": "1",
    "file": "https://flocksend.com/welcomeMailFiles/sample.mp4",
}

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}





Example Request - HSM V2 PDF
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/hsm/all \
  --data '{
    "token": "zHaU3Il**********",
    "message": "Hi, how are you",
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "4",
    "button_type": "1",
    "title": "PDF Name",
    "file": "https://flocksend.com/welcomeMailFiles/sample.pdf"
}

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}





Example Request - HSM V2 Location
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/hsm/all \
  --data '{
    "token": "zHaU3Il**********",
    "message": "Hi, how are you",
    “number_details”:
            '[{"phone":"9195********"},
            {"phone":"9188********"}]',
    "template_name": "account_sign_up"
    "template_argument": "argument1,argument2",
    "language": "en",
    "template_type": "5",
    "button_type": "1",
    "longitude": "144.965839",
    "longitude": "-37.816642"
}

Example Response
200
{
"status": "success",
"message": "Your message(s) was sent successfully.",
"data": [
        {
            "phone_number": "9195********",
            "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
            "message": "Message sent"
        },
        {
            "phone_number": "9188********",
            "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
            "message": "Message sent"
        }
    ]
}


SMS API


An API to send SMS to Contacts.

Overview

Parameters

- token: Your Unique FlockSend API Token.
- sender_id: Enter the 6 character sender ID code appro   ved by TRAI that people will see when they receive yo   ur SMS (Example: AIYOLB). To get your Sender Id appro   ved as an entity, please visit this link : Register y   our Sender ID. By default, Sender ID is 'AIYOLB'
- message: Message to be sent
- number_details: List of numbers with/without the use   r’s name to send the SMS campaign to.
- type: Can either be 1 (promotional) or 4 (transaction   al), no other type will be allowed.

Response Status Code

- 200: Success (Your message has been sent successfull   y)
- 400: Failure. (Missing parameters/wrong file formats)
POST Text Message

An API to send SMS to users.

URL : https://flocksend.com/api/connect/official/sms
BODY

{
    "token": 5f0c11**********af2,
        "sender_id": "******",
    "message": "Sample text message.",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "type": "4",
    "sms_language": "en",
}

NOTE:

- token,sender_id,message, number_details, type and sms_language are mandatory parameters.
- name in number_details is not a mandatory parameter.
- phone in number_details shall contain country code.
- type can either be 1 (promotional) or 4 (transactional), no other type will be allowed.
- for language codes, please refer here : language_codes

RESPONSE

{
    "code": "200",
    "message": "Your SMS has been sent successfully.",
    “data”:[{"sms_id":"2*8**7","number":"9195********"},{"sms_id":"2*8**8","number":"9188********"}]
}
POST Text Message (Click Tracking)

An API to send SMS to users with link tracking.

URL : https://flocksend.com/api/connect/official/sms
BODY

{
    "token": 5f0c11**********af2,
        "sender_id": "******",
    "message": "Sample text message. Click here {url}",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "type": "4",
    "sms_language": "en",
    "redirect_url": "https://www.facebook.com/"
}

NOTE:

- token,sender_id,message, number_details, type and sms_language are mandatory parameters.
- name in number_details is not a mandatory parameter.
- phone in number_details shall contain country code.
- type can either be 1 (promotional) or 4 (transactional), no other type will be allowed.
- for language codes, please refer here : language_codes
- redirect_url will be sent as c.wipoodi.com/******* which will redirect to the user's given url.

RESPONSE

{
    "code": "200",
    "message": "Your SMS has been sent successfully.",
    “data”:[{"sms_id":"2*8**7","number":"9195********"},{"sms_id":"2*8**8","number":"9188********"}]
}
Example Request - Text Message
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/sms \
  --data '{
    "token": "5f0c11**********af2",
    "sender_id": "******",
    "message": "Sample text message",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "type": "4",
    "sms_language": "en",
}'

Example Response
200
{
"message": "Your SMS has been sent successfully.",
"data": [
        {
            "sms_id": "******",
            "number": "9195********"
        },
        {
            "sms_id": "******",
            "number": "9188********"
        }
    ]
}












Example Request - Text Message (Click Tracking)
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/sms \
  --data '{
    "token": "zHaU3Il**********",
    "sender_id": "******",
    "message": "Sample text message. Click here {url}",
    “number_details”:
            '[{"name":"Arjun","phone":"9195********"},
            {"phone":"9188********"}]',
    "type": "4",
    "sms_language": "en",
    "redirect_url": "https://www.facebook.com/"
}'

Example Response
200
{
"message": "Your SMS has been sent successfully.",
"data": [
        {
            "sms_id": "******",
            "number": "9195********"
        },
        {
            "sms_id": "******",
            "number": "9188********"
        }
    ]
}











Email API


An API to send an email to Users.

Overview

Parameters

- token: Your Unique FlockSend API Token.
- message: Message to be sent
- subject: Subject for email
- email_details: List of emails with/wihout the user’s   name to send the email campaign to.

Response Status Code

- 200: Success (Your email has been sent successfully)
- 400: Failure. (Missing parameters/wrong file formats)
POST Text Message

An API to send email to users.

URL : https://flocksend.com/api/connect/official/email

Note:
- The <rp> tag is not supported.
- To add line breaks, bold, italics, etc, please refer to this link: Email Tags

BODY

{
    "token": 5f0c11**********af2,
    "subject": "Subject for email",
    "message": "Sample email body.",
    “email_details”:'[{"name":"Arjun","email":"arjun@flocksend.com"},{"email":"nishant@flocksend.com"}]'
}

NOTE:

- token, subject, message and email_details are mandatory parameters.
- name in email_details is not a mandatory parameter.

RESPONSE

{
    "code": "200",
    "message": "Your email has been sent successfully.",
    “data”:[{"email_id":"4**0","email":"arjun@flocksend.com"},{"email_id":"4**1","email":"nishant@flocksend.com"}],
}
POST Attachment

An API to send email with attachment to users.

URL : https://flocksend.com/api/connect/official/email

Note:
- The <rp> tag is not supported.
- To add line breaks, bold, italics, etc, please refer to this link: Email Tags

BODY

{
    "token": 5f0c11**********af2,
    "subject": "Subject for email",
    "message": "Sample email body.",
    “email_details”:'[{"name":"Arjun","email":"arjun@flocksend.com"},{"email":"nishant@flocksend.com"}]',
    "attachment_url": "https://flocksend.com/chat-bot/assets/images/flocksend-dark.png",
}

NOTE:

- token, subject, message, email_details and attachment_url are mandatory parameters.
- name in email_details is not a mandatory parameter.
- name in email_details is not a mandatory parameter.
- attachment_url should be a downloadable link. Google drive links and file attachments will not work!

RESPONSE

{
    "code": "200",
    "message": "Your email has been sent successfully.",
    “data”:[{"email_id":"4**0","email":"arjun@flocksend.com"},{"email_id":"4**1","email":"nishant@flocksend.com"}],
}
POST Attachment (Click Tracking with notification on open)

An API to send email with attachment and url tracking to users.

URL : https://flocksend.com/api/connect/official/email

Note:
- The <rp> tag is not supported.
- To add line breaks, bold, italics, etc, please refer to this link: Email Tags

BODY

{
"token": 5f0c11**********af2,
    "subject": "Subject for email",
    "message": "Sample email body.",
    “email_details”:'[{"name":"Arjun","email":"arjun@flocksend.com"},{"email":"nishant@flocksend.com"}]',
    "attachment_url": "https://flocksend.com/chat-bot/assets/images/flocksend-dark.png",
    "notify_me_on_open": "1",
    "redirect_url": "https://www.facebook.com/",
    "url_name": "Click Here",
}

NOTE:

- token, subject, message, email_details, attachment_url, notify_me_on_open, redirect_url and url_name are mandatory parameters.
- name in email_details is not a mandatory parameter.
- attachment_url should be a downloadable link. Google drive links and file attachments will not work!

RESPONSE

{
    "code": "200",
    "message": "Your email has been sent successfully.",
    “data”:[{"email_id":"4**0","email":"arjun@flocksend.com"}]
}











Example Request - Text Message (Email)
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/email \
  --data '{
	"token": "5f0c11**********af2",
    "subject": "Subject for email",
	"message": "Sample email body.",
    “email_details”:
            '[{"name":"Arjun","email":"arjun@flocksend.com"},
 	        {"email":"nishant@flocksend.com"}]'
}'

Example Response
200
{
"message": "Your email has been sent successfully.",
"data": [
        {
            "email_id": "******",
            "email": "arjun@flocksend.com"
        },
        {
            "email_id": "******",
            "email": "nishant@flocksend.com"
        }
    ]
}









Example Request - Attachment
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/email \
  --data '{
	"token": "5f0c11**********af2",
    "subject": "Subject for email",
	"message": "Sample email body.",
    “email_details”:
            '[{"name":"Arjun","email":"arjun@flocksend.com"},
 	        {"email":"nishant@flocksend.com"}]',
    "attachment_url": "https://flocksend.com/chat-bot/assets/images/flocksend-dark.png"
}'

Example Response
200
{
"message": "Your email has been sent successfully.",
"data": [
        {
            "email_id": "******",
            "email": "arjun@flocksend.com"
        },
        {
            "email_id": "******",
            "email": "nishant@flocksend.com"
        }
    ]
}













Example Request - Attachment (Click Tracking)
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/email \
  --data '{
	"token": "5f0c11**********af2",
    "subject": "Subject for email",
	"message": "Sample email body.",
    “email_details”:
            '[{"name":"Arjun","email":"arjun@flocksend.com"},
 	        {"email":"nishant@flocksend.com"}]',
    "attachment_url": "https://flocksend.com/chat-bot/assets/images/flocksend-dark.png",
    "notify_me_on_open": "1",
    "redirect_url": "https://www.facebook.com/",
    "url_name": "Click Here"
}'

Example Response
200
{
"message": "Your email has been sent successfully.",
"data": [
        {
            "email_id": "******",
            "email": "arjun@flocksend.com"
        },
        {
            "email_id": "******",
            "email": "nishant@flocksend.com"
        }
    ]
}




















Official Webhook


Our webhook helps you integrate SMS, Email and WhatsApp messages to your product. Here's what you need to get started with.

HOW?

We redirect the information of received SMS, Email and WhatsApp message to a URL you provide. For every record read, one API hit is made to your URL. Below is the API to be used for setting up your webhook URLs.

Type 1 - webhook url for WhatsApp incoming responses
Type 2 - webhook url for WhatsApp delivery status (V2)
Type 3 - webhook url for WhatsApp delivery status (V1)
Type 4 - webhook url for opened email status
Type 5 - webhook url for clicked link in email status
Type 6 - webhook url for sms delivery status
Type 7 - webhook url for clicked link in sms status
POST Update Webhook

An API to update your webhook URLs.

URL : https://flocksend.com/api/update-webhook
BODY

{
	"token": 5f0c11**********af2,
        "webhook_url": "Webhook URL",
	"webhook_status": "1",
	"webhook_type": "1"
}

NOTE:

- token, webhook_url, webhook_status and webhook_type are mandatory parameters.
- webhook_url is the URL to which the API hits will be made.
- webhook_status can either be 1 (active) or 2 (inactive), no other status will be allowed.
- webhook_type can be anywhere between 1 to 7. See below for more type details :
     1 - updates webhook url for WhatsApp incoming responses
     2 - updates webhook url for WhatsApp delivery status (V2)
     3 - updates webhook url for WhatsApp delivery status (V1)
     4 - updates webhook url for opened email status
     5 - updates webhook url for clicked link in email status
     6 - updates webhook url for sms delivery status
     7 - updates webhook url for clicked link in sms status

RESPONSE

{
	"code": "200",
        "message": "Webhook updated successfully"
}

NOTE

In case you have an incorrect/damaged URL, we won't be able to hit it. Five retries are made after which in case of failure, your Webhook URL will be deactivated and you will receive an E-mail regarding this.

User can modify and re-activate the URL using this API : Update Webhook URL

RESPONSES

Your webhook URL will be hit with the following JSON parameters:

V1 Webhook Response for Session and HSM messages

                            
        { id: "********", status: "accepted", date: "2020-01-01T07:23:29.749655Z"}
        { id: "********", status: "delivered", date: "2020-01-01T07:23:30Z"}
        { id: "********", status: "seen", date: "2020-01-01T07:24:34Z"}
                            
                        

NOTE:

- for every WhatsApp message sent, there are 3 hits made to your webhook url i.e. (accepted, delivered and seen).

V2 Webhook Response for Session messages

                            
        { id: "********", status: "delivered", date: "2020-01-01T05:14:02Z"}
        { id: "********", status: "seen", date: "2020-01-01T05:14:51Z"}
                            
                        

NOTE:

- for every WhatsApp session message sent, there are 2 hits made to your webhook url i.e. (delivered and seen).

V2 Webhook Response for HSM messages

                            
        { id: "********", status: "accepted", date: "2020-01-01T05:22:13.657027Z"}
        { id: "********", status: "delivered", date: "2020-01-01T05:22:14Z"}
        { id: "********", status: "seen", date: "2020-01-01T05:22:23Z"}
                            
                        

NOTE:

- for every WhatsApp message (HSM) sent, there are 3 hits made to your webhook url i.e. (accepted, delivered and seen).

SMS Delivery Response

                            
        { "sms_id": "********", number: "9195********", response_desc: "DELIVERED", response_status: "delivered", date: "2020-01-01 16:20:38"}
                            
                        

NOTE:

- for every SMS sent, the delivery response is as shown above.

SMS Click Tracking Response

                            
        { "sms_id": "********", number: "9195********", ip_addresses: "157.45.185.188", country_code: "IN", state_name: "Karnataka", location: "Bengaluru", latitude: "12.9719", longitude: "77.5937", device_type: "Web (Windows 10)", browser_type: "Chrome"}
                            
                        

NOTE:

- for every SMS with URL sent, the delivery response is as shown above.

Email Opened Response

                            
        { "email_id": "********", email: "arjun@flocksend.com", date:"2020-01-01 16:20:38"}
                            
                        

NOTE:

- for every email opened, the delivery response is as shown above. The response will show only if the email is opened.

Email Click Tracking Response

                            
        { "email_id": "********", email: "arjun@flocksend.com", ip_addresses: "157.45.185.188", country_code: "IN", state_name: "Karnataka", location: "Bengaluru", latitude: "12.9719", longitude: "77.5937", device_type: "Web (Windows 10)", browser_type: "Chrome"}
                            
                        

NOTE:

- for every email with URL sent, the delivery response is as shown above.

Webhook for incoming WhatsApp responses (Text Message)

                            
        { "message_id": "****************", message: "Hi, How are you?", phone_number: "91**********", wa_user_name: "**********", media_type: "text", date: "2020-01-01", time: "17:18:19", user_id: "***************"}
                            
                        

NOTE:

- for every WhatsApp text message sent by the user to your Official WhatsApp Business Account, the incoming response is as shown above.

Webhook for incoming WhatsApp responses (Media Message)

                            
        { "message_id": "*************", message: "Hi, How are you?", phone_number: "91**********", wa_user_name: "**********", media_type: "image", media_link: "https://flocksend.com/assets/OfficialMedia/Images/159239457411036100065eea034e6cbae.jpg", date