List a contact's email activity
curl --request GET \
--url https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <api-key>'import requests
url = "https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity"
headers = {
"Authorization": "Bearer <token>",
"x-api-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'x-api-key': '<api-key>'}
};
fetch('https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity', 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://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity",
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>",
"x-api-key: <api-key>"
],
]);
$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://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity")
.header("Authorization", "Bearer <token>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"type": "<string>",
"occurredAt": "<string>",
"subject": "<string>",
"campaignIdentifier": "<string>",
"assetIdentifier": "<string>",
"url": "<string>"
}
],
"pageInfo": {
"page": 2,
"pageSize": 50,
"sortDirection": "asc"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}fmg communication
List a contact's email activity
Requires the fmg.emails.read scope. One page of a contact’s email engagement history: scheduled, sent, open, click, bounce, and unsubscribe events. Each event carries its campaignIdentifier. Click events include the clicked url, which FMG truncates near 600 characters. FMG also reports spam complaints as unsubscribe events. page starts at 1 and defaults to 1. The date range applies first, then paging, so a long range needs several pages. There is no total count: a page with fewer than pageSize items is the last page.
GET
/
fmg
/
communication
/
contacts
/
{contactId}
/
email-activity
List a contact's email activity
curl --request GET \
--url https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <api-key>'import requests
url = "https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity"
headers = {
"Authorization": "Bearer <token>",
"x-api-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'x-api-key': '<api-key>'}
};
fetch('https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity', 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://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity",
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>",
"x-api-key: <api-key>"
],
]);
$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://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity")
.header("Authorization", "Bearer <token>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.fmgsuite.com/v1/fmg/communication/contacts/{contactId}/email-activity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"type": "<string>",
"occurredAt": "<string>",
"subject": "<string>",
"campaignIdentifier": "<string>",
"assetIdentifier": "<string>",
"url": "<string>"
}
],
"pageInfo": {
"page": 2,
"pageSize": 50,
"sortDirection": "asc"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "invalid_request",
"traceId": "<string>",
"retryable": true,
"details": "<unknown>"
}Authorizations
OAuth 2.1 access tokens issued by Stytch Connected Apps.
API usage-plan key. Required on every request, sent as the x-api-key header.
Scopes
fmg.emails.read
Read FMG Suite email engagement history for contacts.
Path Parameters
Query Parameters
Required range:
x >= 1Required range:
1 <= x <= 100Available options:
asc, desc