Get All Segment
To get all segment follow the example code and be careful with the parameters.
Base Urlhttps://swift-send.bugfinder.app/api/
HTTP Method:
GET
API URL: https://swift-send.bugfinder.app/api/segment/list
API Key:
Get YOUR_PUBLIC_KEY
and YOUR_SECRET_KEY
from the account page
Response format: JSON
Body Params
var request = require('request');
var options = {
'method': 'GET',
'url': 'BASE_URL/segment/list',
'headers': {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
});
123456789101112131415
16
17181920212223242526
import requests
url = "BASE_URL/segment/list"
payload={}
headers = {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
123456789101112131415
1617181920212223242526
?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'BASE_URL/segment/list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'PublicKey: YOUR_PUBLIC_KEY',
'SecretKey: YOUR_SECRET_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
123456789101112131415
1617181920212223242526
curl --location --request GET 'BASE_URL/segment/list' \
--header 'PublicKey: YOUR_PUBLIC_KEY' \
--header 'SecretKey: YOUR_SECRET_KEY'
123456789101112131415
1617181920212223242526
require "uri"
require "net/http"
url = URI("BASE_URL/segment/list")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["PublicKey"] = "YOUR_PUBLIC_KEY"
request["SecretKey"] = "YOUR_SECRET_KEY"
response = http.request(request)
puts response.read_body
123456789101112131415
1617181920212223242526
{
"status": "success",
"message": {
"segments": [
{
"id": 10,
"user_id": 6790,
"contact_type_id": 1,
"segment_name": "Test5",
"select_field": [
"14"
],
"select_operator": [
"is after"
],
"value": [
"2023-11-08T15:12"
],
"query_type": null,
"deleted_at": null,
"created_at": "2023-11-08T09:37:42.000000Z",
"updated_at": "2023-11-08T09:37:42.000000Z",
"segment_emails_count": 1
},
{
"id": 9,
"user_id": 6790,
"contact_type_id": 1,
"segment_name": "Test4",
"select_field": [
"17"
],
"select_operator": [
"is between"
],
"value": [
"25",
"60"
],
"query_type": null,
"deleted_at": null,
"created_at": "2023-11-08T09:36:09.000000Z",
"updated_at": "2023-11-08T09:36:09.000000Z",
"segment_emails_count": 0
},
...
]
}
}
123456789101112131415
1617181920212223242526
{
"status": "failed",
"errors": {
"PublicKey": [
"The public key field is required."
],
"SecretKey": [
"The secret key field is required."
]
}
}
1234567891011121314
Segment Recipients
To get segment recipient follow the example code and be careful with the parameters.
Base Urlhttps://swift-send.bugfinder.app/api/
HTTP Method:
GET
API URL: https://swift-send.bugfinder.app/api/segment/email/list?segment_id={segment_id}
API Key:
Get YOUR_PUBLIC_KEY
and YOUR_SECRET_KEY
from the account page
Response format: JSON
Body Params
var request = require('request');
var options = {
'method': 'GET',
'url': 'BASE_URL/segment/email/list?segment_id=7',
'headers': {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
});
123456789101112131415
16
17181920212223242526
import requests
url = "BASE_URL/segment/email/list?segment_id=7"
payload={}
headers = {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
123456789101112131415
1617181920212223242526
?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'BASE_URL/segment/email/list?segment_id=7',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'PublicKey: YOUR_PUBLIC_KEY',
'SecretKey: YOUR_SECRET_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
123456789101112131415
1617181920212223242526
curl --location --request GET 'BASE_URL/segment/email/list?segment_id=7' \
--header 'PublicKey: YOUR_PUBLIC_KEY' \
--header 'SecretKey: YOUR_SECRET_KEY'
123456789101112131415
1617181920212223242526
require "uri"
require "net/http"
url = URI("BASE_URL/segment/email/list?segment_id=7")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["PublicKey"] = "YOUR_PUBLIC_KEY"
request["SecretKey"] = "YOUR_SECRET_KEY"
response = http.request(request)
puts response.read_body
123456789101112131415
1617181920212223242526
{
"status": "success",
"message": {
"contactEmails": [
{
"id": 17,
"user_id": 6790,
"segment_id": 7,
"contact_id": null,
"first_name": "David",
"last_name": "Malan",
"email": "malan@gmail.com",
"country": null,
"state": null,
"city": null,
"address_line1": null,
"created_at": "2023-11-08T09:33:51.000000Z",
"updated_at": "2023-11-08T09:33:51.000000Z",
"fullname": "David Malan"
},
...
]
}
}
123456789101112131415
1617181920212223242526
{
"status": "failed",
"errors": "Record not found"
}
1234567891011121314
Segment Recipient Add
To add segment recipient follow the example code and be careful with the parameters.
Base Urlhttps://swift-send.bugfinder.app/api/
HTTP Method:
POST
API URL: https://swift-send.bugfinder.app/api/segment/email/store
API Key:
Get YOUR_PUBLIC_KEY
and YOUR_SECRET_KEY
from the account page
Response format: JSON
Body Params
segment_id* integer
you get segment_id from Get Segment endpoint
first_name* string
Recipient first name
last_name* string
Recipient last name
email* string
Recipient email address
var request = require('request');
var options = {
'method': 'POST',
'url': 'BASE_URL/segment/email/store',
'headers': {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
},
formData: {
'segment_id': '20',
'first_name': 'Alex',
'last_name': 'Hels',
'email': 'alexhels@gmail.com'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
});
123456789101112131415
16
17181920212223242526
import requests
url = "BASE_URL/segment/email/store"
payload={'segment_id': '20',
'first_name': 'Alex',
'last_name': 'Hels',
'email': 'alexhels@gmail.com'}
files=[
]
headers = {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text) requests
url = "BASE_URL/contacts-type/view?contact_type_id=5"
payload={}
headers = {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
123456789101112131415
1617181920212223242526
?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'BASE_URL/segment/email/store',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('segment_id' => '20','first_name' => 'Alex','last_name' => 'Hels','email' => 'alexhels@gmail.com'),
CURLOPT_HTTPHEADER => array(
'PublicKey: YOUR_PUBLIC_KEY',
'SecretKey: YOUR_SECRET_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
123456789101112131415
1617181920212223242526
curl --location --request POST 'BASE_URL/segment/email/store' \
--header 'PublicKey: YOUR_PUBLIC_KEY' \
--header 'SecretKey: YOUR_SECRET_KEY' \
--form 'segment_id="20"' \
--form 'first_name="Alex"' \
--form 'last_name="Hels"' \
--form 'email="alexhels@gmail.com"'
123456789101112131415
1617181920212223242526
require "uri"
require "net/http"
url = URI("BASE_URL/segment/email/store")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["PublicKey"] = "YOUR_PUBLIC_KEY"
request["SecretKey"] = "YOUR_SECRET_KEY"
form_data = [['segment_id', '20'],['first_name', 'Alex'],['last_name', 'Hels'],['email', 'alexhels@gmail.com']]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body
123456789101112131415
1617181920212223242526
{
"status": "success",
"message": "Added Successfully"
}
123456789101112131415
1617181920212223242526
{
"status": "failed",
"errors": {
"first_name": [
"The first name field is required."
],
"last_name": [
"The last name field is required."
],
"email": [
"The email field is required."
]
}
}
1234567891011121314
Segment Recipient Delete
To delete segment recipient follow the example code and be careful with the parameters.
Base Urlhttps://swift-send.bugfinder.app/api/
HTTP Method:
DELETE
API URL: https://swift-send.bugfinder.app/api/ segment/email/delete?segment_recipient_id={segment_recipient_id}
API Key:
Get YOUR_PUBLIC_KEY
and YOUR_SECRET_KEY
from the account page
Response format: JSON
Body Params
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'BASE_URL/segment/email/delete?segment_recipient_id=50',
'headers': {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
});
123456789101112131415
16
17181920212223242526
import requests
url = "BASE_URL/segment/email/delete?segment_recipient_id=50"
payload={}
headers = {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
123456789101112131415
1617181920212223242526
?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'BASE_URL/segment/email/delete?segment_recipient_id=50',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'PublicKey: YOUR_PUBLIC_KEY',
'SecretKey: YOUR_SECRET_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
123456789101112131415
1617181920212223242526
curl --location --request DELETE 'BASE_URL/segment/email/delete?segment_recipient_id=50' \
--header 'PublicKey: YOUR_PUBLIC_KEY' \
--header 'SecretKey: YOUR_SECRET_KEY'
123456789101112131415
1617181920212223242526
require "uri"
require "net/http"
url = URI("BASE_URL/segment/email/delete?segment_recipient_id=50")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Delete.new(url)
request["PublicKey"] = "YOUR_PUBLIC_KEY"
request["SecretKey"] = "YOUR_SECRET_KEY"
response = http.request(request)
puts response.read_body
123456789101112131415
1617181920212223242526
{
"status": "success",
"message": "Deleted Successfully"
}
123456789101112131415
1617181920212223242526
{
"status": "failed",
"errors": "Record Not Found"
}
1234567891011121314
Segment Delete
To delete segment follow the example code and be careful with the parameters.
Base Urlhttps://swift-send.bugfinder.app/api/
HTTP Method:
DELETE
API URL: https://swift-send.bugfinder.app/api/segment/delete?segment_id={segment_id}
API Key:
Get YOUR_PUBLIC_KEY
and YOUR_SECRET_KEY
from the account page
Response format: JSON
Body Params
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'BASE_URL/segment/delete?segment_id=26',
'headers': {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
});
123456789101112131415
16
17181920212223242526
import requests
url = "BASE_URL/segment/delete?segment_id=26"
payload={}
headers = {
'PublicKey': 'YOUR_PUBLIC_KEY',
'SecretKey': 'YOUR_SECRET_KEY'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
123456789101112131415
1617181920212223242526
?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'BASE_URL/segment/delete?segment_id=26',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'PublicKey: YOUR_PUBLIC_KEY',
'SecretKey: YOUR_SECRET_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
123456789101112131415
1617181920212223242526
curl --location --request DELETE 'BASE_URL/segment/delete?segment_id=26' \
--header 'PublicKey: YOUR_PUBLIC_KEY' \
--header 'SecretKey: YOUR_SECRET_KEY'
123456789101112131415
1617181920212223242526
require "uri"
require "net/http"
url = URI("BASE_URL/segment/delete?segment_id=26")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Delete.new(url)
request["PublicKey"] = "YOUR_PUBLIC_KEY"
request["SecretKey"] = "YOUR_SECRET_KEY"
response = http.request(request)
puts response.read_body
123456789101112131415
1617181920212223242526
{
"status": "success",
"errors": "Deleted Successfully"
}
123456789101112131415
1617181920212223242526
{
"status": "failed",
"errors": "Record Not Found"
}
1234567891011121314