Update contact
curl --request PUT \
--url https://apicontacts.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://apicontacts.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://apicontacts.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://apicontacts.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://apicontacts.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://apicontacts.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://apicontacts.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"
}
}API Reference
Update contact
PUT
/
contacts
/
{contact_id}
Update contact
curl --request PUT \
--url https://apicontacts.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://apicontacts.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://apicontacts.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://apicontacts.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://apicontacts.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://apicontacts.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://apicontacts.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"
}
}Authorizations
basicAuthaccessToken
Body
application/json
