WhatsApp Channel
PIN status
Whether the user has a PIN and how many attempts are left. After 3 wrong PINs the PIN is locked for 2 hours (pinLockedUntil). The PIN is created and reset only in the Kravata widget.
Authentication
The user token returned by Verify the OTP, in both headers: Authorization: Bearer <user token> and Cookie: accessToken=<user token>.
See the WhatsApp channel guide for the full flow.
GET
/
api
/
v1
/
pin
/
status
PIN status
curl --request GET \
--url https://test-api-kore.kravata.co/api/v1/pin/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://test-api-kore.kravata.co/api/v1/pin/status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://test-api-kore.kravata.co/api/v1/pin/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-api-kore.kravata.co/api/v1/pin/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://test-api-kore.kravata.co/api/v1/pin/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://test-api-kore.kravata.co/api/v1/pin/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api-kore.kravata.co/api/v1/pin/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pinSet": true,
"pinAttemptsLeft": 3,
"pinLockedUntil": "<string>",
"securityQuestionsAttemptsLeft": 3,
"securityQuestionsLockedUntil": "<string>"
}Authorizations
Access token from POST /api/v1/client/token.
Response
200 - application/json
Successful response
The user has a PIN.
Example:
true
Attempts left before the lock.
Example:
3
ISO 8601 end of the lock, or null.
Attempts left for the security questions.
Example:
3
ISO 8601, or null.
PIN status
curl --request GET \
--url https://test-api-kore.kravata.co/api/v1/pin/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://test-api-kore.kravata.co/api/v1/pin/status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://test-api-kore.kravata.co/api/v1/pin/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-api-kore.kravata.co/api/v1/pin/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://test-api-kore.kravata.co/api/v1/pin/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://test-api-kore.kravata.co/api/v1/pin/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api-kore.kravata.co/api/v1/pin/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pinSet": true,
"pinAttemptsLeft": 3,
"pinLockedUntil": "<string>",
"securityQuestionsAttemptsLeft": 3,
"securityQuestionsLockedUntil": "<string>"
}
