Get contact
curl --request GET \
--url https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get', 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://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Contact retrieved successfully.",
"data": {
"id": "100875997589545@lid",
"name": "Maria",
"pushname": "Maria Doe"
}
}{
"message": "Resource not found."
}{
"message": "The given data was invalid.",
"errors": {},
"statusCode": 422
}{
"message": "Internal Server Error"
}Get Contact
Retrieve a specific contact by phone number or chat ID.
GET
/
{instance}
/
contacts
/
get
Get contact
curl --request GET \
--url https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get', 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://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Contact retrieved successfully.",
"data": {
"id": "100875997589545@lid",
"name": "Maria",
"pushname": "Maria Doe"
}
}{
"message": "Resource not found."
}{
"message": "The given data was invalid.",
"errors": {},
"statusCode": 422
}{
"message": "Internal Server Error"
}Retrieve detailed information about a specific contact in your WhatsApp instance.
This endpoint allows you to:
- Get contact details by phone number or chat ID
- Retrieve the contact’s name and pushname
- Verify contact information before sending messages
This is useful when you need to fetch information about a specific contact before interacting with them.
Use Cases
Contact Lookup
Quickly look up contact details using their phone number or chat ID.Contact Verification
Verify that you have the correct contact information before sending important messages.CRM Integration
Sync contact details from WhatsApp to your CRM system.Request Parameters
chat_id
The contact identifier can be in one of these formats:- Phone number:
123123123 - Chat ID (regular):
[email protected] - Chat ID (lid):
123123@lid
Response Examples
Successful Response
When the contact is found:{
"message": "Contact retrieved successfully.",
"data": {
"id": "100875997589545@lid",
"name": "Maria",
"pushname": "Maria Doe"
}
}
Contact Not Found
When the contact doesn’t exist:{
"message": "Contact not found."
}
Best Practices
Store the contact ID (
id field) for future API calls instead of repeatedly looking up the same contact.The
pushname is the name the user has set in their WhatsApp profile, while name is the name saved in your phone’s contacts.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
application/json
Example:
"application/json"
application/json
Example:
"application/json"
Path Parameters
Instance UUID copied from hypersender dashboard
Example:
"{{ instance_id }}"
Query Parameters
Phone number (123123123) or chat ID ([email protected] or 123123@lid)
Example:
"100875997589545@lid"