curl --request POST \
--url https://apichatcore.beem.africa/v1/chatapi \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "255701000000",
"to": "255701000001",
"channel": "whatsapp",
"transaction_id": "4f6eec48-4140-4ce8-80c5-cef0e189578c",
"message_type": "text",
"text": "Hello there"
}
'import requests
url = "https://apichatcore.beem.africa/v1/chatapi"
payload = {
"from": "255701000000",
"to": "255701000001",
"channel": "whatsapp",
"transaction_id": "4f6eec48-4140-4ce8-80c5-cef0e189578c",
"message_type": "text",
"text": "Hello there"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '255701000000',
to: '255701000001',
channel: 'whatsapp',
transaction_id: '4f6eec48-4140-4ce8-80c5-cef0e189578c',
message_type: 'text',
text: 'Hello there'
})
};
fetch('https://apichatcore.beem.africa/v1/chatapi', 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://apichatcore.beem.africa/v1/chatapi",
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([
'from' => '255701000000',
'to' => '255701000001',
'channel' => 'whatsapp',
'transaction_id' => '4f6eec48-4140-4ce8-80c5-cef0e189578c',
'message_type' => 'text',
'text' => 'Hello there'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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://apichatcore.beem.africa/v1/chatapi"
payload := strings.NewReader("{\n \"from\": \"255701000000\",\n \"to\": \"255701000001\",\n \"channel\": \"whatsapp\",\n \"transaction_id\": \"4f6eec48-4140-4ce8-80c5-cef0e189578c\",\n \"message_type\": \"text\",\n \"text\": \"Hello there\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://apichatcore.beem.africa/v1/chatapi")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"255701000000\",\n \"to\": \"255701000001\",\n \"channel\": \"whatsapp\",\n \"transaction_id\": \"4f6eec48-4140-4ce8-80c5-cef0e189578c\",\n \"message_type\": \"text\",\n \"text\": \"Hello there\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apichatcore.beem.africa/v1/chatapi")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"255701000000\",\n \"to\": \"255701000001\",\n \"channel\": \"whatsapp\",\n \"transaction_id\": \"4f6eec48-4140-4ce8-80c5-cef0e189578c\",\n \"message_type\": \"text\",\n \"text\": \"Hello there\"\n}"
response = http.request(request)
puts response.read_body{
"message": "SUCCESS"
}{
"code": 400,
"message": "No authorization headers"
}{
"code": 120,
"message": "Invalid Authentication Parameters"
}{
"code": 404,
"message": "The session has expired"
}Send session message
Send a message to a user with an active session. Session messaging is limited to the 24-hour window after the user last interacted with your business; outside that window use approved WhatsApp templates instead.
curl --request POST \
--url https://apichatcore.beem.africa/v1/chatapi \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "255701000000",
"to": "255701000001",
"channel": "whatsapp",
"transaction_id": "4f6eec48-4140-4ce8-80c5-cef0e189578c",
"message_type": "text",
"text": "Hello there"
}
'import requests
url = "https://apichatcore.beem.africa/v1/chatapi"
payload = {
"from": "255701000000",
"to": "255701000001",
"channel": "whatsapp",
"transaction_id": "4f6eec48-4140-4ce8-80c5-cef0e189578c",
"message_type": "text",
"text": "Hello there"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '255701000000',
to: '255701000001',
channel: 'whatsapp',
transaction_id: '4f6eec48-4140-4ce8-80c5-cef0e189578c',
message_type: 'text',
text: 'Hello there'
})
};
fetch('https://apichatcore.beem.africa/v1/chatapi', 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://apichatcore.beem.africa/v1/chatapi",
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([
'from' => '255701000000',
'to' => '255701000001',
'channel' => 'whatsapp',
'transaction_id' => '4f6eec48-4140-4ce8-80c5-cef0e189578c',
'message_type' => 'text',
'text' => 'Hello there'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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://apichatcore.beem.africa/v1/chatapi"
payload := strings.NewReader("{\n \"from\": \"255701000000\",\n \"to\": \"255701000001\",\n \"channel\": \"whatsapp\",\n \"transaction_id\": \"4f6eec48-4140-4ce8-80c5-cef0e189578c\",\n \"message_type\": \"text\",\n \"text\": \"Hello there\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://apichatcore.beem.africa/v1/chatapi")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"255701000000\",\n \"to\": \"255701000001\",\n \"channel\": \"whatsapp\",\n \"transaction_id\": \"4f6eec48-4140-4ce8-80c5-cef0e189578c\",\n \"message_type\": \"text\",\n \"text\": \"Hello there\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apichatcore.beem.africa/v1/chatapi")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"255701000000\",\n \"to\": \"255701000001\",\n \"channel\": \"whatsapp\",\n \"transaction_id\": \"4f6eec48-4140-4ce8-80c5-cef0e189578c\",\n \"message_type\": \"text\",\n \"text\": \"Hello there\"\n}"
response = http.request(request)
puts response.read_body{
"message": "SUCCESS"
}{
"code": 400,
"message": "No authorization headers"
}{
"code": 120,
"message": "Invalid Authentication Parameters"
}{
"code": 404,
"message": "The session has expired"
}Authorizations
Beem API credentials: API key as username, API secret as password.
Body
Your MOJA channel number (WhatsApp-enabled sender).
Recipient mobile number (include the country code)
Type of session message to send.
text, image, location, document, quick_reply, list, video Messaging channel.
whatsapp, facebook, sms, instagram Optional client reference (UUID v4).
Optional URL where inbound replies are delivered.
Message text when message_type is text.
Image attachment when message_type is image.
Show child attributes
Show child attributes
Video attachment when message_type is video.
Show child attributes
Show child attributes
Document attachment when message_type is document.
Show child attributes
Show child attributes
Location pin when message_type is location.
Show child attributes
Show child attributes
Interactive quick-reply buttons when message_type is quick_reply.
Interactive list message when message_type is list.
Response
Successful response
"SUCCESS"
