API Reference – Reporting API – messagesQueued()

Reporting API Method Documentation

©2009-2014 SocketLabs, Inc., Version 1.9, Last Edit: October 24, 2014

messagesQueued

Synopsis:

Retrieve a list of outbound email messages that have been sent to (queued by) the system.

Recommended Usage:

The messagesQueued method is deprecated in favor of the Notification API whenever possible. If the Notification API cannot be used, the messagesQueued method is useful for retrieving a list of messages recently sent to and queued by the On-Demand service; however, this method is less useful than other reporting API methods since it is both possible and recommended to track information about injected messages before they enter the SocketLabs Email On-Demand network instead of querying for this information at a later time.

Request Information

URL:

https://api.socketlabs.com/v1/messagesQueued

Response Format Types:

JSON, JSONP, XML or CSV

HTTP Method:

GET

Request Parameters:

serverId
Specifies the server ID to query. For more information see this overview on using the Server ID.
type
Specifies format of the response. May be set to JSON, JSONP, XML or CSV.
count
(Optional) Specifies the number of records to return in the result set. If this parameter is not specified it will default to 500. 500 is the maximum number of records that you may retrieve in one call. You can use this parameter in combination with the index parameter to pull down multiple “pages” of data making it possible to retrieve more than 500 records with multiple calls.
endDate
(Optional) Refers to the date and time that the message was queued by the system. Specifies the ending date and time of the records to return. The value should be formatted as yyyy-mm-dd hh:mm:ss. If the time is omitted it will default to 00:00:00.
index
(Optional) Specifies the zero based index of the first record to return from the result set.
mailingId
(Optional) Only records matching the specified mailingId will be returned. For more information see this overview on using Mailing ID and Message ID.
messageId
(Optional) Only records matching the specified messageId will be returned. For more information see this overview on using Mailing ID and Message ID.
startDate
(Optional) Refers to the date and time that the message was queued by the system. Specifies the starting date and time of the records to return. The value should be formatted as yyyy-mm-dd hh:mm:ss. If the time is omitted it will default to 00:00:00.
timeZone
(Optional) Specifies the timeZone offset that will be used by the API. For more information see this overview on using timezone data.

Example Request:

https://api.socketlabs.com/v1/messagesQueued?serverId=0001&type=xml

Response Data Structures

Response Data Structure (JSON):

{
    "timestamp": "Datetime",
    "totalCount": "Integer",
    "totalPages": "Integer",
    "page": "Integer",
    "count": "Integer",
    "collection": [
        {
            "ServerId": "Integer",
            "DateTime": "Datetime",
            "MessageId": "String",
            "FromAddress": "String",
            "MailingId": "String",
            "MessageSize": "Integer",
            "ToAddress": "String"
        },
    ],
}

Response Data Structure (XML):

<response>
    <timestamp>Datetime</timestamp>
    <totalCount>Integer</totalCount>
    <totalPages>Integer</totalPages>
    <page>Integer</page>
    <count>Integer</count>
    <collection>
        <item>
            <ServerId>Integer</ServerId>
            <DateTime>Datetime</DateTime>
            <MessageId>String</MessageId>
            <FromAddress>String</FromAddress>
            <MailingId>String</MailingId>
            <MessageSize>Integer</MessageSize>
            <ToAddress>String</ToAddress>
        </item>
    </collection>
</response>

Response Data Structure (CSV):

Data columns in the CSV format are in the following order:

ServerId,DateTime,MessageId,FromAddress,MailingId,MessageSize,ToAddress

Response Parameters

count
The number of entries in this page of data.
page
The current page of data returned by the query.
timestamp
The date and time of the API request.
totalCount
This field is deprecated, and should return as 0.
totalPages
This field is deprecated, and should return as 0.
collection.item.DateTime
The date and time that the event occurred.
collection.item.FromAddress
The sender of the message in question.
collection.item.MailingId
The X-xsMailingId header value of the message in question.
collection.item.MessageId
The X-xsMessageId header value of the message in question.
collection.item.MessageSize
The size of the message in bytes.
collection.item.ServerId
The ID of the server being queried.
collection.item.ToAddress
The recipient of the message in question.

Response Examples

Example Response (JSON):

{
    "timestamp": "1368647728890",
    "totalCount": 0,
    "totalPages": 0,
    "page": 1,
    "count": 1,
    "collection": [
        {
            "ServerId": 0001,
            "DateTime": "1361368985000",
            "MessageId": "",
            "FromAddress": "[email protected]",
            "MailingId": "",
            "MessageSize": 969,
            "ToAddress": "[email protected]"
        },
    ],
}

Example Response (XML):

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<response>
    <timestamp>2013-05-15T19:55:55.4744632Z</timestamp>
    <totalCount>0</totalCount>
    <totalPages>0</totalPages>
    <page>1</page>
    <count>1</count>
    <collection>
        <item>
            <ServerId>0001</ServerId>
            <DateTime>2013-02-20T14:03:05Z</DateTime>
            <MessageId></MessageId>
            <FromAddress>[email protected]</FromAddress>
            <MailingId></MailingId>
            <MessageSize>969</MessageSize>
            <ToAddress>[email protected]</ToAddress>
        </item>
    </collection>
</response>

Example Response (CSV):

ServerId,DateTime,MessageId,FromAddress,MailingId,MessageSize,ToAddress
0001,"""2/20/2013 2:03:05 PM +00:00""",,[email protected],,969,[email protected]

Customers Who Trust in SocketLabs

You’re in good company when working with SocketLabs. Here are some companies who have also trusted SocketLabs.

Why SocketLabs?

What Our Customers Are Saying!