Hi there, Amy from ActiveCampaign’s Customer Experience Team. We’re just refreshing our forum page and I wanted to add some help here for anyone who comes across this page/question/post.
You can use the V1 API’s campaign_paginator
endpoint with appropriate sorting and filtering parameters.
First, let’s address the sorting and filtering parameters:
- Sorting: You mentioned using
01
or 01D
for sorting, but it seems that it doesn’t correspond to the send date. The sorting parameter 01
might correspond to the campaign ID in the database, not the send date. We need to find the correct column ID for the send date.
- Filtering: The
filter
parameter allows you to specify conditions for filtering campaigns. For your requirement, you’ll need to filter campaigns based on their send date.
Now, here’s how you can approach this:
- Find the correct column ID for the send date: As you mentioned, the send date column in the campaign page of the admin panel corresponds to column
02
. We’ll use this information.
- Construct the filter parameter: Since we want campaigns sent since April 1st, 2019, we’ll construct a filter that checks for send dates greater than or equal to April 1st, 2019.
- Make the API call with the appropriate parameters.
Here’s an example of how to construct the API call:
GET /campaign_paginator?sort=02D&filter=&search=&offset=0&limit=100
Explanation of parameters:
sort=02D
: Sort the campaigns in descending order based on the send date (column 02
).
filter=
: No specific filter applied in this case.
search=
: No specific search query.
offset=0
: Start retrieving campaigns from the first page.
limit=100
: Retrieve up to 100 campaigns per page. Adjust this value as needed.
After retrieving the campaigns, you can iterate over the results and filter out campaigns sent since April 1st, 2019, based on their send date.
Please note that the campaign_paginator
endpoint might have limitations in terms of filtering and sorting compared to the V3 API.
Alternatively, using V3 API, you can achieve this by using the /campaigns
endpoint along with filtering and sorting parameters. However, it’s important to note that the V3 API may not provide as granular control over filtering and sorting as the V1 API.
To retrieve campaigns sent since April 1st, 2019, using the V3 API, you can use the sent_at
filter parameter along with sorting. Here’s how you can construct the API call:
GET /campaigns?filters[status]=sent&filters[sent_at]=AFTER:2019-04-01T00:00:00Z&sort=created_at:DESC
Explanation of parameters:
filters[status]=sent
: Filters campaigns to only include those that have been sent.
filters[sent_at]=AFTER:2019-04-01T00:00:00Z
: Filters campaigns to include only those sent after April 1st, 2019. Adjust the date and time as needed.
sort=created_at:DESC
: Sorts the campaigns in descending order based on their creation date. You can change created_at
to sent_at
if you prefer to sort by the send date.
Ensure that you replace placeholders such as 2019-04-01T00:00:00Z
with the appropriate date and time in ISO 8601 format.
Any questions or additional ideas, thread them below!