Flock Connect Official API


APIs to send messages to individual WhatsApp users. Each API is used to send messages of different types (Image, text, video and documents).

Overview

Parameters 'token' and 'number_details' are mandatory parameters.

- token: Unique access token provided to the user.
- number_details: List of numbers with the user’s name to send the campaign to.

Optional parameters

- file: image/video/document file link to be sent.
- message: Text to send to the user. Mandatory for 'Text' message API.
- title: Caption to send with the image/video.

Response Status Code

- 200: Success
- 400: Failure. (Missing parameters/wrong file formats/Plugin not connected)
POST Image
https://flocksend.com/api/connect/official/image

An API to send images to users.

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
	"title": "WhatsApp Image.",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 {"name":"Nishant","phone":"918892043629"}]',
"image": "https://flocksend.com/assets/images/a1.jpg"
}
POST Text Message
https://flocksend.com/api/connect/official/text

An API to send text message to users.

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
	"message": "Sample text message.",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]'
}
POST Video
https://flocksend.com/api/connect/official/video

An API to send videos to users in a particular campaign

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
	"title": "WhatsApp Video.",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
"video": "VideoFile.mp4"
}


POST Document
https://flocksend.com/api/connect/official/file

An API to send files to users in a particular campaign.

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
	"title": "WhatsApp File.",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
"file": "File.pdf"
}
POST HSM
https://flocksend.com/api/connect/official/hsm

An API to send HSM to users.

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
    "template_name": "notice_01"
	"template_argument": "arg1,arg2,arg3,arg4,arg5,arg6,arg7",
}
Example Request
Default

Example Response
200
{
  "status": "success",
   "message": "Successfully created and sending messages"
}


Example Request
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/text \
  --data '{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
	"message": "Sample text message.",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]'
}
'

Example Response
200
{
  "status": "success",
   "message": "Successfully created and sending messages"
}


Example Request
Default

Example Response
200
{
  "success": 1
}


Example Request
Default
curl --request POST \
  --url https://flocksend.com/api/connect/officialcontact/file \
  --data '{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
	"title": "WhatsApp File.",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
"file": "File.pdf"
}
'

Example Response
200
{
  "status": "success",
   "message": "Successfully created and sending messages"
}


Example Request
Default
curl --request POST \
  --url https://flocksend.com/api/connect/officialcontact/hsm \
  --data '{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
"template_name": "notice_01"
"template_argument": "arg1,arg2,arg3,arg4,arg5,arg6,arg7"
}
'

Example Response
200
{
  "status": "success",
   "message": "Successfully created and sending messages"
}


Flock Connect Official API - V2


APIs to send messages to individual WhatsApp users. Each API is used to send messages of different types (Image, text, video and documents).

Overview

Parameters 'token' and 'number_details' are mandatory parameters.

- token: Unique access token provided to the user.
- number_details: List of numbers with the user’s name to send the campaign to.

Optional parameters

- file: image/video/document file link to be sent.
- message: Text to send to the user. Mandatory for 'Text' message API.
- title: Caption to send with the image/video.

Response Status Code

- 200: Success
- 400: Failure. (Missing parameters/wrong file formats/Plugin not connected)
POST Text Message
https://flocksend.com/api/connect/official/v2/text

An API to send text message to users.

BODY

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









POST Image
https://flocksend.com/api/connect/official/v2/image

An API to send image to users.

BODY

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











POST Video
https://flocksend.com/api/connect/official/v2/video

An API to send video to users.

BODY

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











POST Document
https://flocksend.com/api/connect/official/v2/file

An API to send documents to users.

BODY

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











POST HSM
https://flocksend.com/api/connect/official/v2/hsm

An API to send HSM to users.

BODY

{
	"token": "zHaU3Il**********",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
    "template_name": "notice_01"
	"template_argument": "arg1,arg2,arg3,arg4,arg5,arg6,arg7",
	"language": "language_code",
}
Example Request
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/text \
  --data '{
	"token": "zHaU3Il**********",
	"message": "Hi {name} how are you",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]'
}

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


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

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


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

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


Example Request
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/file \
  --data '{
	"token": "zHaU3Il**********",
	"title": "WhatsApp File",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
}

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


Example Request
Default
curl --request POST \
  --url https://flocksend.com/api/connect/official/v2/hsm \
  --data '{
	"token": "zHaU3Il**********",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
"template_name": "notice_01"
"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": "919534785974",
                "id": "ea44afb0-efbb-4ea4-9e36-416f6334ae73",
                "message": "Message sent"
            },
            {
                "phone_number": "918892043629",
                "id": "13732585-11db-4ecc-b62b-bf9bc47e71de",
                "message": "Message sent"
            }
    ]
}


Flock Connect SMS API


APIs to send messages to Contacts.

Overview

Parameters 'token', 'sender_id', 'message', 'number_details' are mandatory parameters.

- token: Unique access token provided to the user.
- sender_id:
- message: Message to be sent
- number_details: List of numbers with the user’s name to send the campaign to.

Response Status Code

- 200: Success (Your message has been sent successfully)
- 400: Failure. (Missing parameters/wrong file formats/Plugin not connected)
POST Text Message
https://flocksend.com/api/connect/official/sms

An API to send text message to users.

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
        "sender_id": "FLK******",
	"message": "Sample text message.",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
        "type": "message type (specifies url toggle).",
        "sms_language": "language (en).",
}
RESPONSE

{
	"code": "200",
        "message": "Your SMS has been sent successfully.",
        “data”:[{"sms_id":"2*8**7","number":"919534785974","response_desc":"DELIVERED","response_status":"delivered","response_date":"2020-06-02 16:20:38"},
 	{"sms_id":"2*8**8","number":"918892043629","response_desc":"DELIVERED","response_status":"delivered","response_date":"2020-06-02 16:20:38"}]
}
POST Text Message (Link Tracking)
https://flocksend.com/api/connect/official/sms

An API to send text message to users with link tracking.

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
        "sender_id": "FLK******",
	"message": "Sample text message. Click here {url}",
“number_details”:
'[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]',
        "type": "message type (specifies url toggle).",
        "sms_language": "language (en).",
        "redirect_url": "https://www.facebook.com/"
}
RESPONSE

{
	"code": "200",
        "message": "Your SMS has been sent successfully.",
        “data”:[{"sms_id":"2*8**7","number":"919534785974","ip_address":"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"}]
}

Flock Connect Email API


APIs to send emails to Users.

Overview

Parameters 'token', 'message', 'subject', 'email_details' are mandatory parameters.

- token: Unique access token provided to the user.
- message: Message to be sent
- subject: Subject for email
- email_details: List of emails with the user’s name to send the campaign to.

Response Status Code

- 200: Success (Your email has been sent successfully)
- 400: Failure. (Missing parameters/wrong file formats/Plugin not connected)
POST Text Message
https://flocksend.com/api/connect/official/email

An API to send email to users.

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
        "subject": "Subject for email",
	"message": "Sample email body.",
“email_details”:
'[{"name":"Arjun","email":"arjun@aiyolabs.com"},
 	{"name":"Nishant","email":"nishant@aiyolabs.com"}]',
}
RESPONSE

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

An API to send email with attachment to users.

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
        "subject": "Subject for email",
	"message": "Sample email body.",
“email_details”:
'[{"name":"Arjun","email":"arjun@aiyolabs.com"},
 	{"name":"Nishant","email":"nishant@aiyolabs.com"}]',
        "attachment_url": "https://flocksend.com/chat-bot/assets/images/flocksend-dark.png",
}
RESPONSE

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

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

BODY

{
	"token": "c0****91-1**e-4**d-8**2-*******2a",
        "subject": "Subject for email",
	"message": "Sample email body.",
“email_details”:
'[{"name":"Arjun","email":"arjun@aiyolabs.com"},
 	{"name":"Nishant","email":"nishant@aiyolabs.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",
}
RESPONSE

{
	"code": "200",
        "message": "Your email has been sent successfully.",
“data”:[{"email_id":"4**0","email":"arjun@aiyolabs.com","ip_address":"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"}]
}

Flock Listen Webhook


Our webhook helps you integrate WhatsApp messages to your product. Here's what you need to get started on it.

HOW?

We redirect the information of received WhatsApp message to a URL you provide. For every record read in Flock Listen, one API hit is made to your URL. Contact us for setup.

FALLBACK

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.

PARAMETERS

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

V1 Webhook Response for Session and HSM messages

                            
        { id: "********", status: "accepted", date: "2020-06-12T07:23:29.749655Z"}
        { id: "********", status: "delivered", date: "2020-06-12T07:23:30Z"}
        { id: "********", status: "seen", date: "2020-06-12T07:24:34Z"}
                            
                        
V2 Webhook Response for Session messages

                            
        { id: "********", status: "delivered", date: "2020-06-15T05:14:02Z"}
        { id: "********", status: "seen", date: "2020-06-15T05:14:51Z"}
                            
                        
V2 Webhook Response for HSM messages

                            
        { id: "********", status: "accepted", date: "2020-06-15T05:22:13.657027Z"}
        { id: "********", status: "delivered", date: "2020-06-15T05:22:14Z"}
        { id: "********", status: "seen", date: "2020-06-15T05:22:23Z"}
                            
                        
SMS Delivery Response

                            
        { "sms_id": "********", number: "919534785974", response_desc: "DELIVERED", response_status: "delivered", date: "2020-06-02 16:20:38"}
                            
                        
SMS Click Tracking Response

                            
        { "sms_id": "********", number: "919534785974", 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"}
                            
                        
Email Click Tracking Response

                            
        { "email_id": "********", email: "arjun@aiyolabs.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"}
                            
                        
Listen Webhook (Text Message)

                            
        { "message_id": "****************", message: "Hi, How are you?", phone_number: "91**********", media_type: "text", date: "2020-06-17", time: "17:18:19", user_id: "***************"}
                            
                        
Listen Webhook (Media Message)

                            
        { "message_id": "*************", message: "Hi, How are you?", phone_number: "91**********", media_type: "image", media_link: "\/assets\/OfficialMedia\/Images\/159239457411036100065eea034e6cbae.jpg", date: "2020-06-17", time: "17:19:34", user_id: "****************"}