4.4 Get Campaign Events from ReactIn via API
You can get your campaign data directly from the API
Written By Ludovic Gueth
Last updated 4 months ago
β What youβll need before you start
Before using this API, make sure you have:
A ReactIn Campaign
Your Organization ID and API Key (You can find them in the API Keys page in the settings)
π API Endpoint
Send a GET request to this endpoint to get campaign events:
GET https://app.reactin.io/api/[organizationId]/campaigns/[campaignId]/eventsThis will return a paginated list of your campaign events.
π Authentication & Headers
You need to send your API key in the headers using a Bearer token.
π Your API key is visible in the settings
π Query Parameters
Each page contains up to 50 campaign events.
You can filter the campaign events by multiple status to get only the event matching : status=connection_sent,connection_accepted,message_sent
π§ͺ Example (JavaScript)
const fetchCampaignEvents = async (organizationId, campaignId, page = 1, status) => {
try {
const response = await fetch( `https://app.reactin.io/api/v1/${organizationId}/campaigns/${campaignId}/
events?page=${page}&pageSize=${pageSize}&status={status}`,
{
method: 'GET',
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error(`HTTP Error: ${response.status}`);
}
const data = await response.json();
console.log('Campaign events:', data.data);
console.log('Page:', data.page);
console.log('Next Page:', data.nextPage);
return data;
} catch (error) {
console.error('Error fetching leads:', error);
}
}; π§Ύ Response format
{
"data": [{
id: event.id,
status: event.status,
createdAt: event.createdAt,
connectionSentAt: event.connectionSentAt,
connectionAcceptedAt: event.connectionAcceptedAt,
messageSentAt: event.messageSentAt,
messageRepliedAt: event.messageRepliedAt,
followUpMessageSentAt: event.followUpMessageSentAt,
lead: {
firstName: event.listLead.firstName,
lastName: event.listLead.lastName,
email: event.listLead.email,
linkedinProfileUrl: event.listLead.linkedinProfileUrl,
},
skippedAt: event.skippedAt,
skippedReason: event.skippedReason,
}],
"page": 1,
"nextPage": 2
} data: the list of leadspage: current page numbernextPage: the next page number (ornullif done)
β Success Response
200 OKβ Campaign events fetched successfully
π« Common Errors
π‘ Best Practices
β‘ Use pagination to avoid overloading your app
π₯ Cache results when possible to reduce API calls
π Keep your API key private β use a backend server or proxy
π Add retry logic for occasional network or server errors
π‘ Pro tip: Cache API responses on your end to optimize performance and reduce unnecessary calls.