CDR API
TPOSS CDR API allows you to read and delete Charging Data Records (CDRs) generated by TPOSS. To do so, you must first enable the database backend for them. Then, you can manage CDRs using the following RPC methods:
- Cdr.Read - to fetch a CDR by the given identifier
- Cdr.BulkRead - to fetch multiple CDRs by the given identifiers
- Cdr.List - to fetch the list of CDRs filtered by the given criteria
- Cdr.Delete - to delete a CDR by the given identifier
Data model
A CDR is represented by an object with the following attributes:
API methods
Cdr.Read
The method allows you to fetch the CDR object by the given CdrId. If the CDR with the given ID is found, TPOSS returns it in the response. Otherwise, an error is returned.
You can pass the following parameters in the request:
Example of the request:
Example the of the successful response:
In the case of an error, the response contains the error object with an error code and message:
The following error codes may be returned:
-30000- Required field is missing.-31601- CDR is not found for the givenCdrId.-31810- Validation error.-32700- Can't decode JSON request body.-33333- Not authenticated.
Cdr.BulkRead
This API is the same as Cdr.Read but allows you to pass a list of CdrIds in the request body. The API call returns a list of CDRs associated with the given CDR identifiers. In addition, TPOSS returns a list of CDR identifiers not associated with any CDR.
You can pass the following parameters in the request:
Example of the request:
Example of the successful response:
In the case of an error, the response contains the error object with an error code and message:
The following error codes may be returned:
-30000- Required field is missing.-32700- Can't decode JSON request body.-33333- Not authenticated.
Cdr.List
The method is similar to the Cdr.BulkRead API call. The difference is that the Cdr.List method allows you to filter CDRs not only by the identifier but also by other parameters defined in the data model. In addition, you can pass the Limit and Offset parameters. If the number of results exceeds the internal query limit, only the initial subset is returned. TPOSS returns an error if no valid query parameter is passed.
You can pass the following parameters in the request:
The Sort field defines the sorting order by a given field value. For example, to sort the CDRs by SubscriberId, the "Sort.SubscriberId:asc" parameter must be passed in the body request. The format is FieldName:SortOrder, where FieldName represents the field name of a CDR and the SortOrder value can be either asc or desc. The possible fields are listed in the data model section.
The Filter field allows you to filter the CDRs. The filter format is: FilterKey:FilterOperator:FilterValue. The FilterKey represents the field name of a CDR. The possible fields are listed in the data model section. The FilterOperator can have the following values:
is- equal toneq- not equal tolte- lower than or equal togt- greater thanlt- lower thangte- greater than or equal tostarts_with- match objects which start with the given patternends_with- match objects which end with the given patterncontains- match objects which contain the given pattern
The value of the FilterValue parameter specifies what to filter from the results.
Example of the request:
Example of the successful response:
In the case of an error, the response contains the error object with an error code and message:
The following error codes may be returned:
-30000- Required field is missing.-31411- Invalid query.-32700- Can't decode JSON request body.-33333- Not authenticated.
Cdr.Delete
The method allows you to delete the CDR associated with the CdrId identifier.
You can pass the following parameters in the request:
Example of the request:
Example of the successful response:
In the case of an error, the response contains the error object with an error code and message:
The following error codes may be returned:
-30000- Required field is missing.-31601- CDR is not found for the givenCdrId.-32700- Can't decode JSON request body.-33333- Not authenticated.