Connect WhatsApp with a sign-up code
curl --request POST \
--url https://api.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "CODE_FROM_META",
"waba_id": "200000000000001",
"phone_number_id": "100000000000001"
}
'import requests
url = "https://api.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/"
payload = {
"code": "CODE_FROM_META",
"waba_id": "200000000000001",
"phone_number_id": "100000000000001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'CODE_FROM_META',
waba_id: '200000000000001',
phone_number_id: '100000000000001'
})
};
fetch('https://api.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/', 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.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/",
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([
'code' => 'CODE_FROM_META',
'waba_id' => '200000000000001',
'phone_number_id' => '100000000000001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/"
payload := strings.NewReader("{\n \"code\": \"CODE_FROM_META\",\n \"waba_id\": \"200000000000001\",\n \"phone_number_id\": \"100000000000001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"CODE_FROM_META\",\n \"waba_id\": \"200000000000001\",\n \"phone_number_id\": \"100000000000001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"CODE_FROM_META\",\n \"waba_id\": \"200000000000001\",\n \"phone_number_id\": \"100000000000001\"\n}"
response = http.request(request)
puts response.read_body{
"configured": true,
"numbers": [
{
"phone_number_id": "100000000000001",
"display_phone_number": "+1 555 010 0100",
"verified_name": "Acme Dental",
"quality_rating": "GREEN",
"waba_id": "200000000000001",
"status": "pending",
"connected": true,
"problem": "",
"payment_method_linked": null,
"can_send_message": null,
"problems": []
}
]
}{
"detail": "<string>",
"code": "<string>",
"field": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}Tenants
Connect WhatsApp with a sign-up code
Sends the code that Meta Embedded Signup gave your page. The code works once, so do not repeat this call blindly. Answers the same as GET. When the number needs a PIN, the answer is 409 with field pin. Use the hosted sign-up for that case. Needs the channels:write scope.
POST
/
api
/
v1
/
partner
/
tenants
/
{external_ref}
/
channels
/
whatsapp
/
Connect WhatsApp with a sign-up code
curl --request POST \
--url https://api.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "CODE_FROM_META",
"waba_id": "200000000000001",
"phone_number_id": "100000000000001"
}
'import requests
url = "https://api.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/"
payload = {
"code": "CODE_FROM_META",
"waba_id": "200000000000001",
"phone_number_id": "100000000000001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'CODE_FROM_META',
waba_id: '200000000000001',
phone_number_id: '100000000000001'
})
};
fetch('https://api.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/', 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.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/",
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([
'code' => 'CODE_FROM_META',
'waba_id' => '200000000000001',
'phone_number_id' => '100000000000001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/"
payload := strings.NewReader("{\n \"code\": \"CODE_FROM_META\",\n \"waba_id\": \"200000000000001\",\n \"phone_number_id\": \"100000000000001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"CODE_FROM_META\",\n \"waba_id\": \"200000000000001\",\n \"phone_number_id\": \"100000000000001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.impellabs.tech/api/v1/partner/tenants/{external_ref}/channels/whatsapp/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"CODE_FROM_META\",\n \"waba_id\": \"200000000000001\",\n \"phone_number_id\": \"100000000000001\"\n}"
response = http.request(request)
puts response.read_body{
"configured": true,
"numbers": [
{
"phone_number_id": "100000000000001",
"display_phone_number": "+1 555 010 0100",
"verified_name": "Acme Dental",
"quality_rating": "GREEN",
"waba_id": "200000000000001",
"status": "pending",
"connected": true,
"problem": "",
"payment_method_linked": null,
"can_send_message": null,
"problems": []
}
]
}{
"detail": "<string>",
"code": "<string>",
"field": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Path Parameters
Body
application/json
Response
Success