# Integration Guidelines for Partner Relationship Management

# Service Provider Statistics Utility

## Web Service

The Service Provider Statistics Utility Web Service allows the Service Provider to retrieve the statistics it has generated from Oracle Communications Services Gatekeeper.

### Interface: SpService

The endpoint for this interface is: `http://<host>:<port>/prm_sp/services/SpStatisticsUtil`

Where the value of host and port depend on the Oracle Communications Services Gatekeeper deployment.

### listStatisticTypes

Lists the statistics types registered in Oracle Communications Services Gatekeeper.l

Table 9-1 listStatisticTypes()
Parameter Name | Type | Description
--- | --- | ---
Input |  |
No input parameters. |  |
Returns |  |
listStatisticTypesReturn | Array of tns1:StatisticTypeDescriptor | Descriptions of available statistics types. See StatisticTypeDescriptor.
Possible Exceptions |  |
ACCESS_DENIED |  |
CommonException |  |

### getStatistics

Retrieves statistics matching the given criteria

Table 9-2 getStatistics(statisticType, fromDate, toDate, spAccountId, appAccountId)
Parameter Name | Type | Description
--- | --- | ---
Input |  |
statisticType | xsd:int | Number representing the type of statistics to retrieve. Use null to not filter on this parameter
fromDate | xsd:dateTime | From date and time. Use null to not filter on this parameter.
toDate | xsd:dateTime | To date and time. Use null to not filter on this parameter.
appAccountId | xsd:string | ID of the Application Account to filter the result on. Use null to not filter on this parameter.
Returns |  |
getStatisticsReturn | Array of tns1:StatisticsInfo | Statistics. See StatisticsInfo.
Possible Exceptions |  |
CommonException |  |

.

### Exceptions

#### CommonException

This exception is raised when the login session has expired (BC only) or there are communication problems with the underlying platform.

### Data types

#### StatisticsInfo

Data structure defining a statistics record.All services that produces statistics do not use all fields, and they use the fields in a slightly different, depending on the type of the service. See the Communication Service Reference for details of which fields that are relevant for the different services.

Table 9-3 StatisticsInfo
Element name | Datatype | Description
--- | --- | ---
statisticsType | xsd:string | The statistics type. See WebLogic Product Description for information on available statistics types.
timeStampStart | xsd:dateTime | The starting time of the interval during which the statistics were gathered.
timeStampEnd | xsd:dateTime | The end time of the interval during which the statistics were gathered.
numberOfTransactions | xsd:int | The number of transactions during the interval.
spAccountD | xsd:string | The ID of the Service Provider that generated the statistics.
appAccountID | xsd:string | The ID of the Application Account that generated the statistics.

#### StatisticTypeDescriptor

Holds a description for each type of statistics.

Table 9-4 StatisticTypeDescriptor
Element name | Datatype | Description
--- | --- | ---
transactionTypeName | xsd:string | Name of a transaction type that statistics can be generated for.
transactionTypeID | xsd:int | Numeric ID of the transaction type.