Overview
CSV Feed
PHP SDK
API Integration
API For Partners
Add Subscriber
This method can be applied on your server-side, when a visitor requests his email to be subscribed.
Method: GET
URL: https://api.retargeting.app/v1/subscriber-register
Function parameters
Field | Type | Required | Description |
---|---|---|---|
k | number or text | True | The REST API Key can be found into your account Settings -> Integration -> REST API Key, second field. |
True | The buyer's e-mail address | ||
name | text | False | Full name. Minimum 4 characters |
phone | text | False | Phone number. Minimum 9 characters |
The phone number is automatically considered confirmed if it's present in the request.
Your account status must be in one of the states: PAID, PAYMENT ERROR or ACCOUNT SUSPENDED.
If your account is Inactive or Closed the API call will not work.
The API call will respond with JSON format.
Example
1 <?php 2 require_once "vendor/autoload.php"; 3 4 $apiURL = "https://api.retargeting.app/v1/"; 5 $apiKey = "MyAPI_REST_Key"; 6 7 $client = new GuzzleHttp\Client(); 8 9 $registerData = [ 10 "k" => $apiKey, 11 "email" => "email@example.com", 12 "phone" => "0712345678", 13 "name" => "John Dave" 14 ]; 15 16 $registerRequest = $client->request("GET", $apiURL . "subscriber-register", ["query" => $registerData]);
If the API call succeeds, then the response will be as seen below:
1 { 2 status: "success", 3 data: null 4 }
The imported subscribers will have the source label details in Settings -> Subscribers -> Subscriber.
If the API call fails, then the response will be similar to the ones below:
1 { 2 status: "error", 3 message: "Subscriber already exists!" 4 }
OR
1 { 2 status: "error", 3 message: "Another subscriber has this phone number!" 4 }
OR
1 { 2 status: "fail", 3 data: { 4 validator: { 5 phone: [ 6 "The phone must be at least 9 characters" 7 ] 8 } 9 } 10 }