How get all email by API

Hello,

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

Thanks!

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"
}
]
}
]
}

1 Like

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

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.

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.

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

Now it works as needed.

1 Like

Thanks all work well

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