Contacts - Extended
Contact stats, funnels, segmentation, and exports.
1
GET Contact Stats Summary
GET https://api.greenbubble.io/api/contacts/stats/summary
cURL
curl -X GET 'https://api.greenbubble.io/api/contacts/stats/summary' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/contacts/stats/summary', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/contacts/stats/summary"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/contacts/stats/summary');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
2
GET Contact Funnels
GET https://api.greenbubble.io/api/contacts/funnels
cURL
curl -X GET 'https://api.greenbubble.io/api/contacts/funnels' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/contacts/funnels', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/contacts/funnels"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/contacts/funnels');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
3
POST Kanban Funnel Action
POST https://api.greenbubble.io/api/contacts/funnel/action
cURL
curl -X POST 'https://api.greenbubble.io/api/contacts/funnel/action' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/contacts/funnel/action', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/contacts/funnel/action"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/contacts/funnel/action');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
4
POST Add Contacts to Segments
POST https://api.greenbubble.io/api/contacts/add-to-segments
cURL
curl -X POST 'https://api.greenbubble.io/api/contacts/add-to-segments' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"segment_ids":["SEGMENT_ID"],"contact_ids":["CONTACT_ID"]}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/contacts/add-to-segments', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"segment_ids": [
"SEGMENT_ID"
],
"contact_ids": [
"CONTACT_ID"
]
})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/contacts/add-to-segments"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"segment_ids": [
"SEGMENT_ID"
],
"contact_ids": [
"CONTACT_ID"
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/contacts/add-to-segments');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"segment_ids":["SEGMENT_ID"],"contact_ids":["CONTACT_ID"]}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
5
GET Export Status
GET https://api.greenbubble.io/api/contacts/export/status/JOB_ID
cURL
curl -X GET 'https://api.greenbubble.io/api/contacts/export/status/JOB_ID' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/contacts/export/status/JOB_ID', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/contacts/export/status/JOB_ID"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/contacts/export/status/JOB_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
6
GET Download Export
GET https://api.greenbubble.io/api/contacts/export/download/FILE_NAME
cURL
curl -X GET 'https://api.greenbubble.io/api/contacts/export/download/FILE_NAME' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/contacts/export/download/FILE_NAME', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/contacts/export/download/FILE_NAME"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/contacts/export/download/FILE_NAME');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;