JSON API » outcosts » outcosts/create
Creates a new outbound call cost.
Input parameters
Requires authentication and the system role privilege if specifying a peer or the commerce role privilege if specifying a rate plan.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| outgroup_time | Integer | ID of the outgroup_time. | Yes | |
| peer | Integer | ID of peer. | Yes, unless plan is specified. | None. |
| plan | Integer | ID of rate plan. | Yes, unless peer is specified. | None. |
| callergroup | Integer | ID of caller group this outbound call cost will be restricted to, 0 for any caller. | No | 0 |
| connectfee | Decimal | A connect fee charged on answer. | No | 0.00 |
| cost | Decimal | The cost per minute after the included seconds are used. | No | 0.00 |
| description | String | Description. | No | Empty string. |
| end | Integer | The Unix timestamp after which this cost no longer applies. -1 for never. | No | -1 |
| included | Integer | The number of seconds included free with the connectfee. | No | 0 |
| increment | Integer | Billing increment in seconds. | No | 1 |
| least_cost | Integer | 1 to use this cost for least cost routing, 0 not to. | No | 1 |
| message | Decimal | The cost to send a message. | No | 0.00 |
| message_media | Decimal | The cost to send a media message. | No | 0.00 |
| minimum | Decimal | An overall minimum cost for the call if answered. | No | 0.00 |
| priority | Integer | The priority from 1 to 10. | No | 1 |
| start | Integer | The Unix timestamp from which this cost applies. | No | -1 |
| validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Specify peer or plan, but not both.
Responses
| Code | Description |
|---|---|
| 200 | Success. |
| 201 | Input passed validation. Only returned if validation=1. |
| 400 | Invalid input parameters specified. Check the key and message fields for more details. |
| 401 | The authentication details provided are invalid. |
| 402 | Your role does not allow this. |
| 403 | Your rate plan not allow this. |
Data returned
No data is returned.
Example: With peer, and zero costs
http://enswitch.example.com/api/json/outcosts/create/?auth_username=user;auth_password=password;outgroup_time=123;peer=1{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
| Version | Changes |
|---|---|
| 4.2 | message_media and callergroup parameters added. |
| 4.1 | least_cost parameter added. |
| 3.13 | Function added. |
