This service is used to validate an OTP sent to a telephone number.

POST: 
     `URL_BASE + /ws/util.py/validate_otp`

## Receives:

All the parameters that the service receives must be indicated in the body
      of the request.

## Returns:

Depending on the result of the operation, this service can return two
      different JSON:

### Answer JSON OK:

```javascript
{
         "status"
        : <boolean>
        ,
         "signed"
        : <boolean>
        ,
         "signature_key"
        : <string>
        ,
         "elapsed"
        : <float>
         }
```

## Where:

* `status:` Shows if the call has been successful (true) or not (false).
* `signed:` Shows if the validation request is right or not.
* `signature_key:` Key to OTP verification.
* `amount:` Operation amount in the suitable format.

### Answer JSON KO:

```javascript
{
         "status"
        :{' '}
        false
        ,
         "level"
        : <string>
        ,
         "message"
        : <string>
        ,
         "error"
        : <string>
         }
```

## Where:

* `status:` Shows if the call has been successful (true) or not (false).
* `level:` Error importance level.
* `message:` Error message.
* `error:` Sole error code.

## Example requests:

### Python - Requests:

```javascript
import requests
         url ={' '}
        "URL_BASE/ws/util.py/validate_otp"
         payload ={' '}
        {
        'country_code'
        :{' '}
        'MX'
        ,
         'user_id'
        :{' '}
        '4532'
        ,
         'phone_number'
        :{' '}
        '7229063245'
        ,
         'otp'
        :{' '}
        '123456'
        ,
         'signature'
        :{' '}
        
          '277b62946d7ed08cf23a5613e3becc4711322abd'
        
        }
         files ={' '}
        [
        ]
         headers={' '}
        {
        }
         response = requests
        .request
        (
        "POST"
        , url
        , headers
        =headers
        , data{' '}
        = payload
        , files{' '}
        = files
        )
         print
        (response
        .text
        .encode
        (
        'utf8'
        )
        )
```

### NodeJs - Request:

```javascript
var request = require('request');
         var options = {
         'method': 'POST',
         'url': 'URL_BASE/ws/util.py/validate_otp',
         'headers': {},
         formData: {
         'country_code': 'MX',
         'user_id': '4532',
         'phone_number': '7229063245',
         'otp': '123456',
         'signature': '277b62946d7ed08cf23a5613e3becc4711322abd'
         }
         };
         request(options, function (error, response) {{' '}
         if (error) throw new Error(error);
         console.log(response.body);
         });
```

### JavaScript - Fetch:

```javascript
var formdata = new FormData();
         formdata.append("country_code", "MX");
         formdata.append("user_id", "4532");
         formdata.append("phone_number", "7229063245");
         formdata.append("otp", "123456");
         formdata.append("signature",
        "277b62946d7ed08cf23a5613e3becc4711322abd");
         var requestOptions = {
         method: 'POST',
         body: formdata,
         redirect: 'follow'
         };
         fetch("URL_BASE/ws/util.py/validate_otp", requestOptions)
         .then(response => response.text())
         .then(result => console.log(result))
         .catch(error => console.log('error', error));
```

### CURL:

```javascript
curl --location --request POST{' '}
        'URL_BASE/ws/util.py/validate_otp'{' '}
        \
         --form 
          'country_code=MX'
        {' '}
        \
         --form 'user_id=4532'{' '}
        \
         --form{' '}
        'phone_number=7229063245'{' '}
        \
         --form 'otp=123456'{' '}
        \
         --form{' '}
        
          'signature=277b62946d7ed08cf23a5613e3becc4711322abd'
```

## Business logic:

This service must be used by an user with administrator profile. The OTP
      sent to the indicated phone is validated.
