20% OFF Subscribe directly with API Factory and save 20% compared with the corresponding RapidAPI monthly plan. View pricing

Developer guide

WhatsApp API Code Examples

Call API Factory from cURL, C#, Python, Node.js and PHP.

WhatsApp API Code Examples

Use the examples as a starting point for server-side integrations and replace the sample token and phone number with your own values.

cURL

curl -X POST 'https://api-router.finestoreuk.workers.dev/WhatsappNumberHasIt' \n  -H 'Authorization: Bearer YOUR_TOKEN' \n  -H 'Content-Type: application/json' \n  -d '{"phone_number":"447984004914"}'

C#

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
var body = new StringContent("{\"phone_number\":\"447984004914\"}", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api-router.finestoreuk.workers.dev/WhatsappNumberHasIt", body);

Python

import requests
r = requests.post("https://api-router.finestoreuk.workers.dev/WhatsappNumberHasIt", headers={"Authorization":"Bearer YOUR_TOKEN"}, json={"phone_number":"447984004914"})
print(r.json())

Node.js

const r = await fetch("https://api-router.finestoreuk.workers.dev/WhatsappNumberHasIt", { method: "POST", headers: { "Authorization": "Bearer YOUR_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ phone_number: "447984004914" }) });
console.log(await r.json());

PHP

$ch = curl_init("https://api-router.finestoreuk.workers.dev/WhatsappNumberHasIt");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer YOUR_TOKEN", "Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["phone_number" => "447984004914"]));