NAV Navigation
Shell Node.js HTTP

Alvaria Cloud EmailQueue REST API v2.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Overview

The Email Queue Microservice provides access to realtime status of all emails active within Alvaria™ Cloud.

Base URLs:

License: License: Creative Commons Attribution 4.0 International Public License

Authentication

Scope Scope Description
emailqueueapi manage the Email Queue resource

Emails

getEmailList

Code samples

# You can also use wget
curl -X GET https://orgId.via.aspect-cloud.net/via/v2/organizations/{orgId}/emailQueue/emails \
  -H 'Accept: application/json' \
  -H 'Authorization: string' \
  -H 'x-api-key: string'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'string',
  'x-api-key':'string'
};

fetch('https://orgId.via.aspect-cloud.net/via/v2/organizations/{orgId}/emailQueue/emails',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET https://orgId.via.aspect-cloud.net/via/v2/organizations/{orgId}/emailQueue/emails HTTP/1.1
Host: orgid.via.aspect-cloud.net
Accept: application/json
Authorization: string
x-api-key: string

GET /via/v2/organizations/{orgId}/emailQueue/emails

Parameters

Name In Type Required Description
orgId path string true Name of customer organization.
startIndex query integer false Starting Index of the items returned (0 based).
maxResults query integer false Maximum results. This is used to specify the maximum number of records to return in the result set. You can use this to set a result set limit that is less than the system/API-specific limit.
getExtendedInfo query boolean false This value when set to true helps in getting additional columns in the output by querying Users and Service tables.
emailType query string false Filter items based on email type. Enumeration : InboundEmail - Inbound Emails, ManualOutboundEmail - Manual Outbound, CampaignOutboundEmail - Campaign Outbound
umId query string false Filter items based on umId. Supports wildcard characters.
workTypeId query array[string] false Filter items based on workTypeId.
workHandlerId query string false Filter items based on Agent Id.
state query array[string] false Filter items based on current state of the email - internal name is State. Enumeration : Invalid - Used only if an unexpected state value is detected, Queued - Queued in Via (New-1), Queued2 - Queued in Via, Active - Active with Agent, Wrap - Wrap with Agent, Review - To-be-replied Email waits for Supervisor review (Wait-for-Review), ReviewActive - Review-required email in the reviewing state (Read), Draft - Agent saved email draft, DraftActive - Agent retrieved the draft and is working on it now, Transferred - Is transferred email, TransferredActive - Agent received the transferred Email and is working on it now, Reassigned - Email reassigned to Work Type from the Email Reassignment Widget, ReassignedDraft - Email reassigned to User from the Email Reassignment Widget, ReassignedActive - An email in the Work Type queue, that was in the Reassigned state, has been routed to a User (by Engagement Hub).
Authorization header string false Authentication token with the value: 'Bearer {accessToken}', where {accessToken} was returned from a call to the authorization endpoint.
x-api-key header string true Alvaria-provided value used to track API endpoint usage.

Enumerated Values

Parameter Value
emailType InboundEmail
emailType ManualOutboundEmail
emailType CampaignOutboundEmail
state Invalid
state Queued
state Queued2
state Active
state Wrap
state Review
state ReviewActive
state Draft
state DraftActive
state Transferred
state TransferredActive
state Reassigned
state ReassignedDraft
state ReassignedActive

Example responses

200 Response

{
  "kind": "via#emailList",
  "totalItems": 1,
  "lastIndexReturned": 0,
  "version": "20.0",
  "items": [
    {
      "id": "42235",
      "threadId": "247958000",
      "umId": "01-0010010000-190415-184140862-00034",
      "contactId": "5504",
      "interactionId": "5504",
      "workTypeId": "111",
      "workHandlerId": "208ddce3f41ec82",
      "sentTime": "2019-04-15T18:37:01.000Z",
      "receivedTime": "2019-04-15T18:41:40.000Z",
      "startTime": "2019-04-15T18:41:40.874Z",
      "queuedTime": "2019-04-15T18:41:40.874Z",
      "activeTime": "2019-04-15T20:02:20.213Z",
      "lastModifiedTime": "2019-04-15T20:02:49.446Z",
      "eventSequenceNumber": "77143977",
      "state": "Queued",
      "emailType": "InboundEmail",
      "emailObjectId": "email/1c8e-20190415-184140/111-0",
      "replyEmailObjectId": "email/fe1f-20190415-200249/111-1",
      "fromAddress": "customer@gmail.com",
      "toAddress": "service01@orgname.com",
      "subject": "Follow-up email to confirm my appointment",
      "workHandlerName": "doe, jane",
      "workTypeName": "Service01"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK EmailList
400 Bad Request Bad Request ErrorResponse
401 Unauthorized Unauthorized None
404 Not Found Not Found ErrorResponse
405 Method Not Allowed Method Not Allowed ErrorResponse
429 Too Many Requests Too Many Requests ErrorResponse
500 Internal Server Error Internal Server Error ErrorResponse

Schemas

Error

{
  "scope": "scope",
  "reason": "reason",
  "message": "message"
}

Properties

Name Type Required Restrictions Description
scope string false none none
reason string false none none
message string false none none

ErrorResponse

{
  "code": 404,
  "message": "not found",
  "errors": [
    {
      "scope": "scope",
      "reason": "reason",
      "message": "message"
    }
  ]
}

Properties

Name Type Required Restrictions Description
code integer false none HTTP error status
message string false none none
errors [Error] false none none

EmailItem

{
  "id": "42235",
  "threadId": "247958000",
  "umId": "01-0010010000-190415-184140862-00034",
  "contactId": "5504",
  "interactionId": "5504",
  "workTypeId": "111",
  "workHandlerId": "208ddce3f41ec82",
  "sentTime": "2019-04-15T18:37:01.000Z",
  "receivedTime": "2019-04-15T18:41:40.000Z",
  "startTime": "2019-04-15T18:41:40.874Z",
  "queuedTime": "2019-04-15T18:41:40.874Z",
  "activeTime": "2019-04-15T20:02:20.213Z",
  "lastModifiedTime": "2019-04-15T20:02:49.446Z",
  "eventSequenceNumber": "77143977",
  "state": "Queued",
  "emailType": "InboundEmail",
  "emailObjectId": "email/1c8e-20190415-184140/111-0",
  "replyEmailObjectId": "email/fe1f-20190415-200249/111-1",
  "fromAddress": "customer@gmail.com",
  "toAddress": "service01@orgname.com",
  "subject": "Follow-up email to confirm my appointment",
  "workHandlerName": "doe, jane",
  "workTypeName": "Service01"
}

Properties

Name Type Required Restrictions Description
id string(int32) false none Alvaria-generated unique identifier for the email instance.
threadId string(int32) false none Alvaria-generated unique identifier for the thread of the email instance.
umId string false none Alvaria-generated unique identifier for the Universal Media ID of an interaction.
contactId string(int32) false none This is a deprecated property.
interactionId string(int32) false none Alvaria-generated unique identifier for the interaction instance.
workTypeId string(int32) false none Alvaria-generated unique identifier for the WorkType.
workHandlerId string false none Alvaria-generated unique identifier for the user that processed the email.
sentTime string(date-time) false none Timestamp of when email was sent, specified in ISO 8601 format (e.g. 1985-04-12T23:20:50.525Z).
receivedTime string(date-time) false none Timestamp of when email was received, specified in ISO 8601 format (e.g. 1985-04-12T23:20:50.525Z).
startTime string(date-time) false none Timestamp of when email call was started, specified in ISO 8601 format (e.g. 1985-04-12T23:20:50.525Z).
queuedTime string(date-time) false none Timestamp of when email call was queued, specified in ISO 8601 format (e.g. 1985-04-12T23:20:50.525Z).
activeTime string(date-time) false none Timestamp of when email call went active, specified in ISO 8601 format (e.g. 1985-04-12T23:20:50.525Z).
lastModifiedTime string(date-time) false none Timestamp of when email call was modified, specified in ISO 8601 format (e.g. 1985-04-12T23:20:50.525Z).
eventSequenceNumber integer(int64) false none Alvaria-generated unique identifier for the sequence of the processed email call.
state string false none Filter items based on current state of the email - internal name is State. Enumeration : Invalid - Used only if an unexpected state value is detected, Queued - Queued in Via (New-1), Queued2 - Queued in Via, Active - Active with Agent, Wrap - Wrap with Agent, Review - To-be-replied Email waits for Supervisor review (Wait-for-Review), ReviewActive - Review-required email in the reviewing state (Read), Draft - Agent saved email draft, DraftActive - Agent retrieved the draft and is working on it now, Transferred - Is transferred email, TransferredActive - Agent received the transferred Email and is working on it now, Reassigned - Email reassigned to Work Type from the Email Reassignment Widget, ReassignedDraft - Email reassigned to User from the Email Reassignment Widget, ReassignedActive - An email in the Work Type queue, that was in the Reassigned state, has been routed to a User (by Engagement Hub).
emailType string false none Filter items based on email type. Enumeration : InboundEmail - Inbound Emails, ManualOutboundEmail - Manual Outbound, CampaignOutboundEmail - Campaign Outbound
emailObjectId string false none Alvaria-generated unique identifier for the access key.
replyEmailObjectId string false none Alvaria-generated unique identifier for the access key of the replied or draft email body.
fromAddress string false none Email address of the sender.
toAddress string false none Email address of the destination.
subject string false none Subject of the email.
workHandlerName string false none Name of the user handling the email call.
workTypeName string false none Alvaria-generated unique identifier for the work type.

Enumerated Values

Property Value
state Invalid
state Queued
state Queued2
state Active
state Wrap
state Review
state ReviewActive
state Draft
state DraftActive
state Transferred
state TransferredActive
state Reassigned
state ReassignedDraft
state ReassignedActive
emailType InboundEmail
emailType ManualOutboundEmail
emailType CampaignOutboundEmail

EmailList

{
  "kind": "via#emailList",
  "totalItems": 1,
  "lastIndexReturned": 0,
  "version": "20.0",
  "items": [
    {
      "id": "42235",
      "threadId": "247958000",
      "umId": "01-0010010000-190415-184140862-00034",
      "contactId": "5504",
      "interactionId": "5504",
      "workTypeId": "111",
      "workHandlerId": "208ddce3f41ec82",
      "sentTime": "2019-04-15T18:37:01.000Z",
      "receivedTime": "2019-04-15T18:41:40.000Z",
      "startTime": "2019-04-15T18:41:40.874Z",
      "queuedTime": "2019-04-15T18:41:40.874Z",
      "activeTime": "2019-04-15T20:02:20.213Z",
      "lastModifiedTime": "2019-04-15T20:02:49.446Z",
      "eventSequenceNumber": "77143977",
      "state": "Queued",
      "emailType": "InboundEmail",
      "emailObjectId": "email/1c8e-20190415-184140/111-0",
      "replyEmailObjectId": "email/fe1f-20190415-200249/111-1",
      "fromAddress": "customer@gmail.com",
      "toAddress": "service01@orgname.com",
      "subject": "Follow-up email to confirm my appointment",
      "workHandlerName": "doe, jane",
      "workTypeName": "Service01"
    }
  ]
}

Properties

Name Type Required Restrictions Description
kind string false none Identifier used by Alvaria™ Cloud components to serialize the payload of the results.
totalItems integer false none Total number of email items contained in the list.
lastIndexReturned integer false none This is a deprecated property.
version string false none The release version of Alvaria™ Cloud. Internal use only.
items [EmailItem] false none List of email items which meet the filter parameters.