JSON API » outcosts » outcosts/list

Gets outbound call costs for a peer or rate plan.

Input parameters

Requires authentication and the system role privilege if specifying a peer or the commerce role privilege if specifying a rate plan.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
peerIntegerID of peer.Yes, unless plan is specified.None.
planIntegerID of rate plan.Yes, unless peer is specified.None.
countInteger1 to return a count, 0 to return full data.No0
descendingInteger1 to sort descending, 0 not to.No0
limitIntegerThe maximum results to return. 0 for all.No0
offsetIntegerThe result to start at. 0 for the first.No0
outgroupIntegerID of outbound group. 0 for all.No0
pagesInteger1 to return a reduced set of data for generating the pages select box, 0 to return full data.No0
sortStringField to sort by. "connectfee", "cost", "end", "included", "increment", "minimum", "outgroup_name", "outgroup_time_name", "priority", or "start".No"outgroup_name"

Specify peer or plan, but not both.

Responses

CodeDescription
200Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.

Data returned

An array of fields, one row for each cost. Costs are returned in the currency of the rate plan.

Example: With peer

http://enswitch.example.com/api/json/outcosts/list/?auth_username=user;auth_password=password;peer=1

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":123, "outgroup_time":1, ... }, { "id":124, "outgroup_time":2, ... } ] }

Change history

VersionChanges
3.13Function added.