Get contact by phone number for authenticated customer

Retrieves a contact by their phone number for the authenticated customer. Phone number should be in international format (e.g., +1234567890). The customer ID is extracted from the authentication token.

GET
/v1/contacts/phone
x-sender-id<token>

In: header

Query Parameters

phoneNumberstring

Header Parameters

x-sender-idstring
Formatguid
x-api-keystring

Response Body

curl -X GET "https://api.sent.dm/v1/contacts/phone?phoneNumber=%2B1234567890" \
  -H "x-sender-id: string" \
  -H "x-api-key: string"
fetch("https://api.sent.dm/v1/contacts/phone?phoneNumber=%2B1234567890", {
  headers: {
    "x-sender-id": "string",
    "x-api-key": "string"
  }
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.sent.dm/v1/contacts/phone?phoneNumber=%2B1234567890"

  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("x-sender-id", "string")
  req.Header.Add("x-api-key", "string")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.sent.dm/v1/contacts/phone?phoneNumber=%2B1234567890"

response = requests.request("GET", url, headers = {
  "x-sender-id": "string",
  "x-api-key": "string"
})

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;

HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("https://api.sent.dm/v1/contacts/phone?phoneNumber=%2B1234567890"))
  .header("x-sender-id", "string")
  .header("x-api-key", "string")
  .GET()
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-sender-id", "string");
client.DefaultRequestHeaders.Add("x-api-key", "string");
var response = await client.GetAsync("https://api.sent.dm/v1/contacts/phone?phoneNumber=%2B1234567890");
var responseBody = await response.Content.ReadAsStringAsync();
{
  "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "phoneNumber": "+1234567890",
  "formatE164": "+1234567890",
  "formatInternational": "+1 234-567-890",
  "formatNational": "(234) 567-890",
  "formatRfc": "tel:+1-234-567-890",
  "countryCode": "1",
  "regionCode": "US",
  "availableChannels": "sms,whatsapp",
  "defaultChannel": "sms"
}
Empty
Empty