Create contact
curl --request POST \
--url https://api-contact.beem.africa/public/v1/contacts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"mob_no": "255700000001",
"mob_no2": "255700000002",
"email": "john.doe@example.com",
"gender": "male",
"title": "Mr.",
"addressbook_id": [
"604919718fb019194453764e"
],
"address_country": "Tanzania",
"address_city": "Dar es Salaam",
"address_area": "Kijitonyama",
"dob": "1990-01-01"
}
'import requests
url = "https://api-contact.beem.africa/public/v1/contacts"
payload = {
"first_name": "John",
"last_name": "Doe",
"mob_no": "255700000001",
"mob_no2": "255700000002",
"email": "john.doe@example.com",
"gender": "male",
"title": "Mr.",
"addressbook_id": ["604919718fb019194453764e"],
"address_country": "Tanzania",
"address_city": "Dar es Salaam",
"address_area": "Kijitonyama",
"dob": "1990-01-01"
}
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({
first_name: 'John',
last_name: 'Doe',
mob_no: '255700000001',
mob_no2: '255700000002',
email: 'john.doe@example.com',
gender: 'male',
title: 'Mr.',
addressbook_id: ['604919718fb019194453764e'],
address_country: 'Tanzania',
address_city: 'Dar es Salaam',
address_area: 'Kijitonyama',
dob: '1990-01-01'
})
};
fetch('https://api-contact.beem.africa/public/v1/contacts', 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-contact.beem.africa/public/v1/contacts",
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([
'first_name' => 'John',
'last_name' => 'Doe',
'mob_no' => '255700000001',
'mob_no2' => '255700000002',
'email' => 'john.doe@example.com',
'gender' => 'male',
'title' => 'Mr.',
'addressbook_id' => [
'604919718fb019194453764e'
],
'address_country' => 'Tanzania',
'address_city' => 'Dar es Salaam',
'address_area' => 'Kijitonyama',
'dob' => '1990-01-01'
]),
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://api-contact.beem.africa/public/v1/contacts"
payload := strings.NewReader("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000001\",\n \"mob_no2\": \"255700000002\",\n \"email\": \"john.doe@example.com\",\n \"gender\": \"male\",\n \"title\": \"Mr.\",\n \"addressbook_id\": [\n \"604919718fb019194453764e\"\n ],\n \"address_country\": \"Tanzania\",\n \"address_city\": \"Dar es Salaam\",\n \"address_area\": \"Kijitonyama\",\n \"dob\": \"1990-01-01\"\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://api-contact.beem.africa/public/v1/contacts")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000001\",\n \"mob_no2\": \"255700000002\",\n \"email\": \"john.doe@example.com\",\n \"gender\": \"male\",\n \"title\": \"Mr.\",\n \"addressbook_id\": [\n \"604919718fb019194453764e\"\n ],\n \"address_country\": \"Tanzania\",\n \"address_city\": \"Dar es Salaam\",\n \"address_area\": \"Kijitonyama\",\n \"dob\": \"1990-01-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-contact.beem.africa/public/v1/contacts")
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 \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000001\",\n \"mob_no2\": \"255700000002\",\n \"email\": \"john.doe@example.com\",\n \"gender\": \"male\",\n \"title\": \"Mr.\",\n \"addressbook_id\": [\n \"604919718fb019194453764e\"\n ],\n \"address_country\": \"Tanzania\",\n \"address_city\": \"Dar es Salaam\",\n \"address_area\": \"Kijitonyama\",\n \"dob\": \"1990-01-01\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "60e99589eeadc6338b16cb42",
"message": "Contact added successfully",
"status": "true"
}
}{
"status": 400,
"message": "Invalid Mobile Number"
}{
"code": 120,
"message": "Invalid Authorization Parameters"
}{
"data": {
"message": "Addressbook Not Found",
"status": "false"
}
}{
"data": {
"message": "Contact already exists",
"status": "false"
}
}API Reference
Create contact
POST
/
contacts
Create contact
curl --request POST \
--url https://api-contact.beem.africa/public/v1/contacts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"mob_no": "255700000001",
"mob_no2": "255700000002",
"email": "john.doe@example.com",
"gender": "male",
"title": "Mr.",
"addressbook_id": [
"604919718fb019194453764e"
],
"address_country": "Tanzania",
"address_city": "Dar es Salaam",
"address_area": "Kijitonyama",
"dob": "1990-01-01"
}
'import requests
url = "https://api-contact.beem.africa/public/v1/contacts"
payload = {
"first_name": "John",
"last_name": "Doe",
"mob_no": "255700000001",
"mob_no2": "255700000002",
"email": "john.doe@example.com",
"gender": "male",
"title": "Mr.",
"addressbook_id": ["604919718fb019194453764e"],
"address_country": "Tanzania",
"address_city": "Dar es Salaam",
"address_area": "Kijitonyama",
"dob": "1990-01-01"
}
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({
first_name: 'John',
last_name: 'Doe',
mob_no: '255700000001',
mob_no2: '255700000002',
email: 'john.doe@example.com',
gender: 'male',
title: 'Mr.',
addressbook_id: ['604919718fb019194453764e'],
address_country: 'Tanzania',
address_city: 'Dar es Salaam',
address_area: 'Kijitonyama',
dob: '1990-01-01'
})
};
fetch('https://api-contact.beem.africa/public/v1/contacts', 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-contact.beem.africa/public/v1/contacts",
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([
'first_name' => 'John',
'last_name' => 'Doe',
'mob_no' => '255700000001',
'mob_no2' => '255700000002',
'email' => 'john.doe@example.com',
'gender' => 'male',
'title' => 'Mr.',
'addressbook_id' => [
'604919718fb019194453764e'
],
'address_country' => 'Tanzania',
'address_city' => 'Dar es Salaam',
'address_area' => 'Kijitonyama',
'dob' => '1990-01-01'
]),
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://api-contact.beem.africa/public/v1/contacts"
payload := strings.NewReader("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000001\",\n \"mob_no2\": \"255700000002\",\n \"email\": \"john.doe@example.com\",\n \"gender\": \"male\",\n \"title\": \"Mr.\",\n \"addressbook_id\": [\n \"604919718fb019194453764e\"\n ],\n \"address_country\": \"Tanzania\",\n \"address_city\": \"Dar es Salaam\",\n \"address_area\": \"Kijitonyama\",\n \"dob\": \"1990-01-01\"\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://api-contact.beem.africa/public/v1/contacts")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000001\",\n \"mob_no2\": \"255700000002\",\n \"email\": \"john.doe@example.com\",\n \"gender\": \"male\",\n \"title\": \"Mr.\",\n \"addressbook_id\": [\n \"604919718fb019194453764e\"\n ],\n \"address_country\": \"Tanzania\",\n \"address_city\": \"Dar es Salaam\",\n \"address_area\": \"Kijitonyama\",\n \"dob\": \"1990-01-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-contact.beem.africa/public/v1/contacts")
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 \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000001\",\n \"mob_no2\": \"255700000002\",\n \"email\": \"john.doe@example.com\",\n \"gender\": \"male\",\n \"title\": \"Mr.\",\n \"addressbook_id\": [\n \"604919718fb019194453764e\"\n ],\n \"address_country\": \"Tanzania\",\n \"address_city\": \"Dar es Salaam\",\n \"address_area\": \"Kijitonyama\",\n \"dob\": \"1990-01-01\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "60e99589eeadc6338b16cb42",
"message": "Contact added successfully",
"status": "true"
}
}{
"status": 400,
"message": "Invalid Mobile Number"
}{
"code": 120,
"message": "Invalid Authorization Parameters"
}{
"data": {
"message": "Addressbook Not Found",
"status": "false"
}
}{
"data": {
"message": "Contact already exists",
"status": "false"
}
}Authorizations
basicAuthaccessToken
Beem API credentials: API key as username, API secret as password.
Body
application/json
Primary mobile number (digits only, with country code).
One or more address book IDs to add this contact to.
Contact first name.
Contact last name.
Salutation or title (e.g. Mr, Ms).
Contact gender.
Secondary mobile number.
Contact email address.
Pattern:
\s*[,]\s*Country of residence.
City of residence.
Area or district.
Date of birth.
Response
Contact created successfully.
Show child attributes
Show child attributes
⌘I
