Pobierz kontakt
curl --request GET \
--url https://api.example.com/api/v1/contacts/{email}import requests
url = "https://api.example.com/api/v1/contacts/{email}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/contacts/{email}', 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.example.com/api/v1/contacts/{email}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/v1/contacts/{email}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/contacts/{email}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/contacts/{email}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 123,
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+1234567890",
"tags": ["premium", "engaged"],
"lead_score": 85,
"created_at": "2025-01-15T10:30:00",
"updated_at": "2025-12-30T09:00:00"
}
}
{
"success": false,
"error": {
"code": "CONTACT_NOT_FOUND",
"message": "Nie znaleziono kontaktu o adresie email: john@example.com"
}
}
{
"success": false,
"error": {
"code": "PERMISSION_DENIED",
"message": "Klucz API nie posiada uprawnienia 'contacts.read'"
}
}
Kontakty
Pobierz kontakt
Pobierz pojedynczy kontakt po adresie email
GET
/
api
/
v1
/
contacts
/
{email}
Pobierz kontakt
curl --request GET \
--url https://api.example.com/api/v1/contacts/{email}import requests
url = "https://api.example.com/api/v1/contacts/{email}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/contacts/{email}', 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.example.com/api/v1/contacts/{email}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/v1/contacts/{email}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/contacts/{email}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/contacts/{email}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 123,
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+1234567890",
"tags": ["premium", "engaged"],
"lead_score": 85,
"created_at": "2025-01-15T10:30:00",
"updated_at": "2025-12-30T09:00:00"
}
}
{
"success": false,
"error": {
"code": "CONTACT_NOT_FOUND",
"message": "Nie znaleziono kontaktu o adresie email: john@example.com"
}
}
{
"success": false,
"error": {
"code": "PERMISSION_DENIED",
"message": "Klucz API nie posiada uprawnienia 'contacts.read'"
}
}
Parametry ścieżki
string
required
Adres email kontaktu
Odpowiedź
boolean
Wskazuje czy żądanie zakończyło się sukcesem
object
Obiekt kontaktu
Show Pola kontaktu
Show Pola kontaktu
integer
Unikalny identyfikator kontaktu
string
Adres email kontaktu
string
Imię kontaktu
string
Nazwisko kontaktu
string
Numer telefonu kontaktu
array
Tablica nazw tagów przypisanych do kontaktu
integer
Ocena potencjalnego klienta
string
Znacznik czasu utworzenia w formacie ISO 8601
string
Znacznik czasu ostatniej aktualizacji w formacie ISO 8601
Przykład
curl https://api.mailist.com/api/v1/contacts/john@example.com \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://api.mailist.com/api/v1/contacts/john@example.com', {
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
});
const data = await response.json();
import requests
response = requests.get(
'https://api.mailist.com/api/v1/contacts/john@example.com',
headers={'X-API-Key': 'YOUR_API_KEY'}
)
data = response.json()
Odpowiedź
{
"success": true,
"data": {
"id": 123,
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+1234567890",
"tags": ["premium", "engaged"],
"lead_score": 85,
"created_at": "2025-01-15T10:30:00",
"updated_at": "2025-12-30T09:00:00"
}
}
{
"success": false,
"error": {
"code": "CONTACT_NOT_FOUND",
"message": "Nie znaleziono kontaktu o adresie email: john@example.com"
}
}
{
"success": false,
"error": {
"code": "PERMISSION_DENIED",
"message": "Klucz API nie posiada uprawnienia 'contacts.read'"
}
}
