Contacts
Get Contact by ID
Retrieves a single contact by its unique identifier.
GET
/
contacts
/
{id}
curl --request GET \
--url https://api.autosend.com/v1/contacts/{id} \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.autosend.com/v1/contacts/{id}"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/contacts/{id}', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/contacts/{id}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <token>'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/contacts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer <token>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.net.HttpURLConnection;
import java.net.URL;
public class GetContactById {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/contacts/{id}");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Authorization", "Bearer <token>");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/contacts/{id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri.path)
request['Authorization'] = 'Bearer <token>'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"id": "507f1f77bcf86cd799439011",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"userId": "user_12345",
"contactProperties": {
"company": "Acme Corp",
"role": "Developer",
"plan": "premium"
},
"listIds":["692822107f092ea9019d3af8"],
"segmentIds":["6a0c0fb56ae88a19f5a010a9"],
"updatedAt": "2024-01-15T10:30:00.000Z",
"createdAt": "2024-01-15T10:30:00.000Z",
"projectId": "229f1f77bcf86cd9273048038"
}
}
curl --request GET \
--url https://api.autosend.com/v1/contacts/{id} \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.autosend.com/v1/contacts/{id}"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/contacts/{id}', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/contacts/{id}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <token>'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/contacts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer <token>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.net.HttpURLConnection;
import java.net.URL;
public class GetContactById {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/contacts/{id}");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Authorization", "Bearer <token>");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/contacts/{id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri.path)
request['Authorization'] = 'Bearer <token>'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"id": "507f1f77bcf86cd799439011",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"userId": "user_12345",
"contactProperties": {
"company": "Acme Corp",
"role": "Developer",
"plan": "premium"
},
"listIds":["692822107f092ea9019d3af8"],
"segmentIds":["6a0c0fb56ae88a19f5a010a9"],
"updatedAt": "2024-01-15T10:30:00.000Z",
"createdAt": "2024-01-15T10:30:00.000Z",
"projectId": "229f1f77bcf86cd9273048038"
}
}
Authorizations
string | header
required
Bearer authentication header of the form Bearer
<token>, where <token> is your auth token.Path Parameters
string
required
Unique contact IDExample:
"507f1f77bcf86cd799439011"Response
Contact retrieved successfullyboolean
Indicates if the request was successfulExample:
trueobject
Show child attributes
Show child attributes
string
Contact IDExample:
"507f1f77bcf86cd799439011"string
Contact email addressExample:
"[email protected]"string
Contact’s first nameExample:
"John"string
Contact’s last nameExample:
"Doe"string
Your application’s user identifierExample:
"user_12345"object
Custom contact attributes
Example:
Show child attributes
Show child attributes
string
{
"company": "Acme Corp",
"role": "Developer",
"plan": "premium"
}
string
Contact creation timestampExample:
"2024-01-15T10:30:00.000Z"string
Contact last update timestampExample:
"2024-01-15T10:30:00.000Z"string
Project ID that the contact belongs toExample:
"229f1f77bcf86cd9273048038"array
Contact List IDsExample:
["692822107f092ea9019d3af8"]array
Segment IDs the contact belongs toExample:
["6a0c0fb56ae88a19f5a010a9"]Was this page helpful?
⌘I
curl --request GET \
--url https://api.autosend.com/v1/contacts/{id} \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.autosend.com/v1/contacts/{id}"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/contacts/{id}', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/contacts/{id}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <token>'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/contacts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer <token>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.net.HttpURLConnection;
import java.net.URL;
public class GetContactById {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/contacts/{id}");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Authorization", "Bearer <token>");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/contacts/{id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri.path)
request['Authorization'] = 'Bearer <token>'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"id": "507f1f77bcf86cd799439011",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"userId": "user_12345",
"contactProperties": {
"company": "Acme Corp",
"role": "Developer",
"plan": "premium"
},
"listIds":["692822107f092ea9019d3af8"],
"segmentIds":["6a0c0fb56ae88a19f5a010a9"],
"updatedAt": "2024-01-15T10:30:00.000Z",
"createdAt": "2024-01-15T10:30:00.000Z",
"projectId": "229f1f77bcf86cd9273048038"
}
}