JSON API » outcosts » outcosts/import

Imports outbound call costs from a CSV file.

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
csvStringThe contents of the CSV file.Yes
peerIntegerID of peer.Yes, unless plan is specified.None.
planIntegerID of rate plan.Yes, unless peer is specified.None.
deleteInteger1 to delete all costs first, 0 not to.No0
overwriteInteger1 to allow overwriting of existing costs, 0 not to.No0
recalculateInteger1 to recalculate outbound routes, 0 not to.No1

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.
403Your rate plan does not allow this.
500An internal error occurred. Check the key and message fields for more details.

Data returned

The number of costs created.

Example: With peer (csv field omitted for brevity)

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

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "count":123 } }

Change history

VersionChanges
3.13Default for recalculate changed to 1.
3.13Function added.