getRatingsForPeriod()

ActivityBatchURL getRatingsForPeriod(int ratingPeriodId)

This method returns a URL from which you can download the rated activity statements, or CDRs, for a subscription by rating period. Downloading rated activity statements helps you track or estimate how much your customers spend in a given rating period.

You can download activity statements only after the rating or pre-rating process runs. You cannot use this method to download unrated activity statements.

This method returns all rated activity statements in the rating period. If you call this method twice in a rating period, Smile returns the statements at the start of the period twice.

Before you call this method, call getRatingPeriods() to retrieve the rating period ID. Each rating period ID is unique and identifies a rating period for a specific subscription.

Parameters

ratingPeriodId
Format: integer
Purpose: Specifies the ID of the rating period to download activity statements for.

Results

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

If there is no activity in the rating period, 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 rating period ID does not match a rating period.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.GetPeriodRatings ratingPeriodId
ratingPeriodId
Purpose: Specifies the rating period to return an activity statement for.
Note: For more information about the Java client and the options it accepts, see Java client syntax.