curl --request POST \
--url https://api.bigco.ai/api/v1/messages \
--header 'Content-Type: application/json' \
--header 'x-bigco-hmac-sha256: <api-key>' \
--data '
{
"user_id": 123,
"body": "Thank you for contacting us! How can we help you today?",
"media_item_uuids": [
"550e8400-e29b-41d4-a716-446655440000"
],
"type": "CONVERSATIONAL"
}
'import requests
url = "https://api.bigco.ai/api/v1/messages"
payload = {
"user_id": 123,
"body": "Thank you for contacting us! How can we help you today?",
"media_item_uuids": ["550e8400-e29b-41d4-a716-446655440000"],
"type": "CONVERSATIONAL"
}
headers = {
"x-bigco-hmac-sha256": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-bigco-hmac-sha256': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 123,
body: JSON.stringify('Thank you for contacting us! How can we help you today?'),
media_item_uuids: ['550e8400-e29b-41d4-a716-446655440000'],
type: 'CONVERSATIONAL'
})
};
fetch('https://api.bigco.ai/api/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bigco.ai/api/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 123,
'body' => 'Thank you for contacting us! How can we help you today?',
'media_item_uuids' => [
'550e8400-e29b-41d4-a716-446655440000'
],
'type' => 'CONVERSATIONAL'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-bigco-hmac-sha256: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bigco.ai/api/v1/messages"
payload := strings.NewReader("{\n \"user_id\": 123,\n \"body\": \"Thank you for contacting us! How can we help you today?\",\n \"media_item_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"type\": \"CONVERSATIONAL\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-bigco-hmac-sha256", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bigco.ai/api/v1/messages")
.header("x-bigco-hmac-sha256", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": 123,\n \"body\": \"Thank you for contacting us! How can we help you today?\",\n \"media_item_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"type\": \"CONVERSATIONAL\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bigco.ai/api/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-bigco-hmac-sha256"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": 123,\n \"body\": \"Thank you for contacting us! How can we help you today?\",\n \"media_item_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"type\": \"CONVERSATIONAL\"\n}"
response = http.request(request)
puts response.read_body{
"id": 12345,
"user_id": 123,
"direction": "outbound",
"status": "delivered",
"date_created": "2024-05-15T10:29:50Z",
"body": "Thank you for contacting us! How can we help you today?",
"media_item_uuids": [
"550e8400-e29b-41d4-a716-446655440000"
],
"type": "CONVERSATIONAL",
"date_sent": "2024-05-15T10:30:00Z",
"date_delivered": "2024-05-15T10:30:05Z"
}{
"detail": {
"type": "not_authenticated",
"msg": "HMAC signature verification failed"
}
}{
"detail": {
"type": "not_authenticated",
"msg": "HMAC signature verification failed"
}
}{
"detail": {
"type": "UNCAUGHT_ERROR",
"msg": "Internal server error"
}
}Send a message
Sends a message to a user.
curl --request POST \
--url https://api.bigco.ai/api/v1/messages \
--header 'Content-Type: application/json' \
--header 'x-bigco-hmac-sha256: <api-key>' \
--data '
{
"user_id": 123,
"body": "Thank you for contacting us! How can we help you today?",
"media_item_uuids": [
"550e8400-e29b-41d4-a716-446655440000"
],
"type": "CONVERSATIONAL"
}
'import requests
url = "https://api.bigco.ai/api/v1/messages"
payload = {
"user_id": 123,
"body": "Thank you for contacting us! How can we help you today?",
"media_item_uuids": ["550e8400-e29b-41d4-a716-446655440000"],
"type": "CONVERSATIONAL"
}
headers = {
"x-bigco-hmac-sha256": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-bigco-hmac-sha256': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 123,
body: JSON.stringify('Thank you for contacting us! How can we help you today?'),
media_item_uuids: ['550e8400-e29b-41d4-a716-446655440000'],
type: 'CONVERSATIONAL'
})
};
fetch('https://api.bigco.ai/api/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bigco.ai/api/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 123,
'body' => 'Thank you for contacting us! How can we help you today?',
'media_item_uuids' => [
'550e8400-e29b-41d4-a716-446655440000'
],
'type' => 'CONVERSATIONAL'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-bigco-hmac-sha256: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bigco.ai/api/v1/messages"
payload := strings.NewReader("{\n \"user_id\": 123,\n \"body\": \"Thank you for contacting us! How can we help you today?\",\n \"media_item_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"type\": \"CONVERSATIONAL\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-bigco-hmac-sha256", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bigco.ai/api/v1/messages")
.header("x-bigco-hmac-sha256", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": 123,\n \"body\": \"Thank you for contacting us! How can we help you today?\",\n \"media_item_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"type\": \"CONVERSATIONAL\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bigco.ai/api/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-bigco-hmac-sha256"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": 123,\n \"body\": \"Thank you for contacting us! How can we help you today?\",\n \"media_item_uuids\": [\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"type\": \"CONVERSATIONAL\"\n}"
response = http.request(request)
puts response.read_body{
"id": 12345,
"user_id": 123,
"direction": "outbound",
"status": "delivered",
"date_created": "2024-05-15T10:29:50Z",
"body": "Thank you for contacting us! How can we help you today?",
"media_item_uuids": [
"550e8400-e29b-41d4-a716-446655440000"
],
"type": "CONVERSATIONAL",
"date_sent": "2024-05-15T10:30:00Z",
"date_delivered": "2024-05-15T10:30:05Z"
}{
"detail": {
"type": "not_authenticated",
"msg": "HMAC signature verification failed"
}
}{
"detail": {
"type": "not_authenticated",
"msg": "HMAC signature verification failed"
}
}{
"detail": {
"type": "UNCAUGHT_ERROR",
"msg": "Internal server error"
}
}Authorizations
Base64-encoded HMAC-SHA256 signature of the request. Every request must also include the x-bigco-hmac-username and x-date headers, and POST/PUT requests must include x-digest. See the Authentication guide for the full signing procedure.
Body
The ID of the recipient user.
x >= 1123
The text of the message.
"Thank you for contacting us! How can we help you today?"
UUIDs of media items (uploaded via the Files API) to attach to the message.
["550e8400-e29b-41d4-a716-446655440000"]
The message type, e.g. CONVERSATIONAL.
"CONVERSATIONAL"
Response
The message that was queued for delivery.
12345
x >= 1123
inbound if received from a user, outbound if sent to a user.
inbound, outbound "outbound"
Delivery status of the message.
queued, sent, delivered, failed, undelivered "delivered"
"2024-05-15T10:29:50Z"
"Thank you for contacting us! How can we help you today?"
["550e8400-e29b-41d4-a716-446655440000"]
"CONVERSATIONAL"
"2024-05-15T10:30:00Z"
"2024-05-15T10:30:05Z"