Usage can be imported into the system using the v6/DataImport/Usage API. This API can post data to the system with the one or more usage records contained in the API body. The posted usage records will then be transformed as needed, mediated and rated.
The DataImport/Usage API call needs to be submitted a with usage feed value matching a usage feed that is configured in the system. This can be either the usage feed's Name or its ID.
The usage feed configured in the system will be set to use a particular data profile (a sample data profile is shown below).
The data profile will determine how the usage record contained in the API request is transformed.
The API body will contain the usage data. This data can be in csv or columnar format (this is determined by the data profile configuration that the usage feed has been setup to use). Below the request body contains data in csv format.
Note: Up to 1,000 rows (records) can be supplied in the request body.
The API response will include a trackingId which can uniquely identify the request in the system.
Upon a successful request the usage records submitted will be:
Collected by the system and batched
Sent to be mediated in groups up to 1,000 records. Batches will be sent after waiting at most 30 seconds
During mediation a unique batch ID will be assigned to the data as an additional tracking resource for tracking usage record processing
The mediated data will then be passed to the rating engine to be rated
Any issues rating the usage will generate a rating exception that will be logged and can be reprocessed
The system provides tools to track import, mediation and rating activities to ensure the process completed successfully or to troubleshoot issues.
To ensure the usage data was imported and mediated successfully you can access the Setup / Mediation / Import History screen and switch the view to show API Import activity.
If API data import exceptions have occurred they will be listed.
The listed errors will indicate why the import failed so that you can address the issue. Clicking the icon will display the full import exception message. The trackingId returned in the API response can be used here to locate the data import exception.
If the usage records were imported and mediated without issue but failed to rate, then the Setup / Usage Rating / Exceptions screen will display usage exceptions. Once the issue that caused the rating exception to occur is fixed the same screen can be used to Reprocess the exception to attempt to rate the usage again.