curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/nafath/login?token=' \
--header 'Content-Type: application/json' \
--data '
{
"id": 5499999999,
"documentId": "a0d01c9d-f72f-4c57-af11-e26bda19cc59",
"isSign": false,
"shareToken": "cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0"
}
'import requests
url = "https://sandbox.circularo.com/api/v1/nafath/login?token="
payload = {
"id": 5499999999,
"documentId": "a0d01c9d-f72f-4c57-af11-e26bda19cc59",
"isSign": False,
"shareToken": "cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 5499999999,
documentId: 'a0d01c9d-f72f-4c57-af11-e26bda19cc59',
isSign: false,
shareToken: 'cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0'
})
};
fetch('https://sandbox.circularo.com/api/v1/nafath/login?token=', 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.circularo.com/api/v1/nafath/login?token=",
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([
'id' => 5499999999,
'documentId' => 'a0d01c9d-f72f-4c57-af11-e26bda19cc59',
'isSign' => false,
'shareToken' => 'cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0'
]),
CURLOPT_HTTPHEADER => [
"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.circularo.com/api/v1/nafath/login?token="
payload := strings.NewReader("{\n \"id\": 5499999999,\n \"documentId\": \"a0d01c9d-f72f-4c57-af11-e26bda19cc59\",\n \"isSign\": false,\n \"shareToken\": \"cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.circularo.com/api/v1/nafath/login?token=")
.header("Content-Type", "application/json")
.body("{\n \"id\": 5499999999,\n \"documentId\": \"a0d01c9d-f72f-4c57-af11-e26bda19cc59\",\n \"isSign\": false,\n \"shareToken\": \"cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/nafath/login?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 5499999999,\n \"documentId\": \"a0d01c9d-f72f-4c57-af11-e26bda19cc59\",\n \"isSign\": false,\n \"shareToken\": \"cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0\"\n}"
response = http.request(request)
puts response.read_body{
"random": "42",
"transId": "b3f0a1c2-7d4e-4a11-9f3b-2c8e5d6a7b90"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 498,
"type": "SHARE_AUTH:TOKEN_INVALID",
"message": "Invalid share token",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 500,
"type": "SYSTEM:INTERNAL_ERROR",
"message": "Internal error",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Start a Nafath identity check
POST /nafath/login
Asks Nafath, the Saudi national identity service, to confirm that the person behind a national identity number is present and willing. Nafath pushes a prompt to that person’s Nafath app offering several numbers; the answer here carries the one they have to choose, so show it to them, then follow the check with GET /nafath/status until it resolves.
One call serves three purposes, told apart by what accompanies the identity number. On its own it signs the person in - or, when the caller is already signed in, attaches the national identity to that account. With a share it lets an external recipient prove who they are before the document opens, which works only where the share was set up to expect that identity. With isSign it authorizes a signature, on a document named directly - which the caller has to be signed in for - or on one reached through a share. A signed-in caller additionally has to own the identity: it must already belong to exactly one account here, that account must be theirs, and where the share names an assignee it must be them too.
A check stays good for about a minute. After that it has to be started again.
Optional authorization: Authorize using a token, or by specifying the tenant, to call this endpoint.
curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/nafath/login?token=' \
--header 'Content-Type: application/json' \
--data '
{
"id": 5499999999,
"documentId": "a0d01c9d-f72f-4c57-af11-e26bda19cc59",
"isSign": false,
"shareToken": "cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0"
}
'import requests
url = "https://sandbox.circularo.com/api/v1/nafath/login?token="
payload = {
"id": 5499999999,
"documentId": "a0d01c9d-f72f-4c57-af11-e26bda19cc59",
"isSign": False,
"shareToken": "cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 5499999999,
documentId: 'a0d01c9d-f72f-4c57-af11-e26bda19cc59',
isSign: false,
shareToken: 'cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0'
})
};
fetch('https://sandbox.circularo.com/api/v1/nafath/login?token=', 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.circularo.com/api/v1/nafath/login?token=",
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([
'id' => 5499999999,
'documentId' => 'a0d01c9d-f72f-4c57-af11-e26bda19cc59',
'isSign' => false,
'shareToken' => 'cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0'
]),
CURLOPT_HTTPHEADER => [
"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.circularo.com/api/v1/nafath/login?token="
payload := strings.NewReader("{\n \"id\": 5499999999,\n \"documentId\": \"a0d01c9d-f72f-4c57-af11-e26bda19cc59\",\n \"isSign\": false,\n \"shareToken\": \"cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.circularo.com/api/v1/nafath/login?token=")
.header("Content-Type", "application/json")
.body("{\n \"id\": 5499999999,\n \"documentId\": \"a0d01c9d-f72f-4c57-af11-e26bda19cc59\",\n \"isSign\": false,\n \"shareToken\": \"cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/nafath/login?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 5499999999,\n \"documentId\": \"a0d01c9d-f72f-4c57-af11-e26bda19cc59\",\n \"isSign\": false,\n \"shareToken\": \"cir_82c5fa30d26bc.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0\"\n}"
response = http.request(request)
puts response.read_body{
"random": "42",
"transId": "b3f0a1c2-7d4e-4a11-9f3b-2c8e5d6a7b90"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 498,
"type": "SHARE_AUTH:TOKEN_INVALID",
"message": "Invalid share token",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 500,
"type": "SYSTEM:INTERNAL_ERROR",
"message": "Internal error",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Query Parameters
Body
Response
The check was started. Returns its identifier and the number the person has to pick in their Nafath app.