Request OTP for Issuing Policy
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"phone": "0501234567",
"owner_id": "1012345678",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001"
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp"
payload = {
"email": "[email protected]",
"phone": "0501234567",
"owner_id": "1012345678",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
phone: '0501234567',
owner_id: '1012345678',
quote_request_id: 123,
quote_reference_id: '550e8400-e29b-41d4-a716-446655440000',
quote_price_id: '550e8400-e29b-41d4-a716-446655440001'
})
};
fetch('https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp', 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://sandbox.yasmina.ai/api/v1/car-comp/issue-otp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'phone' => '0501234567',
'owner_id' => '1012345678',
'quote_request_id' => 123,
'quote_reference_id' => '550e8400-e29b-41d4-a716-446655440000',
'quote_price_id' => '550e8400-e29b-41d4-a716-446655440001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"code": "40000",
"message": "Mobile is registered with different ID number"
}{
"code": "40101",
"message": "Unauthenticated"
}Request OTP for Issuing Policy
This endpoint sends a one-time password (OTP). It should be called before issuing a policy.
POST
/
issue-otp
Request OTP for Issuing Policy
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"phone": "0501234567",
"owner_id": "1012345678",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001"
}
'import requests
url = "https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp"
payload = {
"email": "[email protected]",
"phone": "0501234567",
"owner_id": "1012345678",
"quote_request_id": 123,
"quote_reference_id": "550e8400-e29b-41d4-a716-446655440000",
"quote_price_id": "550e8400-e29b-41d4-a716-446655440001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
phone: '0501234567',
owner_id: '1012345678',
quote_request_id: 123,
quote_reference_id: '550e8400-e29b-41d4-a716-446655440000',
quote_price_id: '550e8400-e29b-41d4-a716-446655440001'
})
};
fetch('https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp', 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://sandbox.yasmina.ai/api/v1/car-comp/issue-otp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'phone' => '0501234567',
'owner_id' => '1012345678',
'quote_request_id' => 123,
'quote_reference_id' => '550e8400-e29b-41d4-a716-446655440000',
'quote_price_id' => '550e8400-e29b-41d4-a716-446655440001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/car-comp/issue-otp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"phone\": \"0501234567\",\n \"owner_id\": \"1012345678\",\n \"quote_request_id\": 123,\n \"quote_reference_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"quote_price_id\": \"550e8400-e29b-41d4-a716-446655440001\"\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.{
"code": "40000",
"message": "Mobile is registered with different ID number"
}{
"code": "40101",
"message": "Unauthenticated"
}Authorizations
JWT Authorization header using the Bearer scheme
Body
application/json
Email address of the car owner
Example:
Phone number starting with 05 and containing 10 digits
Pattern:
^05\d{8}$Example:
"0501234567"
National ID or Iqama ID of the car owner (10 digits)
Pattern:
^(1|2|7)\d{9}$Example:
"1012345678"
ID of the car quote request
Example:
123
Unique identifier for the quote reference ID (coming from POST /quote-requests)
Example:
"550e8400-e29b-41d4-a716-446655440000"
Unique identifier for the quote price ID that exists inside a quote item (coming from POST /quote-requests)
Example:
"550e8400-e29b-41d4-a716-446655440001"
Response
⌘I

