Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  How get all email by API

    Posted 06-05-2025 18:12

    BaptisteC | 2017-11-23 10:57:00 UTC | #1

    Hello,

    How can i get all email in queue or not? Assigned to an user or not? Is it possible?

    Thanks!


    RogierBosch | 2017-11-24 14:43:54 UTC | #2

    You can use the Analytics API Below example to retrieve all e-mails. /api/v2/analytics/conversations/details/query Mediatype set to Email This is the JSON body sent to the API. { "interval": "2017-10-31T23:00:00.000Z/2017-11-24T23:00:00.000Z", "order": "asc", "orderBy": "conversationStart", "paging": { "pageSize": 25, "pageNumber": 1 }, "segmentFilters": [ { "type": "or", "predicates": [ { "type": "dimension", "dimension": "mediaType", "operator": "matches", "value": "email" } ] } ] }


    BaptisteC | 2017-11-27 07:30:46 UTC | #3

    Thanks, but i also need the content of these mails. If I'm not mistaken this method only returns the subject of mails.


    tim.smith | 2017-11-27 19:11:03 UTC | #4

    Using the Analytics APIs is the correct approach to determine the emails that are currently enqueued. To get the body for those emails, do the following for each conversation:

    1. Use GET /api/v2/conversations/emails/{conversationId}/messages to get a listing of all messages in the conversation. Grab the IDs from the messages for which you want to get the body.
    2. For each message ID you are interested in, use GET /api/v2/conversations/emails/{conversationId}/messages/{messageId} to retrieve the message with the body.

    Unfortunately, there is no bulk operation for this process at this time.


    NielsS | 2017-11-29 09:29:34 UTC | #5

    How does the query look like when you want to search for emails that do not have the state: "segmentType": "alert"

    I tried notExists but then it needs a null as value. With Exists it returns all interactions that are already handled.

    In short: I need to make a list of the emails that are in queue: not in interaction, in wrap-up or in alert state.


    NielsS | 2017-11-29 09:34:46 UTC | #6

    Had to add the dimension purpose ACD and the conversationEnd not exists

    Now it works as needed.


    BaptisteC | 2017-11-30 09:27:21 UTC | #7

    Thanks all work well


    system | 2017-12-31 09:27:34 UTC | #8

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


    This post was migrated from the old Developer Forum.

    ref: 2146