D
D
Denis2016-05-16 14:26:35
JavaScript
Denis, 2016-05-16 14:26:35

CoMagic service + HTML form. Why doesn't it send the number via API?

I made a callback form - form
When you click on the phone, the form pops up.
Further fulfills the number filter.
But when the button is pressed, nothing happens ...
But the number should be transferred to the comagic.ru service.
The site writes the following:

Add line:
Comagic.sitePhoneCall( {captcha_key: <идентификатор капчи>, captcha_val: <решение капчи>, phone: <номер телефона>}, callback);

Explanation:
captcha_key - captcha identifier. The parameter is required if the site settings indicate that captcha should be shown. If the site settings indicate that captcha should not be shown, then the parameter is optional, but if desired, it can be specified
captcha_val - captcha solution (what the visitor entered on the form). The parameter is required if the site settings indicate that captcha should be shown. If the site settings indicate that captcha should not be shown, then the parameter is optional, but you can optionally specify
phone - the visitor's phone number. Required parameter
callback(obj) - to return the result of the function; the object with the result looks like:
obj = {success: true||false, result: {status: XX}}
where: success=true - successful
success=false - not successful
result - returns an error code:
0 - everything is fine
1 - captcha is incorrectly solved
2 - scenario not set
3 - platform error
4 - limit on the number of calls per minute has been exceeded
If the callback parameter is not set, the function will work similarly to a standard call from a banner ( will show an error). To get a captcha (a picture with a verification code), the following method is used:
Comagic.Captcha.get_captcha(callback);
callback{key: myKey, url: myURL}

myKey - captcha key
myURL - image address

Where to shove
Comagic.sitePhoneCall( {captcha_key: <идентификатор капчи>, captcha_val: <решение капчи>, phone: <номер телефона>}, callback);

?
How to send a number?
Tried to implement like this , but something doesn't work...
What did I miss?
I have never worked with API and I want to learn, but I need an example or a tip.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question