subscriberImport — add/update subscribers

subscriberImport (string apikey, string email, string phone, string mobilecountry, string fname, string lname, string names, string values, bool update_existing)

This method adds subscribers to your account Address Book and updates profiles for existing subscribers. New profile is added with a status unsubscribed from all mail lists. Not empty value either for email or phone is required.

Parameters
apikey Your account API key
email Email
phone Mobile phone
mobilecountry Country name for mobile number international format validation (must be in English)
fname Name of subscriber
lname Last name of subscriber
names Custom field names and values (make comma separated if several)
gender Gender
language Language
dateofbirth Date of birth
city City
zip Zip
stateorprovince State or province
country Country
interests Interests
occupation Occupation
values Values for subscriber profile custom fields (make comma separated if several)
update_existing Set TRUE if you want to update custom fields of existing subscribers
By default, the result is returned in XML, to get the JSON you need to add an additional parameter &output=json

Request form: api.feedgee.com/1.0/subscriberImport?apikey=APIKEY&email=EMAIL&phone=PHONE&mobilecountry=COUNTRY&fname=FNAME&lname=LNAME&names=NAMES&values=VALUES
&update_existing=TRUE

This method output returns imported subscriber profile details with status imported. If requested profile exists and you have set parameter update_existing=TRUE profile data will be returned with updated status, otherwise status field returns error message like 'example@exampleemail.com profile not found'.

The return value
success Number of successful requests
errors Number of errors
error Error description
code Error code
warning Additional warnings for xml, empty when null
data Array with subscribers data
Profile Array with single subscriber data
email Email
phone Phone
firstname Name
lastname Last name
customfields Array with custom fields
customfield Custom fields name and value
name Name, for example"Gender"
value Value, for example «Male»
status Status of subscriber

Example (XML)

<ResultOfProfile>
<success>int</success>
<errors>int</errors>
<error>string</error>
<code>int</code>
<warning>string</warning>
<data>
<Profile>
<email>string</email>
<phone>string</phone>
<firstname>string</firstname>
<lastName>string</lastName>
<customfields>
<CustomField>
<name>string</name>
<value>string</value>
</CustomField>
<CustomField>
<name>string</name>
<value>string</value>
</CustomField>
<status>string</status>
</Profile>
</data>
</ResultOfProfile>

Example (JSON)

{"success":int,
"errors":int,
"error":"string",
"warning":"string",
"code":int,
"data":
[{"email":"string",
"phone":"string",
"firstname":"string",
"lastname":"string",
"customfields":
[{"name":"string","value":"string"},
{"name":"string","value":"string"}],
"status":"Updated"}]
}

Request in PHP

<?
// Your key to access the API
$api_key = "00000000000000000000000000000000";
//Method name
$method = "subscriberImport";
echo "Method: " . $method. "<br>";
//parameters
$email = "test@test.com";
$phone = urlencode("+380500000000");
$fname = "fname";
$lname = "lname";
$parameters = "apikey=$api_key&email=$email&phone=$phone&mobilecountry=$mobilecountry&fname=$fname&lname=$lname&names=&values=&update_existing=true";
echo "Parameters: " . $parameters. "<br>";
// Create a GET-request
$api_url = "http://api.feedgee.com/1.0/$method?$parameters&output=json";
echo "Url: " . $api_url . "<br><hr/>";
// Make a request to the API-server
$result = file_get_contents($api_url);
if ($result) {
// Decoding of answer API-server
$jsonObj = json_decode($result);
if(null===$jsonObj) {
// Error in the received reply
echo "Invalid JSON";
}
else {
// Error of get the list of subscribers
if(!empty($jsonObj->error))
{ echo "An error occured: " . $jsonObj->error . "<br/>";}
// Display the names and values
echo "Here's a list of your data:<br>";
foreach ($jsonObj->data as $key => $jsons) { // This will search in the 2 jsons
foreach($jsons as $key => $custom) {
if(is_array($custom)){
echo $key . ":<br/>";
foreach ($custom as $one) {
echo " ->" . $one->name . ":" . $one->value . "<br/>";
}
} else {
echo $key . ":" . $custom . "<br/>";
}
}
}
}
} else {
// Error connecting to API-server
echo "API access error";
}
?>

SOAP request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:subscriberImport>
<tem:apikey>string</tem:apikey>
<tem:email>string</tem:email>
<tem:phone>string</tem:phone>
<tem:mobilecountry>string</tem:mobilecountry>
<tem:fname>string</tem:fname>
<tem:lname>string</tem:lname>
<tem:names>string</tem:names>
<tem:values>string</tem:values>
<tem:update_existing>boolean</tem:update_existing>
</tem:subscriberImport>
</soapenv:Body>
</soapenv:Envelope>

subscribersGetByEmail — find subscriber by email

subscribersGetByEmail (string apikey, string email, bool include_Custom_Fields)

Method to look for subscribers and subscribers' details by Email in your account AddressBook. This method does not return subscription status, instead for compatibility it returnes string with «undefined» status value.

This is one of few methods that can be used only in upgraded accounts (not with Freemium subscription).

Parameters
apikey Your account API key
email Subscriber's email for search
include_Custom_Fields Set TRUE in case you need to output subscriber's profile custom fields values (optional, default = FALSE)
By default output is in XML. To get result in JSON add additional parameter &output=json

Request form: http://api.feedgee.com/1.0/subscribersGetByEmail?apikey=API_KEY&email=EMAIL_ADDRESS&include_Custom_Fields=TRUE/FALSE

The return value
success The number of successful requests
errors Number of errors
error Error description
code Error code
warning Additional warnings for xml, empty when null
data Array with subscribers data
Profile Array with single subscriber data
email Email
phone Phone
firstname Name
lastname Last name
customfields
Array with additional fields
customfield Name and value of an additional field
name Name, for example"Gender"
value Value, for example «Male»
status Subscriber's Status

Example (XML)

<ResultOfProfile>
<success>int</success>
<errors>int</errors>
<error>string</error>
<code>int</code>
<warning>string</warning>
<data>
<Profile>
<email>string</email>
<phone>string</phone>
<firstname>string</firstname>
<lastName>string</lastName>
<customfields>
<CustomField>
<name>string</name>
<value>string</value>
</CustomField>
<CustomField>
<name>string</name>
<value>string</value>
</CustomField>
<status>string</status>
</Profile>
</data>
</ResultOfProfile>

Example (JSON)

{"success":int,
"errors":int,
"error":"string",
"warning":"string",
"code":int,
"data":
[{"email":"string",
"phone":"string",
"firstname":"string",
"lastname":"string",
"customfields":
[{"name":"string","value":"string"},
{"name":"string","value":"string"}],
"status":"Undefined"}]
}

Request in PHP

<?
// Your key to access the API
$api_key = "00000000000000000000000000000000";
//Method name
$method = "subscribersGetByEmail";
echo "Method: " . $method. "<br>";
//Method name
$parameters = "apikey=$api_key&email=BA9E956C-3C3E-441B-B2C7-6082C771A86D&INCLUDE_CUSTOM_FIELDS=TRUE";
echo "Parameters: " . $parameters. "<br>";
// Create GET-request
$api_url = "http://api.feedgee.com/1.0/$method?$parameters&output=json";
echo "Url: " . $api_url . "<br><hr/>";
// Make a request to the API-server
$result = file_get_contents($api_url);
if ($result) {
// Decoding for API-server answer
$jsonObj = json_decode($result);
if(null===$jsonObj) {
// Error in the received reply
echo "Invalid JSON";
}
elseif(!empty($jsonObj->error)) {
// Error of get the list of subscribers
echo "An error occured: " . $jsonObj->error;
} else {
// Display the names and values
echo "Here's a list of your data:<br>";
foreach ($jsonObj->data as $key => $jsons) { // This will search in the 2 jsons
foreach($jsons as $key => $custom) {
if(is_array($custom)){
echo $key . ":<br/>";
foreach ($custom as $one) {
echo "&nbsp;&nbsp;&nbsp;&nbsp;->" . $one->name . ":" . $one->value . "<br/>";
}
} else {
echo $key . ":" . $custom . "<br/>";
}
}
}
}
} else {
// Error connecting to API-server
echo "API access error";
}
?>

SOAP request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:subscribersGetByEmail>
<tem:apikey>string</tem:apikey>
<tem:email>string</tem:email>
<tem:INCLUDE_CUSTOM_FIELDS>string</tem:INCLUDE_CUSTOM_FIELDS>
</tem:subscribersGetByEmail>
</soapenv:Body>
</soapenv:Envelope>

subscribersGetByMobile — find subscribers by mobile number

subscribersGetByMobile (string apikey, string phone, bool include_Custom_Fields)

Method to look for subscribers and subscribers' details by Mobile phone number in your account AddressBook. This method does not return subscription status, instead for compatibility it returnes string with «undefined» status value.

This is one of few methods that can be used only in upgraded accounts (not with Freemium subscription).

Parameters
apikey Your account API key
phone Subscriber's mobile number for search. if several make comma separated. Must be in full international format. Values without heading + or 00 are allowed
include_Custom_Fields Set TRUE in case you need to output subscriber's profile custom fields values (optional, default = FALSE)
By default output is in XML. To get result in JSON add additional parameter &output=json

Request form: http://api.feedgee.com/1.0/subscribersGetByMobile?apikey=API_KEY&phone=PHONE_NUMBER&include_Custom_Fields=TRUE/FALSE

The return value
success 1 for success, 0 for error
errors Number of errors
error Error description
code Error code
warning Additional warnings for xml, empty when null
data Array with subscribers data
Profile Array with single subscriber data
email Email
phone Phone
firstname Name
lastname Last name
customfields
Array with additional fields of subscriber
customfield Name and value of an additional field
name Name, for example"Gender"
value Value, for example «Male»
status Subscriber's Status

Example (XML)

<ResultOfProfile>
<success>int</success>
<errors>int</errors>
<error>string</error>
<code>int</code>
<warning>string</warning>
<data>
<Profile>
<email>string</email>
<phone>string</phone>
<firstname>string</firstname>
<lastName>string</lastName>
<customfields>
<CustomField>
<name>string</name>
<value>string</value>
</CustomField>
<CustomField>
<name>string</name>
<value>string</value>
</CustomField>
<status>string</status>
</Profile>
</data>
</ResultOfProfile>

Examole (JSON)

{"success":int,
"errors":int,
"error":"string",
"warning":"string",
"code":int,
"data":
[{"email":"string",
"phone":"string",
"firstname":"string",
"lastname":"string",
"customfields":
[{"name":"string","value":"string"},
{"name":"string","value":"string"}],
"status":"Undefined"}]
}

Request in PHP

<?
// Your key to access the API
$api_key = "00000000000000000000000000000000";
//Method name
$method = "subscribersGetByMobile";
echo "Method: " . $method. "<br>";
//parameters
$phone = urlencode("+380500000000");
$parameters = "apikey=$api_key&phone=$phone&INCLUDE_CUSTOM_FIELDS=TRUE";
echo "Parameters: " . $parameters. "<br>";
// Create a GET-requestс
$api_url = "http://api.feedgee.com/1.0/$method?$parameters&output=json";
echo "Url: " . $api_url . "<br><hr/>";
// Make a request to the API-server
$result = file_get_contents($api_url);
if ($result) {
// Decoding of answer API-server
$jsonObj = json_decode($result);
if(null===$jsonObj) {
// Error in the received reply
echo "Invalid JSON";
}
elseif(!empty($jsonObj->error)) {
// Error of get the list of subscribers
echo "An error occured: " . $jsonObj->error;
} else {
// Display the names and values
echo "Here's a list of your data:<br>";
foreach ($jsonObj->data as $key => $jsons) { // This will search in the 2 jsons
foreach($jsons as $key => $custom) {
if(is_array($custom)){
echo $key . ":<br/>";
foreach ($custom as $one) {
echo "&nbsp;&nbsp;&nbsp;&nbsp;->" . $one->name . ":" . $one->value . "<br/>";
}
} else {
echo $key . ":" . $custom . "<br/>";
}
}
}
}
} else {
// Error connecting to API-server
echo "API access error";
}
?>

SOAP request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:subscribersGetByMobile>
<tem:apikey>string</tem:apikey>
<tem:phone>string</tem:phone>
<tem:INCLUDE_CUSTOM_FIELDS>string</tem:INCLUDE_CUSTOM_FIELDS>
</tem:subscribersGetByMobile>
</soapenv:Body>
</soapenv:Envelope>

subscribersDelete — remove subscribers from account

subscribersDelete (string apikey, string emails, string phones)

This method deletes subscribers from your account AddressBook.

Parameters
apikey Your account API key
emails Subscriber's email for search. if several make comma separated
phones Subscriber's mobile number for search. if several make comma separated (can be without heading + or 00)

By default output is XML. To get in JSON add additional parameter &output=json

Request url format: http://api.feedgee.com/1.0/subscribersDelete?apikey=APIKEY&emails=EMAILS&phones=PHONES

Email and mobile can be specified in same request and may refer only to single subscriber profile where both values are equal to values in request. If you use only email or phone for search, value of the second parameter must be left empty.

This method output returns list with deleted profiles with status 'deleted'. If profile wasn't found output will contain error string like «example@exampleemail.com profile not found».

The return value
success Number of successful requests
errors Number of errors
error Error text description
code Error code
warning Additional warnings for xml. Empty when null
data Array with subscribers data
Profile Array with single subscriber data
email Email
phone Phone
firstname Name
lastname Last name
status Profile status


Example (XML)

<ResultOfProfile>
<success>int</success>
<errors>int</errors>
<error>string</error>
<code>int</code>
<warning>string</warning>
<data>
<Profile>
<email>string</email>
<phone>string</phone>
<firstname>string</firstname>
<lastName>string</lastName>
<status>deleted</status>
</Profile>
<Profile>
<email>string</email>
<phone>string</phone>
<firstname>string</firstname>
<lastName>string</lastName>
<status>deleted</status>
</Profile>
</Profile>
</data>
</ResultOfProfile>

Example (JSON)

{"success":int,
"errors":int,
"error":"string",
"warning":"string",
"code":int,
"data":
[{"email":"string",
"phone":"string",
"firstname":"string",
"lastname":"string",
"status":"deleted"}]
}

Request in PHP

<?
// Your key to access the API
$api_key = "00000000000000000000000000000000";
//Method name
$method = "subscribersDelete";
echo "Method: " . $method. "<br>";
//parameters
$email = "test@test.com";
$phone = urlencode("+380500000000");
$parameters = "apikey=$api_key&emails=$email&phones=$phone";
echo "Parameters: " . $parameters. "<br>";
// Create a GET-request
$api_url = "http://api.feedgee.com/1.0/$method?$parameters&output=json";
echo "Url: " . $api_url . "<br><hr/>";
// Make a request to the API-server
$result = file_get_contents($api_url);
if ($result) {
// Decoding of answer API-server
$jsonObj = json_decode($result);
if(null===$jsonObj) {
// Error in the received reply
echo "Invalid JSON";
}
else {
// Error of get the list of subscribers
if(!empty($jsonObj->error)) {echo "An error occured: " . $jsonObj->error . "<br/>";}
// Display the names and values
echo "Here's a list of your data:<br>";
foreach ($jsonObj->data as $key => $jsons) { // This will search in the 2 jsons
foreach($jsons as $key => $custom) {
if(is_array($custom)){
echo $key . ":<br/>";
foreach ($custom as $one) {
echo "&nbsp;&nbsp;&nbsp;&nbsp;->" . $one->name . ":" . $one->value . "<br/>";
}
} else {
echo $key . ":" . $custom . "<br/>";
}
}
}
}
} else {
// Error connecting to API-server
echo "API access error";
}
?>

SOAP request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:subscribersDelete>
<tem:apikey>string</tem:apikey>
<tem:phones>string</tem:phones>
<tem:emails>string</tem:emails>
</tem:subscribersDelete>
</soapenv:Body>
</soapenv:Envelope>