Download a List
GET https://restapi.actonsoftware.com/api/1/list/{listid}
This endpoint allows you to download a specific list from the account.
Parameters
Name | Parameter Type |
Allow Multiple |
Required/ Optional |
Data Type | Description |
---|---|---|---|---|---|
Authorization: | Header | False | Required | String | Insert your generated access token. ("Bearer {access token}") |
listid | Path | False | Required | String | The ID of the list you would like to download. |
count | Query | false | optional | String | Specify the number of elements to fetch. (Maximum=1000) |
offset | Query | false | Optional | String | Specify the element offset to begin the fetch. (Default=0) |
modbefore | Query | False | Optional | String | Filter records modified before the specified date. |
modafter | Query | False | Optional | String | Filter records modified after the specified date. |
createdbefore | Query | False | Optional | String | Filter records created before the specified date. |
createdafter | Query | False | Optional | String | Filter records created after the specified date. |
fields | Query | False | Optional | String | Using a semicolon as the delimiter specify the fields (URLEncoded Required) you would like returned. The query parameter "datequalifiers" cannot be used in conjunction with this option. |
datequalifiers | Query | False | Optional | Boolean | A "true" values return the dates created and modified. These columns will be headed with the names "__created_date" and "__modified_date". The query parameter "fields" cannot be used in conjunction with this option. |
responseformat | Query | False | Optional | String | Specify the desired response format. ("JSON", "CSV") |
Parameter Notes
responseformat
JSON is limited to 1,000 list members per API call, and the number of fields is limited to 255.
CSV can return the entire list even if it is large and the number of fields is unlimited.
modbefore, modafter, createdbefore, createdafter, and datequalifiers
Please use Unix timestamps in milliseconds. (timestamp converter:example)
Response
{ "listId":"l-ctx", "offset":0, "count":1, "totalCount":1, "emailColumn":3, "headers":[ "_contact_id_", "First Name", "Last Name", "E-mail Address" ], "data":[ [ "l-ctx:0, "John", "Doe", "[email protected]" ] ] }
Code Examples
curl -X GET https://restapi.actonsoftware.com/api/1/list/l-ctx -H "Authorization: Bearer 12345678-9abc-defg-hijk-lmnopqrs"
import requests url = "https://restapi.actonsoftware.com/api/1/list/l-ctx" payload = {} headers = { 'Authorization': 'Bearer 12345678-9abc-defg-hijk-lmnopqrs' } response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
package com.acton.api.client.endpoint; import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.JsonNode; import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; import org.json.JSONArray; public class GetListByIDExample { static String BASE_URL = "https://restapi.actonsoftware.com/"; static String ACTON_USERNAME = "{your username}"; static String ACTON_PASSWORD = "{your password}"; static String CLIENT_ID = "{your client id/key}"; static String CLIENT_SECRET = "{your client secret}"; public static void main(String[] args) { try { String access_token = getAccessToken(); Unirest.setDefaultHeader("Authorization", "Bearer " + access_token); printListHeaders(); } catch (UnirestException e) { e.printStackTrace(); } } /** * This method uses Download a List endpoint * and prints all the headers of the List */ private static void printListHeaders() throws UnirestException { // Get the list with id "l-ctx" HttpResponse listResponse = Unirest.get(BASE_URL + "/api/1/list/l-ctx").asJson(); // Get headers as array JSONArray headers =listResponse.getBody().getObject().getJSONArray("headers"); // Iterate thorough all the headers and print for (int i=0;i<headers.length();i++) System.out.println(headers.getString(i)); } /** * This is an util method to get access token */ private static String getAccessToken() throws UnirestException { // POST to token url with password grant_type to get token. HttpResponse jsonResponse = Unirest.post(BASE_URL + "token") .header("accept", "application/json") .field("grant_type", "password") .field("username", ACTON_USERNAME) .field("password", ACTON_PASSWORD) .field("client_id", CLIENT_ID) .field("client_secret", CLIENT_SECRET) .asJson(); // Strip access_token from response and return it. return jsonResponse.getBody().getObject().getString("access_token"); } }