# How to get a total of emails created before a date

**URL:** <https://community.postman.com/t/how-to-get-a-total-of-emails-created-before-a-date/57959>\
**Category:** Help Hub\
**Tags:** tests, api-test\
**Created:** [February 21, 2024, 6:48pm UTC](https://community.postman.com/t/how-to-get-a-total-of-emails-created-before-a-date/57959 "2024-02-21T18:48:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaredar](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jaredar](https://community.postman.com/u/jaredar)\
**Post date:** [February 21, 2024, 6:48pm UTC](https://community.postman.com/t/how-to-get-a-total-of-emails-created-before-a-date/57959/1 "2024-02-21T18:48:10Z")

</div>

I’m trying to get a total of emails created before a certain date. The API call retrieves all the emails, even the emails after the date I set in my testing. Here is an example of the URL I’m using

GET [https://secure.pod.eloqua.com/api/REST/2.0/assets/emails](https://secure.pod.eloqua.com/api/REST/2.0/assets/emails)

I even tried adding this query at the end of the URL  
?createdAt=\<‘2024-01-01T00:00:00Z’

Is there a way to get the total of emails created before the date?

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 22, 2024, 12:27pm UTC](https://community.postman.com/t/how-to-get-a-total-of-emails-created-before-a-date/57959/2 "2024-02-22T12:27:13Z")

</div>

This will be down to the API and what it will accept.

Do you have instructions\documentation for the API?

Decent documentation should have examples for each of the query parameters, and this should include the “createdAt” parameter if its valid. (If it even supports query parameters that is).

---

<div class="post-metadata">

**Author:** ![jaredar](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jaredar](https://community.postman.com/u/jaredar)\
**Post date:** [February 22, 2024, 6:47pm UTC](https://community.postman.com/t/how-to-get-a-total-of-emails-created-before-a-date/57959/3 "2024-02-22T18:47:23Z")

</div>

Took me forever, but I was able to find the documentation.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 23, 2024, 10:27am UTC](https://community.postman.com/t/how-to-get-a-total-of-emails-created-before-a-date/57959/4 "2024-02-23T10:27:37Z")

</div>

Do you have it working now?

Can you share the working request? Just in case anyone else searches this on the forum?

---

<div class="post-metadata">

**Author:** ![jaredar](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jaredar](https://community.postman.com/u/jaredar)\
**Post date:** [February 23, 2024, 3:45pm UTC](https://community.postman.com/t/how-to-get-a-total-of-emails-created-before-a-date/57959/5 "2024-02-23T15:45:15Z")

</div>

I have it working now. The working API call

[https://secure.pod.eloqua.com/api/REST/2.0/assets/emails?search=createdAt](https://secure.pod.eloqua.com/api/REST/2.0/assets/emails?search=createdAt)\>unix time stamp

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [March 24, 2024, 3:45pm UTC](https://community.postman.com/t/how-to-get-a-total-of-emails-created-before-a-date/57959/6 "2024-03-24T15:45:17Z")

</div>

Closed on March 24, 2024, 3:45pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
