getActivityStatementRange()

ActivityBatchURL getActivityStatementRange(string usn, 
 dateTime startTimestamp, dateTime endTimestamp)

This method returns a URL from which you can download unrated activity statements, or CDRs, that occur in a given date range.

You can only download information about activity that starts within the date range. For example, if a phone call begins at 10:59 am on 9 August 2012 and the date range begins at 11:00 am on 9 August 2012, the activity statement for the phone call is not included in the date range.

Use this method to download unrated activity statements for non-billing purposes, for example, to display activity statements to customers in a web interface.

Warning: To ensure that you do not exclude activity statements that are not bound to a subscription in timestamp order, do not use this method to download activity statements for billing. Instead, use the getActivityStatementBatch() method.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription or account. If the USN is an account, Smile makes available the activity statements for all subscriptions associated with the account.
startTimestamp
Format: dateTime
Purpose: Specifies the date and time that starts the date range, for example, 2012-05-01T00:00:00+11:00.
endTimestamp
Format: dateTime
Purpose: Specifies the date and time that ends the date range, for example, 2012-05-31T23:59:59+11:00.

Results

This method returns a URL from which you can download the unrated activity statements. The URL is valid for 24 hours after it is generated by Smile and the activity statements are collated into a CSV file.

If there is no activity in the date range, the method returns activity="false".

This method and the URL both use basic access authentication. You must use the same credentials to access the URL as you did to call the method.

There are no messages defined by this method.
Note: For more information about the format of activity statements, see the CDR documentation under Format Guides in the Inomial Documentation Library.

Example: A returned ActivityBatchURL XML document with activity statements

This example shows a returned ActivityBatchURL document with the URL from which you can download the activity statements.

<ActivityBatchURL xmlns="http://xml.inomial.com/smile/2.xsd" activity="true">
  <BatchID>1409213</BatchID>
  <URL>https://smile.example.com/activity?token=12049IASUBF9812p9</URL>
</ActivityBatchURL>

Example: A returned ActivityBatchURL XML document without activity

This example shows a returned ActivityBatchURL document with no activity.

<ActivityBatchURL xmlns="http://xml.inomial.com/smile/2.xsd" activity="false"/>

Faults

ActivityException

This fault is returned when Smile cannot produce an activity statement.

NoSuchItemException

This fault is returned when the specified USN does not match an account or subscription.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.SubscriptionActivityRange usn 
 startTimestamp endTimestamp
usn
Purpose: Specifies the USN of the account or subscription.
startTimestamp
Purpose: Specifies the date and time that starts the date range.
endTimestamp
Purpose: Specifies the date and time that ends the date range.
Note: For more information about the Java client and the options it accepts, see Java client syntax.