ReportRecentBatches
Schema to enable working with recent batches of data.
A batch is defined as a message text submitted to 2SMS at a given time and identified by a distinct 'GUID' value.
Actual SMS messages within a batch may have been sent to a number of destinations;
will be sent at different times if repeat message options were set;
and in the case of a long SMS message (over 160 characters) will consist of a number of component parts.
The schema provides different summary levels of information for a batch.
However, if the full set of results for an entire batch are required then the appropriate from of
ReportStandard (code 0310) should be used.
The 'UserID' and 'Password' elements identify the account.
The 'ServiceName' element must be set to 'ReportRecentBatches'.
The 'SoftwareVersion' element is for internal 2SMS use only and should not be set.
The 'ServiceDetail' element should contain one of the following:
- A 'RetrieveRecentGUIDs' child to obtain the most recent message reference 'GUID' values for the user.
A 'number' attribute must also be supplied to specify the number of recent 'GUID' values to return.
- An empty 'RetrieveRecentBatches' child to obtain basic details of all recent 'batches' sent both this month and last.
- A 'RetrieveSpecificBatch' child element to obtain detailed information on a specific batch.
This element must in turn contain
- A 'GUID' element (the original GUID reference of the batch).
- A 'DateID' element (an integer timestamp based on when the initial message request was received).
whose content together define the message batch.
These values will have been obtained either by calling this method with the empty 'RetrieveRecentBatches' element,
or extracted from a response to a SendMessage request (code 0410).
It may also contain an optional 'useUTC' attribute if date output is required in coordinated universal time.
This method returns a successful "00/OK" response if the batch details were successfully retrieved.
The 'Result' element contains the number of 'Record' elements.
The information in the 'Detail' element depends on the 'ServiceDetail' child of the initial request:
- A 'RetrieveRecentGUIDs' request returns a set of 'Record' elements each with a single 'GUID' child
element containing one of the most recently used GUID values.
- A 'RetrieveRecentBatches' request returns a set of 'Record' elements with the following children:
- A 'Batch' element with child elements containing the 'GUID' and 'DateID' values of the batch.
- A 'Message' element containing the text for the batch.
For long SMS messages (i.e. over 160 characters) the text is reconstituted from its component parts.
- A 'RetrieveSpecificBatch' request returns a single 'Record' element with the following children:
- A 'Batch' element with child elements containing the 'GUID' and 'DateID' values of the batch.
- A 'Message' element containing the text for the batch.
For long SMS messages (i.e. over 160 characters) the text is reconstituted from its component parts.
- A 'Destinations' element with a set of 'Destination' children to identify where the batch was sent.
- A 'DateSent' element which contains the time the message was submitted to 2SMS in ISO-8601 format.
This is in coordinated universal time if the useUTC attribute was set,
otherwise it is in the time zone registered for the account.
- A 'Status' element whose children have 'Count' attributes that detail the numbers of messages with a given status
(e.g. Success, Failed or WithNetwork).