Update contact
curl --request PUT \
--url https://api-contact.beem.africa/public/v1/contacts/{contact_id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Jane",
"last_name": "Doe",
"mob_no": "255700000003",
"email": "jane.doe@example.com"
}
'import requests
url = "https://api-contact.beem.africa/public/v1/contacts/{contact_id}"
payload = {
"first_name": "Jane",
"last_name": "Doe",
"mob_no": "255700000003",
"email": "jane.doe@example.com"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: 'Jane',
last_name: 'Doe',
mob_no: '255700000003',
email: 'jane.doe@example.com'
})
};
fetch('https://api-contact.beem.africa/public/v1/contacts/{contact_id}', 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/{contact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => 'Jane',
'last_name' => 'Doe',
'mob_no' => '255700000003',
'email' => 'jane.doe@example.com'
]),
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/{contact_id}"
payload := strings.NewReader("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000003\",\n \"email\": \"jane.doe@example.com\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-contact.beem.africa/public/v1/contacts/{contact_id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000003\",\n \"email\": \"jane.doe@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-contact.beem.africa/public/v1/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000003\",\n \"email\": \"jane.doe@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "6093ee8b46e0380018962d2a",
"message": "Contact Updated Successfully",
"status": "true"
}
}{
"status": 400,
"message": "Invalid Mobile Number"
}{
"code": 120,
"message": "Invalid Authorization Parameters"
}{
"data": {
"message": "Contact Not Found",
"status": "false"
}
}API Reference
Update contact
PUT
/
contacts
/
{contact_id}
Update contact
curl --request PUT \
--url https://api-contact.beem.africa/public/v1/contacts/{contact_id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Jane",
"last_name": "Doe",
"mob_no": "255700000003",
"email": "jane.doe@example.com"
}
'import requests
url = "https://api-contact.beem.africa/public/v1/contacts/{contact_id}"
payload = {
"first_name": "Jane",
"last_name": "Doe",
"mob_no": "255700000003",
"email": "jane.doe@example.com"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: 'Jane',
last_name: 'Doe',
mob_no: '255700000003',
email: 'jane.doe@example.com'
})
};
fetch('https://api-contact.beem.africa/public/v1/contacts/{contact_id}', 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/{contact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => 'Jane',
'last_name' => 'Doe',
'mob_no' => '255700000003',
'email' => 'jane.doe@example.com'
]),
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/{contact_id}"
payload := strings.NewReader("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000003\",\n \"email\": \"jane.doe@example.com\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-contact.beem.africa/public/v1/contacts/{contact_id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000003\",\n \"email\": \"jane.doe@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-contact.beem.africa/public/v1/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"mob_no\": \"255700000003\",\n \"email\": \"jane.doe@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "6093ee8b46e0380018962d2a",
"message": "Contact Updated Successfully",
"status": "true"
}
}{
"status": 400,
"message": "Invalid Mobile Number"
}{
"code": 120,
"message": "Invalid Authorization Parameters"
}{
"data": {
"message": "Contact Not Found",
"status": "false"
}
}Authorizations
basicAuthaccessToken
Beem API credentials: API key as username, API secret as password.
Path Parameters
Unique contact ID.
Body
application/json
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.
Updated primary mobile number.
Address book IDs to associate with this contact.
Response
Contact updated successfully.
Show child attributes
Show child attributes
⌘I
