Flock Connect Contact API


APIs to create campaigns with individual WhatsApp users. Each API is used to create a campaing for different message types (Image, text, video, URL and documents).

Overview

Parameters 'token','message','title' and 'number_details' are mandatory parameters.

- token: Unique access token provided to the user at sign-up.
- message: Raw text intended to send.
- title: Title of the Flock Connect campaign.
- number_details: List of numbers with the user’s name to send the campaign to.

Optional parameters

- file: text/link/image/video/any file type to be sent.
- metadata content: image and title with URLs.

Response Status Code

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

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

BODY

{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample text message.",
	"title": "Sample Campaign Title"
“number_details”:
[{"name":"Arjun","phone":"919534785974"},
 {"name":"Nishant","phone":"918892043629"}],
"image": "ImageFile.jpg"
}
POST Text Message
https://api.flocksend.com/api/connect/contact/text

An API to send text message to users in a particular campaign.

BODY

{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample text message.",
	"title": "Sample Campaign Title"
“number_details”:
[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]
}
POST Video
https://api.flocksend.com/api/connect/contact/video

An API to send videos to users in a particular campaign

BODY

{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample text message.",
	"title": "Sample Campaign Title"
“number_details”:
[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}],
"video": "VideoFile.mp4"
}
POST Document
https://api.flocksend.com/api/connect/contact/file

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

BODY

{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample Text Message",
	"title": "Sample Campaign Title"
“number_details”:
[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}],
"file": "File.pdf"
}
Example Request
Default

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


Example Request
Default
curl --request POST \
  --url https://api.flocksend.com/api/connect/contact/text \
  --data '{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample text message.",
	"title": "Sample Campaign Title"
“number_details”:
[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}]
}
'

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


Example Request
Default
curl --request POST \
  --url https://api.flocksend.com/api/connect/contact/link \
  --data '{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample text message.",
	"title": "Sample Campaign Title"
“number_details”:
[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}],
"image": "ImageFile.jpg"
            "link": "www.someurllink.com"
"link_title": "Sample Website"

}
'

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://api.flocksend.com/api/connect/contact/file \
  --data '{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample Text Message",
	"title": "Sample Campaign Title"
“number_details”:
[{"name":"Arjun","phone":"919534785974"},
 	{"name":"Nishant","phone":"918892043629"}],
"file": "File.pdf"
}
'

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


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. Simply paste your URL in your 'Webhook Settings' and turn on the Webhook status. For every record read in Flock Listen, one API hit is made to your URL.

COST

We charge 1 credit for each Webhook hit.

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. Don't worry, we don't charge any credits when it fails.

User can modify and re-activate the URL.

PARAMETERS

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

Response

                            
                                stdClass Object(
                                    [message_id]: "5bebaee99cf858690b41dc74",
                                    [message]: "Sample text message.",
                                    [phone_number]: "Sample Campaign Title"
                                    [group_name]: "917097197955-1539171951"
                                    [media_type]: "VideoFile.mp4"
                                    [message_type]: "VideoFile.mp4"
                                    [date]: "VideoFile.mp4"
                                    [time]: "VideoFile.mp4"
                                    [user_id]: "VideoFile.mp4"
                                )
                            
                        

where,

message_id is a unique identification for each message.

user_id is your unique ID to prevent data breach.

Flock Connect Group API


Set of APIs to add campaign with different message inputs - text, file, video, image and URL links.

Every API authenticates and validates user by their access token.

Response Status Codes

- 200: Success
- 400: Failure (Missing parameters or incorrect file format)
POST Image
https://api.flocksend.com/api/connect/group/image

An API to send images to WhatsApp group chats.

BODY

{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample text message.",
	"title": "Sample Campaign Title"
            "group_id": "["group1","group2","group3"]"
"image": "ImageFile.jpg"
}
POST Text Message
https://api.flocksend.com/api/connect/group/text

An API to send text to WhatsApp group chats.

BODY

{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample text message.",
	"title": "Sample Campaign Title"
            "group_id": "["group1","group2","group3"]"
}
POST Video
https://api.flocksend.com/api/connect/group/video

An API to send videos to WhatsApp group chats.

BODY

{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample text message.",
	"title": "Sample Campaign Title"
            "group_id": "["group1","group2","group3"]"
"video": "VideoFile.mp4"
}
POST Document
https://api.flocksend.com/api/connect/group/file

An API to send a file to WhatsApp group chats.

BODY

{
	"token": "5bebaee99cf858690b41dc74",
	"file_name": "Name of File",
	"title": "Sample Campaign Title"
            "group_details": "["group1","group2","group3"]"
"file": "File.pdf"
}
Example Request
Default

Example Response
200
{
  "success": 1
}


Example Request
Default
curl --request POST \
  --url https://aiyolabs.com/api/create-campaign/group/text \
  --data '{
	"token": "5bebaee99cf858690b41dc74",
	"message": "Sample text message.",
	"title": "Sample Campaign Title"
            "group_id": "["group1","group2","group3"]"
}
'

Example Response
200
{
  "success": 1
}


Example Request
Default

Example Response
200
{
  "success": 1
}


Example Request
Default

Example Response
200
{
  "success": 1
}


Example Request
Default
Example Response
200
{
  "success": 1
}