Obtaining Charge Data (REST API)

Overview

Billing data can be obtained via a GET request to the REST web services API.   This data covers all services including telephony, messaging, backup and connectivity.  Any incidental charge issued to an account will be made available via this API.

 

Sample Query

https://portal.neural.net.au:15000/get/account-usage&user=USERNAME&pass=PASSWORD&fromid=1234567

Optionally, fields may also be sent in an HTTP POST request instead of GET 

 

Field List

Field Name

Required

Sample Value

Description

user

Yes

Jsmith

Your Portal username

pass

Yes

Secret123

Your Portal password

format

No

json

May be json or csv. The default is JSON if not specified.

srcacct

No

1234

Channel partners: Return only results from this sub-account

fromtimestamp

No

2013-12-01 00:00:00

Return results greater then this timestamp only (AEST) (inclusive)

totimestamp

No

2014-02-01 00:00:00

Return results greater then this timestamp only (AEST) (inclusive)

fromid

No

123456 Return results greater than this reference number only (exclusive)
toid No 123456 Return results less than this reference number only (exclusive)
download No true Returns the CSV as a file download

 

Fields are case sensitive; sample value is representative of default value.

Data will be returned in the requested format as specified in the the format field.  In the absence of the format field the response will be sent as JSON.

 

Formatting of timestamps

Timestamps may be provided in any format supported by PHP time interpretation, including relative times.  For example, you may specify a value of -30 days in the fromtimestamp field.  Please see the PHP documentation for information about compound date formats as well as relative date formats.  Compound and relative times will be interpreted as GMT+10 (AEST) unless a non-timezone-specific format (such as UNIX timestamp) is used, or the timezone is specified in the value.

https://portal.neural.net.au:15000/get/account-usage&user=USERNAME&pass=PASSWORD&fromtimestamp=-30 days&totimestamp=today

 

https://portal.neural.net.au:15000/get/account-usage&user=USERNAME&pass=PASSWORD&fromtimestamp=2016-12-24 00:00:00&totimestamp=2017-01-24 23:59:59

 

Result Values

Field Name

Encoding

Sample Value

Description

chargeid

Integer

123456789

ID number of the charge (account-scope unique)

chargeTimestamp

DateTime

2014-01-01 11:22:33

Timestamp of the charge event (AEST)

accountcode

Text

1234

Account that the charge is ultimately billed to

source_accountcode

Text

1234

Account that created the charge (may be a sub-account of the above) - often used in re-billing

desc

Text

Call from X to Y

Human readable description of the charge

group

Text

CALL Category for the charge type (eg. CALL, SMS)

rate_type

Text

voip_mobile Rate charge type label (relates to rate card)
charge Float 12.3456 Charge amount in AUD (up to 4 decimal places)

 

 Result Sizes

 Please be aware that queries for JSON format will only work for smaller data sets. For larger record retrieval, or if you're experiencing issues using JSON, please try CSV download by appending &format=csv&download=true to your query.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk