API Reference

Returns a list of Emails for a specific Project.

Request

Method: list_emails

Request Body

{
  "api_key":"xxxxxxxxxxxxx",        //required
  "action": "list_emails",          //required
  "value": {
    "project_id": 0,                //required
    "page": 0                    
  }
}
curl --location --request POST 'https://api.platform.ly' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'api_key=xxxxxxxxxxxxx' \
--data-urlencode 'action=list_emails' \
--data-urlencode 'value={"project_id": "0","page": "0"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.platform.ly',
  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 => 'api_key=xxxxxxxxxxxxx&action=list_emails&value=%7B%22project_id%22%3A%20%220%22%2C%22page%22%3A%20%220%22%7D',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

import requests

url = "https://api.platform.ly"

payload='api_key=xxxxxxxxxxxxx&action=list_emails&value=%7B%22project_id%22%3A%20%220%22%2C%22page%22%3A%20%220%22%7D'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "api_key=xxxxxxxxxxxxx&action=list_emails&value={\"project_id\": \"0\",\"page\": \"0\"}");
Request request = new Request.Builder()
  .url("https://api.platform.ly")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();

Request Format

api_key required
Authentication API Key. Where can I find my API Key?

action required
list_emails

value required
JSON formatted string with additional request values

project_id required
Your Project ID. Where can I find my Project ID?

page optional
The response contains 100 results per page.

Response

Returns a JSON emails object or an empty object (when there are no emails) if the request succeeded. Returns an error if the request parameters are invalid.

👍

200 OK

[
    {
        "id": 0,
        "date": 1664972180,
        "name": "Email Title 1",
        "sent": 0,
        "open_unique": 0,
        "open_total": 0,
        "click_unique": 0,
        "click_total": 0,
        "open_rate": 0,
        "click_rate": 0
    },
    {
        "id": 1,
        "date": 1646133949,
        "name": "Email Title 2",
        "sent": 1,
        "open_unique": 1,
        "open_total": 2,
        "click_unique": 0,
        "click_total": 0,
        "open_rate": "100.00",
        "click_rate": "0.00"
    }
]