#
Send message
- Send a message on Twilio SMS, Twilio WhatsApp or Gupshup WhatsApp channel.
- You can also send one or more images or a file.
- Optionally, you can also save recipient in a contact list.
#
Method
POST
#
Path
/message
#
Body parameters
#
contact_saving
This field is for passing instruction to save phone number and name as a contact. If the contact already exists, it will be updated. Extra custom fields can also be passed.
#
Response
#
HTTP status codes
#
Response object
#
Code samples
#
Sending only text content
curl --location --request POST 'https://api.sociocs.com/message' \
--header 'apikey: [your api key]' \
--header 'Content-Type: application/json' \
--data-raw '{
"provider": "[provider]",
"channel_key": "[your channel key]",
"to": "[phone number]",
"name": "[recipient name]",
"text": "[message]"
}'
#
Sending text & image
curl --location --request POST 'https://api.sociocs.com/message' \
--header 'apikey: [your api key]' \
--header 'Content-Type: application/json' \
--data-raw '{
"provider": "[provider]",
"channel_key": "[your channel key]",
"to": "[phone number]",
"name": "[recipient name]",
"text": "[message]",
"image_url": "[image url]"
}'
#
Sending only images
curl --location --request POST 'https://api.sociocs.com/message' \
--header 'apikey: [your api key]' \
--header 'Content-Type: application/json' \
--data-raw '{
"provider": "[provider]",
"channel_key": "[your channel key]",
"to": "[phone number]",
"name": "[recipient name]",
"image_urls": [
"[image url 1]",
"[image url 2]",
"[image url 3]"
]
}'