Difference between revisions of "MOR API drop active calls"
| (12 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
=Documentation= | |||
Full MOR REST API Documentation is available in '''/billing/api/v2/api-docs'''. | |||
=Description= | =Description= | ||
| Line 4: | Line 8: | ||
'''Availability:''' This API is available from '''MOR X18''' onwards. | '''Availability:''' This API is available from '''MOR X18''' onwards. | ||
<br/> | <br/> | ||
| Line 17: | Line 16: | ||
There are 2 endpoints related to Drop Active Calls: | There are 2 endpoints related to Drop Active Calls: | ||
* '''/active_calls/:id''' - Hangs up Active Call by | * '''/active_calls/:id''' - Hangs up the Active Call by id. | ||
* '''/active_calls''' - Hangs up all Active Calls. | * '''/active_calls''' - Hangs up all Active Calls. | ||
<br/> | <br/> | ||
| Line 32: | Line 31: | ||
Username and password must be provided in HTTP '''Authorization''' header, "username:password" string encoded in Base64. For example: | Username and password must be provided in HTTP '''Authorization''' header, "username:password" string encoded in Base64. For example: | ||
POST http://x.x.x.x/billing/api/ | POST http://x.x.x.x/billing/api/v2/authentication/login HTTP/1.1 | ||
Authorization: Basic cmljYXJkYxM6OWtBWFpadT9yak1iayRSaA== | Authorization: Basic cmljYXJkYxM6OWtBWFpadT9yak1iayRSaA== | ||
<br/> | <br/> | ||
| Line 40: | Line 39: | ||
JWT authentication uses a token (generated by MOR) with each request to endpoints. The API client must obtain a JWT token by calling the '''/authentication/login''' endpoint and then use this token in other endpoints for authentication until the token expires. Once the token has expired, a new token must be obtained from '''/authentication/login''' endpoint. | JWT authentication uses a token (generated by MOR) with each request to endpoints. The API client must obtain a JWT token by calling the '''/authentication/login''' endpoint and then use this token in other endpoints for authentication until the token expires. Once the token has expired, a new token must be obtained from '''/authentication/login''' endpoint. | ||
JWT token must be provided in HTTP Authorization header when requesting /active_calls/:id or /active_calls | JWT token must be provided in HTTP Authorization header when requesting '''/active_calls/:id''' or '''/active_calls''' endpoints. For example: | ||
DELETE http://x.x.x.x/billing/api/v2/active_calls/ | |||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU | |||
<br/> | |||
==Endpoints== | |||
===/active_calls/:id=== | |||
'''Method:''' | |||
DELETE | |||
<br/> | |||
<br/> | |||
'''Parameters:''' | |||
id - the id of the call. | |||
<br/> | |||
<br/> | |||
Example request: | |||
DELETE http://x.x.x.x/billing/api/v2/active_calls/111 | |||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU | ||
Example response: | |||
"{status: 'hung_up', hung_up_call: 111, hung_up_at: '2025-10-17 13:35:08'}" | |||
<br> | |||
===/active_calls/=== | |||
'''Method:''' | |||
DELETE | |||
<br/> | |||
<br/> | <br/> | ||
'''Parameters:''' | |||
None - empty request body. | |||
<br/> | |||
<br/> | |||
Example request: | |||
DELETE http://x.x.x.x/billing/api/v2/active_calls/ | |||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU | |||
Example response: | |||
"{status: 'hung_up', hung_up_calls: [1, 2], hung_up_at: '2025-10-17 13:35:08'}" | |||
=Additional notes= | |||
More examples and responses are available in the MOR REST API Documentation, which is available in '''/billing/api/v2/api-docs'''. | |||
Latest revision as of 13:56, 2 December 2025
Documentation
Full MOR REST API Documentation is available in /billing/api/v2/api-docs.
Description
The Drop Active calls API allows you to initiate a call drop by call ID or drop all calls.
Availability: This API is available from MOR X18 onwards.
API
The Drop Active Calls API accepts parameters in JSON format. Responses are also returned in JSON format.
There are 2 endpoints related to Drop Active Calls:
- /active_calls/:id - Hangs up the Active Call by id.
- /active_calls - Hangs up all Active Calls.
Authentication
The Drop Active Calls API requires user authentication - basic authentication (username/password) and JWT token authentication.
Basic authentication
Basic authentication uses the User's username and password to access API endpoints.
Username and password must be provided in HTTP Authorization header, "username:password" string encoded in Base64. For example:
POST http://x.x.x.x/billing/api/v2/authentication/login HTTP/1.1 Authorization: Basic cmljYXJkYxM6OWtBWFpadT9yak1iayRSaA==
JWT authentication
JWT authentication uses a token (generated by MOR) with each request to endpoints. The API client must obtain a JWT token by calling the /authentication/login endpoint and then use this token in other endpoints for authentication until the token expires. Once the token has expired, a new token must be obtained from /authentication/login endpoint.
JWT token must be provided in HTTP Authorization header when requesting /active_calls/:id or /active_calls endpoints. For example:
DELETE http://x.x.x.x/billing/api/v2/active_calls/ Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU
Endpoints
/active_calls/:id
Method:
DELETE
Parameters:
id - the id of the call.
Example request:
DELETE http://x.x.x.x/billing/api/v2/active_calls/111 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU
Example response:
"{status: 'hung_up', hung_up_call: 111, hung_up_at: '2025-10-17 13:35:08'}"
/active_calls/
Method:
DELETE
Parameters:
None - empty request body.
Example request:
DELETE http://x.x.x.x/billing/api/v2/active_calls/ Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhc3NpZ25lZF9kZXZpY2VzIjoiMiw4LDEwLDEyLDE4LDI2LDM2IiwiZXhwIjoxNzUyNTU1Njk4LCJpYXQiOjE3NTI0NjkyOTgsImlzcyI6IkZsYXNoIENhbGxzIEFQSSIsInN1YiI6InJpY2FyZGFzIn0.I3Sy1zrJx0mAsTLthitY8dyZfythsWzJ4V1CVfNJmYU
Example response:
"{status: 'hung_up', hung_up_calls: [1, 2], hung_up_at: '2025-10-17 13:35:08'}"
Additional notes
More examples and responses are available in the MOR REST API Documentation, which is available in /billing/api/v2/api-docs.