Password Call - authorization by code

Modified on Tue, 13 Feb 2024 at 08:14 AM

Method post /api/protected/api/auth/passwordcall in the "Intergrations" section >> "For developers" >> "Paid methods" >> "Authorization methods".

 

This method allows for making a call for identification purposes. The client doesn't need to provide any numbers for this; calls are made from our numbers. After answering the call, a message with an authorization code will be spoken.

The call itself is free, but there's an initiation cost of 0.0083 euros if it originates from a Slovakian number.

The method connects an API request with a specific call using a verification code, which will be provided after describing the method's parameters.

Example method call:

curl -X 'POST' \\
 '<https://paidmethods.mcn.ru/api/protected/api/auth/passwordcall>' \\
 -H 'accept: application/json' \\
 -H 'Content-Type: application/json' \\
 -H 'Sec-Fetch-Mode: cors' \\
 -H 'Authorization Bearer <TOKEN>' \\
 -d '{
 "phone_number": "421222202004",
 "verification_code": "1234",
 "is_with_redirect": true
 }'

Method parameters:

TOKEN - a token identifying the client's account. The number from which the call is made should be associated with this account, and charges for the service will be deducted from it. The token is found in the "API" section.

phone_number - the number to which the call will be made.

verification_code - the authorization code, a 4-digit code that will end the number from which the call originates IF this field is filled. If left empty, the call will be made from a random number.

is_with_redirect - whether redirection checking is enabled on the number. True for enabled, false for disabled.

Upon successful method execution, the following response is received:

{
 "ok": true,
 "caller_number": "421222202004"
 ,"verification_code": "1234"
 ,"verification_uuid": "da59bda0a1bb_117793",
 "is_redirect": false
 }
  1. ok parameter: True if the request is successful, false otherwise.
  2. caller_number: The number from which the call was made.
  3. verification_code: The four-digit code for authorization.
  4. verification_call_uuid: The verification code. It looks like this (example): "fa278be48dc2_117793", where the first part of the code before the "" is the call identifier, and the numbers after "" are the client's account. This code is necessary to link call data (CDR) with a specific API call. To receive call data, you need to set up a webhook for "Password call" in the "Integrations" section, and then information about the call will be sent to the specified URL. The verification code linking it to a specific API call can be found under the parameter "verification_call_uuid": "fa278be48dc2_117793".
  5. is_redirect: Whether redirection to another number is enabled. This parameter is active only when the variable is_with_redirect is set to true when calling the method.


Callback - Verification Call Statuses

Answered call

q931_status: 16, final_status: "ANSWER"

Busy

q931_status: 17, final_status: "CANCEL"

Unanswered call

q931_status: 16, final_status: "CANCEL"

Call failed due to the system ox7, call rejected by the receiving operator

q931_status: 31

Call failed due to billing issues

q931_status: 41

All other q931_status codes, except 31, 16, or 17, indicate that the number is unavailable.

Setting up a webhook to receive call information

To receive call information (CDR) via URL in connection with an API call, in the "Integrations" section, under the "Webhooks" subsection, create a subscription for the "Password call" event.

In the "Request Body" field, list the variables to be passed to the URL within a JSON array. Event monitoring is also available in the "Monitoring" section.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article