جدول پکیج های احراز هویت
ابتدا از لیست زیر پکیج موردنظر خود را انتخاب نمایید سپس کد پکیج موردنظر را در ورودی توکن وارد نمایید.
ردیف | نام پکیج | کدپکیج | گام های پکیج |
---|---|---|---|
1 | Package1 | 7161 | سرویس شاهکار و ثبت احوال |
2 | Package2 | 1916 | سرویس شاهکار و ثبت احوال ، سرویس بازخوانی کارت ملی(OCR) |
3 | Package3 | 5433 | سرویس شاهکار و ثبت احوال ، سرویس بازخوانی کارت ملی(OCR) ، سرویس امضای دیجیتال |
4 | Package4 | 9314 | سرویس شاهکار و ثبت احوال ، سرویس بازخوانی کارت ملی(OCR) ، سرویس امضای دیجیتال ، دریافت تصویر شناسنامه فرد |
5 | Package5 | 3282 | سرویس شاهکار و ثبت احوال ، سرویس بازخوانی کارت ملی(OCR) ، سرویس امضای دیجیتال ، دریافت تصویر شناسنامه فرد ، دریافت سریال کارت ملی فرد |
6 | Package6 | 1087 | سرویس شاهکار و ثبت احوال ، سرویس بازخوانی کارت ملی(OCR) ، سرویس امضای دیجیتال ، دریافت تصویر شناسنامه فرد ، دریافت سریال کارت ملی فرد ، پردازش تصویر و ویدیو |
7 | Package7 | 7979 | سرویس شاهکار و ثبت احوال ، سرویس بازخوانی کارت ملی(OCR) ، دریافت سریال کارت ملی فرد ، پردازش تصویر و ویدیو |
8 | Package8 | 2756 | سرویس شاهکار و ثبت احوال ، دریافت سریال کارت ملی فرد ، پردازش تصویر و ویدیو |
9 | Package9 | 6359 | سرویس امضای دیجیتال |
سرویس های احراز هویت
سرویس دریافت توکن
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
https://api.itsaaz.ir/EKyc/AuthorizedApiToken
Post
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
{
"username": "test",
"password": "t_86574213@T",
"clientId": "ekyc",
"clientSecret": "f63026a9-912d-8978-ac80-4ae5d63db1ac",
"mobile": "",
"nationalCode": "",
"birthDate": ""
}
{
"data": {
"token": "توکن",
"orderId": "شماره درخواست"
},
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | username* | String | نام کاربری |
2 | password* | String | رمز عبور |
3 | clientId* | String | آیدی مشتری |
4 | clientSecret* | String | شناسه مشتری |
4 | NationalCode | String | کدملی فرد |
5 | mobile* | String | شماره موبایل فرد |
6 | BirthDate | String | تاریخ تولد (شمسی04/05/1400) |
7 | packageCode* | String | کد پکیج موردنظر |
8 | shahkarInquiry | bool | تطبیق شماره موبایل و کدملی فرد |
9 | civilRegInquiry | bool | دریافت اطلاعات ثبت احوال فرد |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/EKyc/AuthorizedApiToken");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "text/plain");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "application/json-patch+json");
var body = @"{" + "\n" +
@" ""username"": ""test""," + "\n" +
@" ""password"": ""test@H""," + "\n" +
@" ""clientId"": ""test""," + "\n" +
@" ""clientSecret"": ""78b2925e-5267-0bb9-7db4-043004a85aa7""," + "\n" +
@" ""mobile"": ""test""," + "\n" +
@" ""nationalCode"": ""test""," + "\n" +
@" ""birthDate"": ""1371/02/05""" + "\n" +
@"}";
request.AddParameter("application/json-patch+json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/EKyc/AuthorizedApiToken' \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--data-raw '{
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}'
var headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
};
var request = http.Request('POST', Uri.parse('https://api.itsaaz.ir/EKyc/AuthorizedApiToken'));
request.body = json.encode({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/EKyc/AuthorizedApiToken"
method := "POST"
payload := strings.NewReader(`{
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "text/plain")
req.Header.Add("Authorization", "Bearer YOUR-TOKEN")
req.Header.Add("Content-Type", "application/json-patch+json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /EKyc/AuthorizedApiToken HTTP/1.1
Host: api.itsaaz.ir
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
Content-Length: 203
{
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json-patch+json");
RequestBody body = RequestBody.create(mediaType, "{\n \"username\": \"test\",\n \"password\": \"test@H\",\n \"clientId\": \"test\",\n \"clientSecret\": \"78b2925e-5267-0bb9-7db4-043004a85aa7\",\n \"mobile\": \"test\",\n \"nationalCode\": \"test\",\n \"birthDate\": \"1371/02/05\"\n}");
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/EKyc/AuthorizedApiToken")
.method("POST", body)
.addHeader("accept", "text/plain")
.addHeader("Authorization", "Bearer YOUR-TOKEN")
.addHeader("Content-Type", "application/json-patch+json")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/EKyc/AuthorizedApiToken")
.header("accept", "text/plain")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"username\": \"test\",\n \"password\": \"test@H\",\n \"clientId\": \"test\",\n \"clientSecret\": \"78b2925e-5267-0bb9-7db4-043004a85aa7\",\n \"mobile\": \"test\",\n \"nationalCode\": \"test\",\n \"birthDate\": \"1371/02/05\"\n}")
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "text/plain");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "application/json-patch+json");
var raw = JSON.stringify({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/EKyc/AuthorizedApiToken", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var settings = {
"url": "https://api.itsaaz.ir/EKyc/AuthorizedApiToken",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "text/plain",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "application/json-patch+json"
},
"data": JSON.stringify({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = JSON.stringify({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/EKyc/AuthorizedApiToken");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("Authorization", "Bearer YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/EKyc/AuthorizedApiToken");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: text/plain");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: application/json-patch+json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\n \"username\": \"test\",\n \"password\": \"test@H\",\n \"clientId\": \"test\",\n \"clientSecret\": \"78b2925e-5267-0bb9-7db4-043004a85aa7\",\n \"mobile\": \"test\",\n \"nationalCode\": \"test\",\n \"birthDate\": \"1371/02/05\"\n}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var data = JSON.stringify({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
});
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/EKyc/AuthorizedApiToken',
headers: {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/EKyc/AuthorizedApiToken',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
});
req.write(postData);
req.end();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/EKyc/AuthorizedApiToken',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/EKyc/AuthorizedApiToken')
.headers({
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
})
.send(JSON.stringify({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/EKyc/AuthorizedApiToken"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"text/plain",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"application/json-patch+json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\n \"username\": \"test\",\n \"password\": \"test@H\",\n \"clientId\": \"test\",\n \"clientSecret\": \"78b2925e-5267-0bb9-7db4-043004a85aa7\",\n \"mobile\": \"test\",\n \"nationalCode\": \"test\",\n \"birthDate\": \"1371/02/05\"\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref "{\n \"username\": \"test\",\n \"password\": \"test@H\",\n \"clientId\": \"test\",\n \"clientSecret\": \"78b2925e-5267-0bb9-7db4-043004a85aa7\",\n \"mobile\": \"test\",\n \"nationalCode\": \"test\",\n \"birthDate\": \"1371/02/05\"\n}";;
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/EKyc/AuthorizedApiToken" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "text/plain"
|> fun h -> Header.add h "Authorization" "Bearer YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "application/json-patch+json"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/EKyc/AuthorizedApiToken',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}',
CURLOPT_HTTPHEADER => array(
'accept: text/plain',
'Authorization: Bearer YOUR-TOKEN',
'Content-Type: application/json-patch+json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/EKyc/AuthorizedApiToken');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$request->setBody('{\n "username": "test",\n "password": "test@H",\n "clientId": "test",\n "clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",\n "mobile": "test",\n "nationalCode": "test",\n "birthDate": "1371/02/05"\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/EKyc/AuthorizedApiToken');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", "text/plain")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "application/json-patch+json")
$body = "{`n `"username`": `"test`",`n `"password`": `"test@H`",`n `"clientId`": `"test`",`n `"clientSecret`": `"78b2925e-5267-0bb9-7db4-043004a85aa7`",`n `"mobile`": `"test`",`n `"nationalCode`": `"test`",`n `"birthDate`": `"1371/02/05`"`n}"
$response = Invoke-RestMethod 'https://api.itsaaz.ir/EKyc/AuthorizedApiToken' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import json
conn = http.client.HTTPSConnection("api.itsaaz.ir")
payload = json.dumps({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
conn.request("POST", "/EKyc/AuthorizedApiToken", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
import json
url = "https://api.itsaaz.ir/EKyc/AuthorizedApiToken"
payload = json.dumps({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "json"
require "net/http"
url = URI("https://api.itsaaz.ir/EKyc/AuthorizedApiToken")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "text/plain"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "application/json-patch+json"
request.body = JSON.dump({
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
})
response = https.request(request)
puts response.read_body
printf '{
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}'| http --follow --timeout 3600 POST 'https://api.itsaaz.ir/EKyc/AuthorizedApiToken' \
accept:'text/plain' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'application/json-patch+json'
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--body-data '{
"username": "test",
"password": "test@H",
"clientId": "test",
"clientSecret": "78b2925e-5267-0bb9-7db4-043004a85aa7",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}' \
'https://api.itsaaz.ir/EKyc/AuthorizedApiToken'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\n \"username\": \"test\",\n \"password\": \"test@H\",\n \"clientId\": \"test\",\n \"clientSecret\": \"78b2925e-5267-0bb9-7db4-043004a85aa7\",\n \"mobile\": \"test\",\n \"nationalCode\": \"test\",\n \"birthDate\": \"1371/02/05\"\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/EKyc/AuthorizedApiToken")!,timeoutInterval: Double.infinity)
request.addValue("text/plain", forHTTPHeaderField: "accept")
request.addValue("Bearer YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("application/json-patch+json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
سرویس تطابق اطلاعات فرد و ارسال پیامک:
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
https://api.itsaaz.ir/ekyc/personal/info
Post
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
{
"orderId": "c8b2d66a-afa3-43cc-81bd-ad1a865e4f28",
"mobile": "test",
"nationalCode": "test",
"birthDate": "1371/02/05"
}
{
"data": {
"nextRequestTimeOutInSeconds": زمان تا ریکوئست تایم اوت بعدی به ثانیه,
"message": "پیام",
"orderId": "شماره درخواست"
},
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | orderId | String | شماره درخواست |
2 | NationalCode | String | کدملی فرد |
4 | BirthDate | String | تاریخ تولد (شمسی04/05/1400) |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/ekyc/personal/info");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "text/plain");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "application/json-patch+json");
var body = @"{""mobile"":""09192517163"",""nationalCode"":""0370362063"",""birthDate"":""1369/07/11""}";
request.AddParameter("application/json-patch+json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/ekyc/personal/info' \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--data-raw '{"mobile":"09192517163","nationalCode":"0370362063","birthDate":"1369/07/11"}'
var headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
};
var request = http.Request('POST', Uri.parse('https://api.itsaaz.ir/ekyc/personal/info'));
request.body = json.encode({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/ekyc/personal/info"
method := "POST"
payload := strings.NewReader(`{"mobile":"09192517163","nationalCode":"0370362063","birthDate":"1369/07/11"}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "text/plain")
req.Header.Add("Authorization", "Bearer YOUR-TOKEN")
req.Header.Add("Content-Type", "application/json-patch+json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /ekyc/personal/info HTTP/1.1
Host: api.itsaaz.ir
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
Content-Length: 77
{"mobile":"09192517163","nationalCode":"0370362063","birthDate":"1369/07/11"}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json-patch+json");
RequestBody body = RequestBody.create(mediaType, "{\"mobile\":\"09192517163\",\"nationalCode\":\"0370362063\",\"birthDate\":\"1369/07/11\"}");
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/ekyc/personal/info")
.method("POST", body)
.addHeader("accept", "text/plain")
.addHeader("Authorization", "Bearer YOUR-TOKEN")
.addHeader("Content-Type", "application/json-patch+json")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/ekyc/personal/info")
.header("accept", "text/plain")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "application/json-patch+json")
.body("{\"mobile\":\"09192517163\",\"nationalCode\":\"0370362063\",\"birthDate\":\"1369/07/11\"}")
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "text/plain");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "application/json-patch+json");
var raw = JSON.stringify({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/ekyc/personal/info", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var settings = {
"url": "https://api.itsaaz.ir/ekyc/personal/info",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "text/plain",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "application/json-patch+json"
},
"data": JSON.stringify({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = JSON.stringify({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/ekyc/personal/info");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("Authorization", "Bearer YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/ekyc/personal/info");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: text/plain");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: application/json-patch+json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\"mobile\":\"09192517163\",\"nationalCode\":\"0370362063\",\"birthDate\":\"1369/07/11\"}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var data = JSON.stringify({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
});
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/ekyc/personal/info',
headers: {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/ekyc/personal/info',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
});
req.write(postData);
req.end();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/ekyc/personal/info',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/ekyc/personal/info')
.headers({
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
})
.send(JSON.stringify({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/ekyc/personal/info"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"text/plain",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"application/json-patch+json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\"mobile\":\"09192517163\",\"nationalCode\":\"0370362063\",\"birthDate\":\"1369/07/11\"}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref "{\"mobile\":\"09192517163\",\"nationalCode\":\"0370362063\",\"birthDate\":\"1369/07/11\"}";;
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/ekyc/personal/info" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "text/plain"
|> fun h -> Header.add h "Authorization" "Bearer YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "application/json-patch+json"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/ekyc/personal/info',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"mobile":"09192517163","nationalCode":"0370362063","birthDate":"1369/07/11"}',
CURLOPT_HTTPHEADER => array(
'accept: text/plain',
'Authorization: Bearer YOUR-TOKEN',
'Content-Type: application/json-patch+json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/ekyc/personal/info');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$request->setBody('{"mobile":"09192517163","nationalCode":"0370362063","birthDate":"1369/07/11"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/ekyc/personal/info');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{"mobile":"09192517163","nationalCode":"0370362063","birthDate":"1369/07/11"}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", "text/plain")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "application/json-patch+json")
$body = "{`"mobile`":`"09192517163`",`"nationalCode`":`"0370362063`",`"birthDate`":`"1369/07/11`"}"
$response = Invoke-RestMethod 'https://api.itsaaz.ir/ekyc/personal/info' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import json
conn = http.client.HTTPSConnection("api.itsaaz.ir")
payload = json.dumps({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
conn.request("POST", "/ekyc/personal/info", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
import json
url = "https://api.itsaaz.ir/ekyc/personal/info"
payload = json.dumps({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "json"
require "net/http"
url = URI("https://api.itsaaz.ir/ekyc/personal/info")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "text/plain"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "application/json-patch+json"
request.body = JSON.dump({
"mobile": "09192517163",
"nationalCode": "0370362063",
"birthDate": "1369/07/11"
})
response = https.request(request)
puts response.read_body
printf '{"mobile":"09192517163","nationalCode":"0370362063","birthDate":"1369/07/11"}'| http --follow --timeout 3600 POST 'https://api.itsaaz.ir/ekyc/personal/info' \
accept:'text/plain' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'application/json-patch+json'
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--body-data '{"mobile":"09192517163","nationalCode":"0370362063","birthDate":"1369/07/11"}' \
'https://api.itsaaz.ir/ekyc/personal/info'info'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\"mobile\":\"09192517163\",\"nationalCode\":\"0370362063\",\"birthDate\":\"1369/07/11\"}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/ekyc/personal/info")!,timeoutInterval: Double.infinity)
request.addValue("text/plain", forHTTPHeaderField: "accept")
request.addValue("Bearer YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("application/json-patch+json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
سرویس بررسی صحت OTP:
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
https://api.itsaaz.ir/ekyc/verifyotp
Post
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
{
"orderId":"96d2110e-5e79-4857-9310-3ebfa36544d0",
"code":"908091"
}
{
"data": true,
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | Code | String | کد OTP |
2 | orderId | String | شماره درخواست |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/ekyc/verifyotp");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "text/plain");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "application/json-patch+json");
var body = @"{""orderId"":""96d2110e-5e79-4857-9310-3ebfa36544d0"",""code"":""908091""}";
request.AddParameter("application/json-patch+json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/ekyc/verifyotp' \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--data-raw '{"orderId":"96d2110e-5e79-4857-9310-3ebfa36544d0","code":"908091"}'
var headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
};
var request = http.Request('POST', Uri.parse('https://api.itsaaz.ir/ekyc/verifyotp'));
request.body = json.encode({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/ekyc/verifyotp"
method := "POST"
payload := strings.NewReader(`{"orderId":"96d2110e-5e79-4857-9310-3ebfa36544d0","code":"908091"}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "text/plain")
req.Header.Add("Authorization", "Bearer YOUR-TOKEN")
req.Header.Add("Content-Type", "application/json-patch+json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /ekyc/verifyotp HTTP/1.1
Host: api.itsaaz.ir
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
Content-Length: 66
{"orderId":"96d2110e-5e79-4857-9310-3ebfa36544d0","code":"908091"}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json-patch+json");
RequestBody body = RequestBody.create(mediaType, "{\"orderId\":\"96d2110e-5e79-4857-9310-3ebfa36544d0\",\"code\":\"908091\"}");
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/ekyc/verifyotp")
.method("POST", body)
.addHeader("accept", "text/plain")
.addHeader("Authorization", "Bearer YOUR-TOKEN")
.addHeader("Content-Type", "application/json-patch+json")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/ekyc/verifyotp")
.header("accept", "text/plain")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "application/json-patch+json")
.body("{\"orderId\":\"96d2110e-5e79-4857-9310-3ebfa36544d0\",\"code\":\"908091\"}")
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "text/plain");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "application/json-patch+json");
var raw = JSON.stringify({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/ekyc/verifyotp", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var settings = {
"url": "https://api.itsaaz.ir/ekyc/verifyotp",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "text/plain",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "application/json-patch+json"
},
"data": JSON.stringify({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = JSON.stringify({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/ekyc/verifyotp");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("Authorization", "Bearer YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/ekyc/verifyotp");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: text/plain");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: application/json-patch+json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\"orderId\":\"96d2110e-5e79-4857-9310-3ebfa36544d0\",\"code\":\"908091\"}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var data = JSON.stringify({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
});
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/ekyc/verifyotp',
headers: {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/ekyc/verifyotp',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
});
req.write(postData);
req.end();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/ekyc/verifyotp',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/ekyc/verifyotp')
.headers({
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
})
.send(JSON.stringify({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/ekyc/verifyotp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"text/plain",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"application/json-patch+json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\"orderId\":\"96d2110e-5e79-4857-9310-3ebfa36544d0\",\"code\":\"908091\"}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref "{\"orderId\":\"96d2110e-5e79-4857-9310-3ebfa36544d0\",\"code\":\"908091\"}";;
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/ekyc/verifyotp" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "text/plain"
|> fun h -> Header.add h "Authorization" "Bearer YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "application/json-patch+json"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/ekyc/verifyotp',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"orderId":"96d2110e-5e79-4857-9310-3ebfa36544d0","code":"908091"}',
CURLOPT_HTTPHEADER => array(
'accept: text/plain',
'Authorization: Bearer YOUR-TOKEN',
'Content-Type: application/json-patch+json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/ekyc/verifyotp');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$request->setBody('{"orderId":"96d2110e-5e79-4857-9310-3ebfa36544d0","code":"908091"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}h(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/ekyc/verifyotp');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{"orderId":"96d2110e-5e79-4857-9310-3ebfa36544d0","code":"908091"}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", "text/plain")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "application/json-patch+json")
$body = "{`"orderId`":`"96d2110e-5e79-4857-9310-3ebfa36544d0`",`"code`":`"908091`"}"
$response = Invoke-RestMethod 'https://api.itsaaz.ir/ekyc/verifyotp' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import json
conn = http.client.HTTPSConnection("api.itsaaz.ir")
payload = json.dumps({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
conn.request("POST", "/ekyc/verifyotp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
import json
url = "https://api.itsaaz.ir/ekyc/verifyotp"
payload = json.dumps({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "json"
require "net/http"
url = URI("https://api.itsaaz.ir/ekyc/verifyotp")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "text/plain"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "application/json-patch+json"
request.body = JSON.dump({
"orderId": "96d2110e-5e79-4857-9310-3ebfa36544d0",
"code": "908091"
})
response = https.request(request)
puts response.read_body
printf '{"orderId":"96d2110e-5e79-4857-9310-3ebfa36544d0","code":"908091"}'| http --follow --timeout 3600 POST 'https://api.itsaaz.ir/ekyc/verifyotp' \
accept:'text/plain' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'application/json-patch+json'
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--body-data '{"orderId":"96d2110e-5e79-4857-9310-3ebfa36544d0","code":"908091"}' \
'https://api.itsaaz.ir/ekyc/verifyotp'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\"orderId\":\"96d2110e-5e79-4857-9310-3ebfa36544d0\",\"code\":\"908091\"}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/ekyc/verifyotp")!,timeoutInterval: Double.infinity)
request.addValue("text/plain", forHTTPHeaderField: "accept")
request.addValue("Bearer YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("application/json-patch+json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
سرویس ارسال مجدد OTP:
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
https://api.itsaaz.ir/EKyc/ResendOtp
Post
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
{"mobile":""}
{
"data": true,
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | orderId | String | شماره درخواست |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/EKyc/ResendOtp");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "text/plain");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "application/json-patch+json");
var body = @"{""mobile"":""test"",
" + "\n" +
@"""orderId"": ""a353bb23-7439-45cc-8edd-8e180c1a9c41""
" + "\n" +
@"}";
request.AddParameter("application/json-patch+json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/EKyc/ResendOtp' \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--data-raw '{"mobile":"test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
}'
var headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
};
var request = http.Request('POST', Uri.parse('https://api.itsaaz.ir/EKyc/ResendOtp'));
request.body = json.encode({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/EKyc/ResendOtp"
method := "POST"
payload := strings.NewReader(`{"mobile":"test",`+"
"+`
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "text/plain")
req.Header.Add("Authorization", "Bearer YOUR-TOKEN")
req.Header.Add("Content-Type", "application/json-patch+json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /EKyc/ResendOtp HTTP/1.1
Host: api.itsaaz.ir
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
Content-Length: 71
{"mobile":"test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json-patch+json");
RequestBody body = RequestBody.create(mediaType, "{\"mobile\":\"test\",\r\n\"orderId\": \"a353bb23-7439-45cc-8edd-8e180c1a9c41\"\r\n}");
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/EKyc/ResendOtp")
.method("POST", body)
.addHeader("accept", "text/plain")
.addHeader("Authorization", "Bearer YOUR-TOKEN")
.addHeader("Content-Type", "application/json-patch+json")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/EKyc/ResendOtp")
.header("accept", "text/plain")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "application/json-patch+json")
.body("{\"mobile\":\"test\",\r\n\"orderId\": \"a353bb23-7439-45cc-8edd-8e180c1a9c41\"\r\n}")
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "text/plain");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "application/json-patch+json");
var raw = JSON.stringify({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/EKyc/ResendOtp", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var settings = {
"url": "https://api.itsaaz.ir/EKyc/ResendOtp",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "text/plain",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "application/json-patch+json"
},
"data": JSON.stringify({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = JSON.stringify({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/EKyc/ResendOtp");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("Authorization", "Bearer YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/EKyc/ResendOtp");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: text/plain");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: application/json-patch+json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\"mobile\":\"test\",\r\n\"orderId\": \"a353bb23-7439-45cc-8edd-8e180c1a9c41\"\r\n}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var data = JSON.stringify({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
});
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/EKyc/ResendOtp',
headers: {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/EKyc/ResendOtp',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
});
req.write(postData);
req.end();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/EKyc/ResendOtp',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/EKyc/ResendOtp')
.headers({
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
})
.send(JSON.stringify({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/EKyc/ResendOtp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"text/plain",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"application/json-patch+json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\"mobile\":\"test\",\r\n\"orderId\": \"a353bb23-7439-45cc-8edd-8e180c1a9c41\"\r\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref "{\"mobile\":\"test\",\r\n\"orderId\": \"a353bb23-7439-45cc-8edd-8e180c1a9c41\"\r\n}";;
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/EKyc/ResendOtp" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "text/plain"
|> fun h -> Header.add h "Authorization" "Bearer YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "application/json-patch+json"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/EKyc/ResendOtp',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"mobile":"test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
}',
CURLOPT_HTTPHEADER => array(
'accept: text/plain',
'Authorization: Bearer YOUR-TOKEN',
'Content-Type: application/json-patch+json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/EKyc/ResendOtp');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$request->setBody('{"mobile":"test",
\n"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/EKyc/ResendOtp');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{"mobile":"test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", "text/plain")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "application/json-patch+json")
$body = "{`"mobile`":`"test`",
`n`"orderId`": `"a353bb23-7439-45cc-8edd-8e180c1a9c41`"
`n}"
$response = Invoke-RestMethod 'https://api.itsaaz.ir/EKyc/ResendOtp' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import json
conn = http.client.HTTPSConnection("api.itsaaz.ir")
payload = json.dumps({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
conn.request("POST", "/EKyc/ResendOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
import json
url = "https://api.itsaaz.ir/EKyc/ResendOtp"
payload = json.dumps({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "json"
require "net/http"
url = URI("https://api.itsaaz.ir/EKyc/ResendOtp")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "text/plain"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "application/json-patch+json"
request.body = JSON.dump({
"mobile": "test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
})
response = https.request(request)
puts response.read_body
printf '{"mobile":"test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
}'| http --follow --timeout 3600 POST 'https://api.itsaaz.ir/EKyc/ResendOtp' \
accept:'text/plain' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'application/json-patch+json'
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--body-data '{"mobile":"test",
"orderId": "a353bb23-7439-45cc-8edd-8e180c1a9c41"
}' \
'https://api.itsaaz.ir/EKyc/ResendOtp'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\"mobile\":\"test\",\r\n\"orderId\": \"a353bb23-7439-45cc-8edd-8e180c1a9c41\"\r\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/EKyc/ResendOtp")!,timeoutInterval: Double.infinity)
request.addValue("text/plain", forHTTPHeaderField: "accept")
request.addValue("Bearer YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("application/json-patch+json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
ارسال تصویر پشت و روی کارت ملی (OCR):
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
https://api.itsaaz.ir/ekyc/nationalcard
Post
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: multipart/form-data
OrderId="a353bb23-7439-45cc-8edd-8e180c1a9c41"
FrontSide=@"/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif"
BackSide=@"/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif"
{
"data": {
"serialCard": "شماره پیگیری"
},
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | orderId | String | شماره درخواست |
2 | FrontSide | file | تصویر روی کارت ملی |
3 | BackSide | file | تصویر پشت کارت ملی |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/ekyc/nationalcard");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "text/plain");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "multipart/form-data");
request.AddParameter("OrderId", "a353bb23-7439-45cc-8edd-8e180c1a9c41");
request.AddFile("FrontSide", "/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif");
request.AddFile("BackSide", "/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/ekyc/nationalcard' \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: multipart/form-data' \
--form 'OrderId="a353bb23-7439-45cc-8edd-8e180c1a9c41"' \
--form 'FrontSide=@"/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif"' \
--form 'BackSide=@"/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif"'
var headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.itsaaz.ir/ekyc/nationalcard'));
request.fields.addAll({
'OrderId': 'a353bb23-7439-45cc-8edd-8e180c1a9c41'
});
request.files.add(await http.MultipartFile.fromPath('FrontSide', '/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif'));
request.files.add(await http.MultipartFile.fromPath('BackSide', '/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"bytes"
"mime/multipart"
"os"
"path/filepath"
"io"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/ekyc/nationalcard"
method := "POST"
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("OrderId", "a353bb23-7439-45cc-8edd-8e180c1a9c41")
file, errFile2 := os.Open("/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif")
defer file.Close()
part2,
errFile2 := writer.CreateFormFile("FrontSide",filepath.Base("/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif"))
_, errFile2 = io.Copy(part2, file)
if errFile2 != nil {
fmt.Println(errFile2)
return
}
file, errFile3 := os.Open("/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif")
defer file.Close()
part3,
errFile3 := writer.CreateFormFile("BackSide",filepath.Base("/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif"))
_, errFile3 = io.Copy(part3, file)
if errFile3 != nil {
fmt.Println(errFile3)
return
}
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "text/plain")
req.Header.Add("Authorization", "Bearer YOUR-TOKEN")
req.Header.Add("Content-Type", "multipart/form-data")
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /ekyc/nationalcard HTTP/1.1
Host: api.itsaaz.ir
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Length: 540
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="OrderId"
a353bb23-7439-45cc-8edd-8e180c1a9c41
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="FrontSide"; filename="b02dc94a-af4f-490f-a859-26e3efed63d4.jfif"
Content-Type: <Content-type header here>
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="BackSide"; filename="b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif"
Content-Type: <Content-type header here>
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("multipart/form-data");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("OrderId","a353bb23-7439-45cc-8edd-8e180c1a9c41")
.addFormDataPart("FrontSide","b02dc94a-af4f-490f-a859-26e3efed63d4.jfif",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif")))
.addFormDataPart("BackSide","b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif")))
.build();
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/ekyc/nationalcard")
.method("POST", body)
.addHeader("accept", "text/plain")
.addHeader("Authorization", "Bearer YOUR-TOKEN")
.addHeader("Content-Type", "multipart/form-data")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/ekyc/nationalcard")
.header("accept", "text/plain")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "multipart/form-data")
.field("OrderId", "a353bb23-7439-45cc-8edd-8e180c1a9c41")
.field("file", new File("/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif"))
.field("file", new File("/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif"))
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "text/plain");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "multipart/form-data");
var formdata = new FormData();
formdata.append("OrderId", "a353bb23-7439-45cc-8edd-8e180c1a9c41");
formdata.append("FrontSide", fileInput.files[0], "b02dc94a-af4f-490f-a859-26e3efed63d4.jfif");
formdata.append("BackSide", fileInput.files[0], "b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/ekyc/nationalcard", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var form = new FormData();
form.append("OrderId", "a353bb23-7439-45cc-8edd-8e180c1a9c41");
form.append("FrontSide", fileInput.files[0], "b02dc94a-af4f-490f-a859-26e3efed63d4.jfif");
form.append("BackSide", fileInput.files[0], "b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif");
var settings = {
"url": "https://api.itsaaz.ir/ekyc/nationalcard",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "text/plain",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "multipart/form-data"
},
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = new FormData();
data.append("OrderId", "a353bb23-7439-45cc-8edd-8e180c1a9c41");
data.append("FrontSide", fileInput.files[0], "b02dc94a-af4f-490f-a859-26e3efed63d4.jfif");
data.append("BackSide", fileInput.files[0], "b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/ekyc/nationalcard");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("Authorization", "Bearer YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "multipart/form-data");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/ekyc/nationalcard");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: text/plain");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: multipart/form-data");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_mime *mime;
curl_mimepart *part;
mime = curl_mime_init(curl);
part = curl_mime_addpart(mime);
curl_mime_name(part, "OrderId");
curl_mime_data(part, "a353bb23-7439-45cc-8edd-8e180c1a9c41", CURL_ZERO_TERMINATED);
part = curl_mime_addpart(mime);
curl_mime_name(part, "FrontSide");
curl_mime_filedata(part, "/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif");
part = curl_mime_addpart(mime);
curl_mime_name(part, "BackSide");
curl_mime_filedata(part, "/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif");
curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
res = curl_easy_perform(curl);
curl_mime_free(mime);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('OrderId', 'a353bb23-7439-45cc-8edd-8e180c1a9c41');
data.append('FrontSide', fs.createReadStream('/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif'));
data.append('BackSide', fs.createReadStream('/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif'));
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/ekyc/nationalcard',
headers: {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data',
...data.getHeaders()
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/ekyc/nationalcard',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"OrderId\"\r\n\r\na353bb23-7439-45cc-8edd-8e180c1a9c41\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"FrontSide\"; filename=\"b02dc94a-af4f-490f-a859-26e3efed63d4.jfif\"\r\nContent-Type: \"{Insert_File_Content_Type}\"\r\n\r\n" + fs.readFileSync('/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif') + "\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"BackSide\"; filename=\"b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif\"\r\nContent-Type: \"{Insert_File_Content_Type}\"\r\n\r\n" + fs.readFileSync('/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif') + "\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--";
req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
req.write(postData);
req.end();
var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/ekyc/nationalcard',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
},
formData: {
'OrderId': 'a353bb23-7439-45cc-8edd-8e180c1a9c41',
'FrontSide': [
fs.createReadStream('/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif')
],
'BackSide': [
fs.createReadStream('/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif')
]
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/ekyc/nationalcard')
.headers({
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
})
.field('OrderId', 'a353bb23-7439-45cc-8edd-8e180c1a9c41')
.attach('file', '/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif')
.attach('file', '/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif')
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/ekyc/nationalcard"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"text/plain",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"multipart/form-data"
};
[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
@{ @"name": @"OrderId", @"value": @"a353bb23-7439-45cc-8edd-8e180c1a9c41" },
@{ @"name": @"FrontSide", @"fileName": @"/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif" },
@{ @"name": @"BackSide", @"fileName": @"/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
[body appendFormat:@"--%@\r\n", boundary];
if (param[@"fileName"]) {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
if (error) {
NSLog(@"%@", error);
}
} else {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
[body appendFormat:@"%@", param[@"value"]];
}
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let parameters = [|
[| ("name", "OrderId"); ("value", "a353bb23-7439-45cc-8edd-8e180c1a9c41") |];
[| ("name", "FrontSide"); ("fileName", "/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif") |];
[| ("name", "BackSide"); ("fileName", "/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif") |]
|];;
let boundary = "----WebKitFormBoundary7MA4YWxkTrZu0gW";;
let postData = ref "";;
for x = 0 to Array.length parameters - 1 do
let (_, paramName) = parameters.(x).(0) in
let (paramType, _) = parameters.(x).(1) in
let accum = "--" ^ boundary ^ "\r\n" ^ "Content-Disposition: form-data; name=\"" ^ paramName ^ "\"" in
if paramType = "value" then (
let (_, paramValue) = parameters.(x).(1) in
postData := if Array.length parameters.(x) == 3 then (
let (_, contentType) = parameters.(x).(2) in
!postData ^ accum ^ "\r\n" ^ "Content-Type: " ^ contentType ^ "\r\n\r\n" ^ paramValue ^ "\r\n"
) else (
!postData ^ accum ^ "\r\n\r\n" ^ paramValue ^ "\r\n"
);
)
else if paramType = "fileName" then (
let (_, filepath) = parameters.(x).(1) in
postData := !postData ^ accum ^ "; filename=\""^ filepath ^"\"\r\n";
let ch = open_in filepath in
let fileContent = really_input_string ch (in_channel_length ch) in
close_in ch;
postData := !postData ^ "Content-Type: {content-type header}\r\n\r\n"^ fileContent ^"\r\n";
)
done;;
postData := !postData ^ "--" ^ boundary ^ "--"
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/ekyc/nationalcard" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "text/plain"
|> fun h -> Header.add h "Authorization" "Bearer YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "multipart/form-data"
|> fun h -> Header.add h "content-type" "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/ekyc/nationalcard',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('OrderId' => 'a353bb23-7439-45cc-8edd-8e180c1a9c41','FrontSide'=> new CURLFILE('/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif'),'BackSide'=> new CURLFILE('/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif')),
CURLOPT_HTTPHEADER => array(
'accept: text/plain',
'Authorization: Bearer YOUR-TOKEN',
'Content-Type: multipart/form-data'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/ekyc/nationalcard');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'multipart/form-data'
));
$request->addPostParameter(array(
'OrderId' => 'a353bb23-7439-45cc-8edd-8e180c1a9c41'
));
$request->addUpload('FrontSide', '/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif', 'b02dc94a-af4f-490f-a859-26e3efed63d4.jfif', '<Content-Type Header>');
$request->addUpload('BackSide', '/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif', 'b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif', '<Content-Type Header>');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/ekyc/nationalcard');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->addForm(array(
'OrderId' => 'a353bb23-7439-45cc-8edd-8e180c1a9c41'
), array(
array('name' => 'FrontSide', 'type' => '<Content-Type Header>', 'file' => '/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif', 'data' => null),
array('name' => 'BackSide', 'type' => '<Content-Type Header>', 'file' => '/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif', 'data' => null)
));
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'multipart/form-data'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", "text/plain")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "multipart/form-data")
$multipartContent = [System.Net.Http.MultipartFormDataContent]::new()
$stringHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$stringHeader.Name = "OrderId"
$stringContent = [System.Net.Http.StringContent]::new("a353bb23-7439-45cc-8edd-8e180c1a9c41")
$stringContent.Headers.ContentDisposition = $stringHeader
$multipartContent.Add($stringContent)
$multipartFile = '/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif'
$FileStream = [System.IO.FileStream]::new($multipartFile, [System.IO.FileMode]::Open)
$fileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$fileHeader.Name = "FrontSide"
$fileHeader.FileName = "b02dc94a-af4f-490f-a859-26e3efed63d4.jfif"
$fileContent = [System.Net.Http.StreamContent]::new($FileStream)
$fileContent.Headers.ContentDisposition = $fileHeader
$multipartContent.Add($fileContent)
$multipartFile = '/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif'
$FileStream = [System.IO.FileStream]::new($multipartFile, [System.IO.FileMode]::Open)
$fileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$fileHeader.Name = "BackSide"
$fileHeader.FileName = "b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif"
$fileContent = [System.Net.Http.StreamContent]::new($FileStream)
$fileContent.Headers.ContentDisposition = $fileHeader
$multipartContent.Add($fileContent)
$body = $multipartContent
$response = Invoke-RestMethod 'https://api.itsaaz.ir/ekyc/nationalcard' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import mimetypes
from codecs import encode
conn = http.client.HTTPSConnection("api.itsaaz.ir")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=OrderId;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("a353bb23-7439-45cc-8edd-8e180c1a9c41"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=FrontSide; filename={0}'.format('b02dc94a-af4f-490f-a859-26e3efed63d4.jfif')))
fileType = mimetypes.guess_type('/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif')[0] or 'application/octet-stream'
dataList.append(encode('Content-Type: {}'.format(fileType)))
dataList.append(encode(''))
with open('/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif', 'rb') as f:
dataList.append(f.read())
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=BackSide; filename={0}'.format('b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif')))
fileType = mimetypes.guess_type('/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif')[0] or 'application/octet-stream'
dataList.append(encode('Content-Type: {}'.format(fileType)))
dataList.append(encode(''))
with open('/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif', 'rb') as f:
dataList.append(f.read())
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/ekyc/nationalcard", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "https://api.itsaaz.ir/ekyc/nationalcard"
payload={'OrderId': 'a353bb23-7439-45cc-8edd-8e180c1a9c41'}
files=[
('FrontSide',('b02dc94a-af4f-490f-a859-26e3efed63d4.jfif',open('/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif','rb'),'application/octet-stream')),
('BackSide',('b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif',open('/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif','rb'),'application/octet-stream'))
]
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
require "uri"
require "net/http"
url = URI("https://api.itsaaz.ir/ekyc/nationalcard")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "text/plain"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "multipart/form-data"
form_data = [['OrderId', 'a353bb23-7439-45cc-8edd-8e180c1a9c41'],['FrontSide', File.open('/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif')],['BackSide', File.open('/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif')]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
http --ignore-stdin --form --follow --timeout 3600 POST 'https://api.itsaaz.ir/ekyc/nationalcard' \
'OrderId'='a353bb23-7439-45cc-8edd-8e180c1a9c41' \
'FrontSide'@/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif \
'BackSide'@/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif \
accept:'text/plain' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'multipart/form-data'-urlencoded'
# wget doesn't support file upload via form data, use curl -F \
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: multipart/form-data' \
--body-data 'OrderId=a353bb23-7439-45cc-8edd-8e180c1a9c41' \
'https://api.itsaaz.ir/ekyc/nationalcard'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = [
[
"key": "OrderId",
"value": "a353bb23-7439-45cc-8edd-8e180c1a9c41",
"type": "text"
],
[
"key": "FrontSide",
"src": "/C:/Users/itsaaz/Desktop/b02dc94a-af4f-490f-a859-26e3efed63d4.jfif",
"type": "file"
],
[
"key": "BackSide",
"src": "/C:/Users/itsaaz/Desktop/b0cefff6-bebe-4149-b989-11d6b81cebbb.jfif",
"type": "file"
]] as [[String : Any]]
let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
if param["disabled"] == nil {
let paramName = param["key"]!
body += "--\(boundary)\r\n"
body += "Content-Disposition:form-data; name=\"\(paramName)\""
if param["contentType"] != nil {
body += "\r\nContent-Type: \(param["contentType"] as! String)"
}
let paramType = param["type"] as! String
if paramType == "text" {
let paramValue = param["value"] as! String
body += "\r\n\r\n\(paramValue)\r\n"
} else {
let paramSrc = param["src"] as! String
let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
let fileContent = String(data: fileData, encoding: .utf8)!
body += "; filename=\"\(paramSrc)\"\r\n"
+ "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
}
}
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/ekyc/nationalcard")!,timeoutInterval: Double.infinity)
request.addValue("text/plain", forHTTPHeaderField: "accept")
request.addValue("Bearer YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("multipart/form-data", forHTTPHeaderField: "Content-Type")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
درصورتی که فرد مورد نظر کارت ملی جدید نداشت با استفاده از سرویس زیر کد رهگیری خود را وارد نماید.
۱-متد فراخوانی سرویس POST می باشد.
https://api.itsaaz.ir/ekyc/verify/serialcard
Post
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
{
"nationalCardSerial":"3G35188796"
}
{
"data": true,
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | orderId | string | شماره درخواست |
2 | nationalCardSerial | string | سریال کارت ملی/کدپیگیری کارت ملی |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/ekyc/verify/serialcard");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "text/plain");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "application/json-patch+json");
var body = @"{""orderId"":""bafacb06-99fd-47c7-8ddd-3192d61e0518"",""nationalCardSerial"":""3G35188796""}";
request.AddParameter("application/json-patch+json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/ekyc/verify/serialcard' \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--data-raw '{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}'
var headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
};
var request = http.Request('POST', Uri.parse('https://api.itsaaz.ir/ekyc/verify/serialcard'));
request.body = json.encode({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/ekyc/verify/serialcard"
method := "POST"
payload := strings.NewReader(`{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "text/plain")
req.Header.Add("Authorization", "Bearer YOUR-TOKEN")
req.Header.Add("Content-Type", "application/json-patch+json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
} "fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/identity/token"
method := "POST"
payload := strings.NewReader("grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H")
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /ekyc/verify/serialcard HTTP/1.1
Host: api.itsaaz.ir
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
Content-Length: 84
{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json-patch+json");
RequestBody body = RequestBody.create(mediaType, "{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}");
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/ekyc/verify/serialcard")
.method("POST", body)
.addHeader("accept", "text/plain")
.addHeader("Authorization", "Bearer YOUR-TOKEN")
.addHeader("Content-Type", "application/json-patch+json")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/ekyc/verify/serialcard")
.header("accept", "text/plain")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "application/json-patch+json")
.body("{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}")
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "text/plain");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "application/json-patch+json");
var raw = JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/ekyc/verify/serialcard", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var settings = {
"url": "https://api.itsaaz.ir/ekyc/verify/serialcard",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "text/plain",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "application/json-patch+json"
},
"data": JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/ekyc/verify/serialcard");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("Authorization", "Bearer YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/ekyc/verify/serialcard");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: text/plain");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: application/json-patch+json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var data = JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/ekyc/verify/serialcard',
headers: {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/ekyc/verify/serialcard',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
req.write(postData);
req.end();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/ekyc/verify/serialcard',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/ekyc/verify/serialcard')
.headers({
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
})
.send(JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/ekyc/verify/serialcard"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"text/plain",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"application/json-patch+json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref "{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}";;
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/ekyc/verify/serialcard" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "text/plain"
|> fun h -> Header.add h "Authorization" "Bearer YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "application/json-patch+json"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/ekyc/verify/serialcard',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}',
CURLOPT_HTTPHEADER => array(
'accept: text/plain',
'Authorization: Bearer YOUR-TOKEN',
'Content-Type: application/json-patch+json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/ekyc/verify/serialcard');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$request->setBody('{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/ekyc/verify/serialcard');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", "text/plain")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "application/json-patch+json")
$body = "{`"orderId`":`"bafacb06-99fd-47c7-8ddd-3192d61e0518`",`"nationalCardSerial`":`"3G35188796`"}"
$response = Invoke-RestMethod 'https://api.itsaaz.ir/ekyc/verify/serialcard' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import json
conn = http.client.HTTPSConnection("api.itsaaz.ir")
payload = json.dumps({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
conn.request("POST", "/ekyc/verify/serialcard", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
import json
url = "https://api.itsaaz.ir/ekyc/verify/serialcard"
payload = json.dumps({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "json"
require "net/http"
url = URI("https://api.itsaaz.ir/ekyc/verify/serialcard")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "text/plain"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "application/json-patch+json"
request.body = JSON.dump({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
})
response = https.request(request)
puts response.read_body
printf '{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}'| http --follow --timeout 3600 POST 'https://api.itsaaz.ir/ekyc/verify/serialcard' \
accept:'text/plain' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'application/json-patch+json'
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--body-data '{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}' \
'https://api.itsaaz.ir/ekyc/verify/serialcard'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/ekyc/verify/serialcard")!,timeoutInterval: Double.infinity)
request.addValue("text/plain", forHTTPHeaderField: "accept")
request.addValue("Bearer YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("application/json-patch+json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
دریافت عکس کارت ملی بر اساس سریال کارت ملی/کدپیگیری:
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
https://api.itsaaz.ir/ekyc/verify/serialcard
Post
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
{
"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial":"3G35188796"
}
{
"data": true,
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | orderId | String | شماره درخواست |
2 | nationalCardSerial | String | سریال کارت ملی/کدپیگیری کارت ملی |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/ekyc/verify/serialcard");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "text/plain");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "application/json-patch+json");
var body = @"{""orderId"":""bafacb06-99fd-47c7-8ddd-3192d61e0518"",""nationalCardSerial"":""3G35188796""}";
request.AddParameter("application/json-patch+json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/ekyc/verify/serialcard' \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--data-raw '{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}'
var headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
};
var request = http.Request('POST', Uri.parse('https://api.itsaaz.ir/ekyc/verify/serialcard'));
request.body = json.encode({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/ekyc/verify/serialcard"
method := "POST"
payload := strings.NewReader(`{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "text/plain")
req.Header.Add("Authorization", "Bearer YOUR-TOKEN")
req.Header.Add("Content-Type", "application/json-patch+json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
} "fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/identity/token"
method := "POST"
payload := strings.NewReader("grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H")
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /ekyc/verify/serialcard HTTP/1.1
Host: api.itsaaz.ir
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json-patch+json
Content-Length: 84
{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json-patch+json");
RequestBody body = RequestBody.create(mediaType, "{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}");
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/ekyc/verify/serialcard")
.method("POST", body)
.addHeader("accept", "text/plain")
.addHeader("Authorization", "Bearer YOUR-TOKEN")
.addHeader("Content-Type", "application/json-patch+json")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/ekyc/verify/serialcard")
.header("accept", "text/plain")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "application/json-patch+json")
.body("{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}")
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "text/plain");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "application/json-patch+json");
var raw = JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/ekyc/verify/serialcard", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var settings = {
"url": "https://api.itsaaz.ir/ekyc/verify/serialcard",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "text/plain",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "application/json-patch+json"
},
"data": JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/ekyc/verify/serialcard");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("Authorization", "Bearer YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/ekyc/verify/serialcard");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: text/plain");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: application/json-patch+json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var data = JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/ekyc/verify/serialcard',
headers: {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/ekyc/verify/serialcard',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
});
req.write(postData);
req.end();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/ekyc/verify/serialcard',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
},
body: JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/ekyc/verify/serialcard')
.headers({
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
})
.send(JSON.stringify({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/ekyc/verify/serialcard"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"text/plain",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"application/json-patch+json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref "{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}";;
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/ekyc/verify/serialcard" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "text/plain"
|> fun h -> Header.add h "Authorization" "Bearer YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "application/json-patch+json"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/ekyc/verify/serialcard',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}',
CURLOPT_HTTPHEADER => array(
'accept: text/plain',
'Authorization: Bearer YOUR-TOKEN',
'Content-Type: application/json-patch+json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/ekyc/verify/serialcard');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$request->setBody('{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/ekyc/verify/serialcard');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json-patch+json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", "text/plain")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "application/json-patch+json")
$body = "{`"orderId`":`"bafacb06-99fd-47c7-8ddd-3192d61e0518`",`"nationalCardSerial`":`"3G35188796`"}"
$response = Invoke-RestMethod 'https://api.itsaaz.ir/ekyc/verify/serialcard' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import json
conn = http.client.HTTPSConnection("api.itsaaz.ir")
payload = json.dumps({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
conn.request("POST", "/ekyc/verify/serialcard", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
import json
url = "https://api.itsaaz.ir/ekyc/verify/serialcard"
payload = json.dumps({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
})
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json-patch+json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "json"
require "net/http"
url = URI("https://api.itsaaz.ir/ekyc/verify/serialcard")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "text/plain"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "application/json-patch+json"
request.body = JSON.dump({
"orderId": "bafacb06-99fd-47c7-8ddd-3192d61e0518",
"nationalCardSerial": "3G35188796"
})
response = https.request(request)
puts response.read_body
printf '{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}'| http --follow --timeout 3600 POST 'https://api.itsaaz.ir/ekyc/verify/serialcard' \
accept:'text/plain' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'application/json-patch+json'
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json-patch+json' \
--body-data '{"orderId":"bafacb06-99fd-47c7-8ddd-3192d61e0518","nationalCardSerial":"3G35188796"}' \
'https://api.itsaaz.ir/ekyc/verify/serialcard'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\"orderId\":\"bafacb06-99fd-47c7-8ddd-3192d61e0518\",\"nationalCardSerial\":\"3G35188796\"}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/ekyc/verify/serialcard")!,timeoutInterval: Double.infinity)
request.addValue("text/plain", forHTTPHeaderField: "accept")
request.addValue("Bearer YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("application/json-patch+json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
سرویس دریافت تصویر صفحه اول و دوم شناسنامه(اختیاری):
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
https://api.itsaaz.ir/EKyc/birthCertificate
Post
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: multipart/form-data
OrderId="9162da96-a4e3-4a67-86b6-814d03a11cde"
FirstPage=@"/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg"
SecondPage=@"/C:/Users/itsaaz/Downloads/clipboard-image (14).png"
{
"data": true,
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | orderId | String | شماره درخواست |
2 | Firstpage | file | تصویر صفحه اول شناسنامه |
3 | Secondpage | file | تصویر صفحه دوم شناسنامه |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/EKyc/birthCertificate");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "text/plain");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "multipart/form-data");
request.AddParameter("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde");
request.AddFile("FirstPage", "/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg");
request.AddFile("SecondPage", "/C:/Users/itsaaz/Downloads/clipboard-image (14).png");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/EKyc/birthCertificate' \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: multipart/form-data' \
--form 'OrderId="9162da96-a4e3-4a67-86b6-814d03a11cde"' \
--form 'FirstPage=@"/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg"' \
--form 'SecondPage=@"/C:/Users/itsaaz/Downloads/clipboard-image (14).png"'
var headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.itsaaz.ir/EKyc/birthCertificate'));
request.fields.addAll({
'OrderId': '9162da96-a4e3-4a67-86b6-814d03a11cde'
});
request.files.add(await http.MultipartFile.fromPath('FirstPage', '/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg'));
request.files.add(await http.MultipartFile.fromPath('SecondPage', '/C:/Users/itsaaz/Downloads/clipboard-image (14).png'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"bytes"
"mime/multipart"
"os"
"path/filepath"
"io"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/EKyc/birthCertificate"
method := "POST"
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde")
file, errFile2 := os.Open("/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg")
defer file.Close()
part2,
errFile2 := writer.CreateFormFile("FirstPage",filepath.Base("/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg"))
_, errFile2 = io.Copy(part2, file)
if errFile2 != nil {
fmt.Println(errFile2)
return
}
file, errFile3 := os.Open("/C:/Users/itsaaz/Downloads/clipboard-image (14).png")
defer file.Close()
part3,
errFile3 := writer.CreateFormFile("SecondPage",filepath.Base("/C:/Users/itsaaz/Downloads/clipboard-image (14).png"))
_, errFile3 = io.Copy(part3, file)
if errFile3 != nil {
fmt.Println(errFile3)
return
}
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "text/plain")
req.Header.Add("Authorization", "Bearer YOUR-TOKEN")
req.Header.Add("Content-Type", "multipart/form-data")
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /EKyc/birthCertificate HTTP/1.1
Host: api.itsaaz.ir
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Length: 468
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="OrderId"
9162da96-a4e3-4a67-86b6-814d03a11cde
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="FirstPage"; filename="شناسنامه (6).jpeg"
Content-Type: image/jpeg
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="SecondPage"; filename="clipboard-image (14).png"
Content-Type: image/png
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("multipart/form-data");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("OrderId","9162da96-a4e3-4a67-86b6-814d03a11cde")
.addFormDataPart("FirstPage","شناسنامه (6).jpeg",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg")))
.addFormDataPart("SecondPage","clipboard-image (14).png",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/C:/Users/itsaaz/Downloads/clipboard-image (14).png")))
.build();
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/EKyc/birthCertificate")
.method("POST", body)
.addHeader("accept", "text/plain")
.addHeader("Authorization", "Bearer YOUR-TOKEN")
.addHeader("Content-Type", "multipart/form-data")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/EKyc/birthCertificate")
.header("accept", "text/plain")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "multipart/form-data")
.field("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde")
.field("file", new File("/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg"))
.field("file", new File("/C:/Users/itsaaz/Downloads/clipboard-image (14).png"))
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "text/plain");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "multipart/form-data");
var formdata = new FormData();
formdata.append("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde");
formdata.append("FirstPage", fileInput.files[0], "شناسنامه (6).jpeg");
formdata.append("SecondPage", fileInput.files[0], "clipboard-image (14).png");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/EKyc/birthCertificate", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var form = new FormData();
form.append("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde");
form.append("FirstPage", fileInput.files[0], "شناسنامه (6).jpeg");
form.append("SecondPage", fileInput.files[0], "clipboard-image (14).png");
var settings = {
"url": "https://api.itsaaz.ir/EKyc/birthCertificate",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "text/plain",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "multipart/form-data"
},
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = new FormData();
data.append("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde");
data.append("FirstPage", fileInput.files[0], "شناسنامه (6).jpeg");
data.append("SecondPage", fileInput.files[0], "clipboard-image (14).png");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/EKyc/birthCertificate");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("Authorization", "Bearer YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "multipart/form-data");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/EKyc/birthCertificate");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: text/plain");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: multipart/form-data");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_mime *mime;
curl_mimepart *part;
mime = curl_mime_init(curl);
part = curl_mime_addpart(mime);
curl_mime_name(part, "OrderId");
curl_mime_data(part, "9162da96-a4e3-4a67-86b6-814d03a11cde", CURL_ZERO_TERMINATED);
part = curl_mime_addpart(mime);
curl_mime_name(part, "FirstPage");
curl_mime_filedata(part, "/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg");
part = curl_mime_addpart(mime);
curl_mime_name(part, "SecondPage");
curl_mime_filedata(part, "/C:/Users/itsaaz/Downloads/clipboard-image (14).png");
curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
res = curl_easy_perform(curl);
curl_mime_free(mime);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('OrderId', '9162da96-a4e3-4a67-86b6-814d03a11cde');
data.append('FirstPage', fs.createReadStream('/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg'));
data.append('SecondPage', fs.createReadStream('/C:/Users/itsaaz/Downloads/clipboard-image (14).png'));
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/EKyc/birthCertificate',
headers: {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data',
...data.getHeaders()
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/EKyc/birthCertificate',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"OrderId\"\r\n\r\n9162da96-a4e3-4a67-86b6-814d03a11cde\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"FirstPage\"; filename=\"شناسنامه (6).jpeg\"\r\nContent-Type: \"{Insert_File_Content_Type}\"\r\n\r\n" + fs.readFileSync('/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg') + "\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"SecondPage\"; filename=\"clipboard-image (14).png\"\r\nContent-Type: \"{Insert_File_Content_Type}\"\r\n\r\n" + fs.readFileSync('/C:/Users/itsaaz/Downloads/clipboard-image (14).png') + "\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--";
req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
req.write(postData);
req.end();
var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/EKyc/birthCertificate',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
},
formData: {
'OrderId': '9162da96-a4e3-4a67-86b6-814d03a11cde',
'FirstPage': [
fs.createReadStream('/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg')
],
'SecondPage': [
fs.createReadStream('/C:/Users/itsaaz/Downloads/clipboard-image (14).png')
]
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/EKyc/birthCertificate')
.headers({
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
})
.field('OrderId', '9162da96-a4e3-4a67-86b6-814d03a11cde')
.attach('file', '/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg')
.attach('file', '/C:/Users/itsaaz/Downloads/clipboard-image (14).png')
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/EKyc/birthCertificate"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"text/plain",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"multipart/form-data"
};
[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
@{ @"name": @"OrderId", @"value": @"9162da96-a4e3-4a67-86b6-814d03a11cde" },
@{ @"name": @"FirstPage", @"fileName": @"/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg" },
@{ @"name": @"SecondPage", @"fileName": @"/C:/Users/itsaaz/Downloads/clipboard-image (14).png" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
[body appendFormat:@"--%@\r\n", boundary];
if (param[@"fileName"]) {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
if (error) {
NSLog(@"%@", error);
}
} else {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
[body appendFormat:@"%@", param[@"value"]];
}
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let parameters = [|
[| ("name", "OrderId"); ("value", "9162da96-a4e3-4a67-86b6-814d03a11cde") |];
[| ("name", "FirstPage"); ("fileName", "/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg") |];
[| ("name", "SecondPage"); ("fileName", "/C:/Users/itsaaz/Downloads/clipboard-image (14).png") |]
|];;
let boundary = "----WebKitFormBoundary7MA4YWxkTrZu0gW";;
let postData = ref "";;
for x = 0 to Array.length parameters - 1 do
let (_, paramName) = parameters.(x).(0) in
let (paramType, _) = parameters.(x).(1) in
let accum = "--" ^ boundary ^ "\r\n" ^ "Content-Disposition: form-data; name=\"" ^ paramName ^ "\"" in
if paramType = "value" then (
let (_, paramValue) = parameters.(x).(1) in
postData := if Array.length parameters.(x) == 3 then (
let (_, contentType) = parameters.(x).(2) in
!postData ^ accum ^ "\r\n" ^ "Content-Type: " ^ contentType ^ "\r\n\r\n" ^ paramValue ^ "\r\n"
) else (
!postData ^ accum ^ "\r\n\r\n" ^ paramValue ^ "\r\n"
);
)
else if paramType = "fileName" then (
let (_, filepath) = parameters.(x).(1) in
postData := !postData ^ accum ^ "; filename=\""^ filepath ^"\"\r\n";
let ch = open_in filepath in
let fileContent = really_input_string ch (in_channel_length ch) in
close_in ch;
postData := !postData ^ "Content-Type: {content-type header}\r\n\r\n"^ fileContent ^"\r\n";
)
done;;
postData := !postData ^ "--" ^ boundary ^ "--"
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/EKyc/birthCertificate" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "text/plain"
|> fun h -> Header.add h "Authorization" "Bearer YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "multipart/form-data"
|> fun h -> Header.add h "content-type" "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/EKyc/birthCertificate',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('OrderId' => '9162da96-a4e3-4a67-86b6-814d03a11cde','FirstPage'=> new CURLFILE('/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg'),'SecondPage'=> new CURLFILE('/C:/Users/itsaaz/Downloads/clipboard-image (14).png')),
CURLOPT_HTTPHEADER => array(
'accept: text/plain',
'Authorization: Bearer YOUR-TOKEN',
'Content-Type: multipart/form-data'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/EKyc/birthCertificate');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'multipart/form-data'
));
$request->addPostParameter(array(
'OrderId' => '9162da96-a4e3-4a67-86b6-814d03a11cde'
));
$request->addUpload('FirstPage', '/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg', 'شناسنامه (6).jpeg', '<Content-Type Header>');
$request->addUpload('SecondPage', '/C:/Users/itsaaz/Downloads/clipboard-image (14).png', 'clipboard-image (14).png', '<Content-Type Header>');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/EKyc/birthCertificate');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->addForm(array(
'OrderId' => '9162da96-a4e3-4a67-86b6-814d03a11cde'
), array(
array('name' => 'FirstPage', 'type' => '<Content-Type Header>', 'file' => '/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg', 'data' => null),
array('name' => 'SecondPage', 'type' => '<Content-Type Header>', 'file' => '/C:/Users/itsaaz/Downloads/clipboard-image (14).png', 'data' => null)
));
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'multipart/form-data'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", "text/plain")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "multipart/form-data")
$multipartContent = [System.Net.Http.MultipartFormDataContent]::new()
$stringHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$stringHeader.Name = "OrderId"
$stringContent = [System.Net.Http.StringContent]::new("9162da96-a4e3-4a67-86b6-814d03a11cde")
$stringContent.Headers.ContentDisposition = $stringHeader
$multipartContent.Add($stringContent)
$multipartFile = '/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg'
$FileStream = [System.IO.FileStream]::new($multipartFile, [System.IO.FileMode]::Open)
$fileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$fileHeader.Name = "FirstPage"
$fileHeader.FileName = "شناسنامه (6).jpeg"
$fileContent = [System.Net.Http.StreamContent]::new($FileStream)
$fileContent.Headers.ContentDisposition = $fileHeader
$multipartContent.Add($fileContent)
$multipartFile = '/C:/Users/itsaaz/Downloads/clipboard-image (14).png'
$FileStream = [System.IO.FileStream]::new($multipartFile, [System.IO.FileMode]::Open)
$fileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$fileHeader.Name = "SecondPage"
$fileHeader.FileName = "clipboard-image (14).png"
$fileContent = [System.Net.Http.StreamContent]::new($FileStream)
$fileContent.Headers.ContentDisposition = $fileHeader
$multipartContent.Add($fileContent)
$body = $multipartContent
$response = Invoke-RestMethod 'https://api.itsaaz.ir/EKyc/birthCertificate' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import mimetypes
from codecs import encode
conn = http.client.HTTPSConnection("api.itsaaz.ir")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=OrderId;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("9162da96-a4e3-4a67-86b6-814d03a11cde"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=FirstPage; filename={0}'.format('شناسنامه (6).jpeg')))
fileType = mimetypes.guess_type('/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg')[0] or 'application/octet-stream'
dataList.append(encode('Content-Type: {}'.format(fileType)))
dataList.append(encode(''))
with open('/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg', 'rb') as f:
dataList.append(f.read())
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=SecondPage; filename={0}'.format('clipboard-image (14).png')))
fileType = mimetypes.guess_type('/C:/Users/itsaaz/Downloads/clipboard-image (14).png')[0] or 'application/octet-stream'
dataList.append(encode('Content-Type: {}'.format(fileType)))
dataList.append(encode(''))
with open('/C:/Users/itsaaz/Downloads/clipboard-image (14).png', 'rb') as f:
dataList.append(f.read())
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/EKyc/birthCertificate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "https://api.itsaaz.ir/EKyc/birthCertificate"
payload={'OrderId': '9162da96-a4e3-4a67-86b6-814d03a11cde'}
files=[
('FirstPage',('شناسنامه (6).jpeg',open('/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg','rb'),'image/jpeg')),
('SecondPage',('clipboard-image (14).png',open('/C:/Users/itsaaz/Downloads/clipboard-image (14).png','rb'),'image/png'))
]
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
require "uri"
require "net/http"
url = URI("https://api.itsaaz.ir/EKyc/birthCertificate")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "text/plain"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "multipart/form-data"
form_data = [['OrderId', '9162da96-a4e3-4a67-86b6-814d03a11cde'],['FirstPage', File.open('/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg')],['SecondPage', File.open('/C:/Users/itsaaz/Downloads/clipboard-image (14).png')]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
http --ignore-stdin --form --follow --timeout 3600 POST 'https://api.itsaaz.ir/EKyc/birthCertificate' \
'OrderId'='9162da96-a4e3-4a67-86b6-814d03a11cde' \
'FirstPage'@/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg \
'SecondPage'@/C:/Users/itsaaz/Downloads/clipboard-image (14).png \
accept:'text/plain' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'multipart/form-data'
# wget doesn't support file upload via form data, use curl -F \
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: multipart/form-data' \
--body-data 'OrderId=9162da96-a4e3-4a67-86b6-814d03a11cde' \
'https://api.itsaaz.ir/EKyc/birthCertificate'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = [
[
"key": "OrderId",
"value": "9162da96-a4e3-4a67-86b6-814d03a11cde",
"type": "text"
],
[
"key": "FirstPage",
"src": "/C:/Users/itsaaz/Downloads/شناسنامه (6).jpeg",
"type": "file"
],
[
"key": "SecondPage",
"src": "/C:/Users/itsaaz/Downloads/clipboard-image (14).png",
"type": "file"
]] as [[String : Any]]
let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
if param["disabled"] == nil {
let paramName = param["key"]!
body += "--\(boundary)\r\n"
body += "Content-Disposition:form-data; name=\"\(paramName)\""
if param["contentType"] != nil {
body += "\r\nContent-Type: \(param["contentType"] as! String)"
}
let paramType = param["type"] as! String
if paramType == "text" {
let paramValue = param["value"] as! String
body += "\r\n\r\n\(paramValue)\r\n"
} else {
let paramSrc = param["src"] as! String
let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
let fileContent = String(data: fileData, encoding: .utf8)!
body += "; filename=\"\(paramSrc)\"\r\n"
+ "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
}
}
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/EKyc/birthCertificate")!,timeoutInterval: Double.infinity)
request.addValue("text/plain", forHTTPHeaderField: "accept")
request.addValue("Bearer YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("multipart/form-data", forHTTPHeaderField: "Content-Type")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
سرویس دریافت عکس و ویدیو جهت احراز هویت مخاطب:
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
2-جهت تشخیص زنده بودن کاربر عکس و ویدیو دریافت خواهد شد،توجه داشته باشید که در ویدیو دریافتی از کاربر حتما باید چرخش سر از سمت راست به چپ و یا برعکس انجام شود. (لطفا کاربر را جهت انجام اینکار راهنمایی بفرمایید)
https://api.itsaaz.ir/ekyc/personal/picture
Post
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: multipart/form-data
OrderId="9162da96-a4e3-4a67-86b6-814d03a11cde"
SelfPhoto=@"whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"
SelfVideo=@"iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"
{
"data": true,
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | orderId | String | شماره درخواست |
2 | SelfPhoto | file | تصویر دریافتی از مخاطب |
3 | SelfVideo | file | ویدیو دریافتی از مخاطب |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/ekyc/personal/picture");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "text/plain");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "multipart/form-data");
request.AddParameter("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde");
request.AddFile("SelfPhoto", "whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
request.AddFile("SelfVideo", "iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/ekyc/personal/picture' \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: multipart/form-data' \
--form 'OrderId="9162da96-a4e3-4a67-86b6-814d03a11cde"' \
--form 'SelfPhoto=@"whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"' \
--form 'SelfVideo=@"iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"'
var headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.itsaaz.ir/ekyc/personal/picture'));
request.fields.addAll({
'OrderId': '9162da96-a4e3-4a67-86b6-814d03a11cde'
});
request.files.add(await http.MultipartFile.fromPath('SelfPhoto', 'whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg'));
request.files.add(await http.MultipartFile.fromPath('SelfVideo', 'iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"bytes"
"mime/multipart"
"os"
"path/filepath"
"io"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/ekyc/personal/picture"
method := "POST"
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde")
file, errFile2 := os.Open("whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg")
defer file.Close()
part2,
errFile2 := writer.CreateFormFile("SelfPhoto",filepath.Base("whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"))
_, errFile2 = io.Copy(part2, file)
if errFile2 != nil {
fmt.Println(errFile2)
return
}
file, errFile3 := os.Open("iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg")
defer file.Close()
part3,
errFile3 := writer.CreateFormFile("SelfVideo",filepath.Base("iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"))
_, errFile3 = io.Copy(part3, file)
if errFile3 != nil {
fmt.Println(errFile3)
return
}
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "text/plain")
req.Header.Add("Authorization", "Bearer YOUR-TOKEN")
req.Header.Add("Content-Type", "multipart/form-data")
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /ekyc/personal/picture HTTP/1.1
Host: api.itsaaz.ir
accept: text/plain
Authorization: Bearer YOUR-TOKEN
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Length: 551
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="OrderId"
9162da96-a4e3-4a67-86b6-814d03a11cde
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="SelfPhoto"; filename="WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"
Content-Type: <Content-Type header here>
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="SelfVideo"; filename="WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"
Content-Type: <Content-Type header here>
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("multipart/form-data");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("OrderId","9162da96-a4e3-4a67-86b6-814d03a11cde")
.addFormDataPart("SelfPhoto","WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg")))
.addFormDataPart("SelfVideo","WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg")))
.build();
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/ekyc/personal/picture")
.method("POST", body)
.addHeader("accept", "text/plain")
.addHeader("Authorization", "Bearer YOUR-TOKEN")
.addHeader("Content-Type", "multipart/form-data")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/ekyc/personal/picture")
.header("accept", "text/plain")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "multipart/form-data")
.field("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde")
.field("file", new File("whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"))
.field("file", new File("iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"))
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "text/plain");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "multipart/form-data");
var formdata = new FormData();
formdata.append("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde");
formdata.append("SelfPhoto", fileInput.files[0], "WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
formdata.append("SelfVideo", fileInput.files[0], "WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/ekyc/personal/picture", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var form = new FormData();
form.append("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde");
form.append("SelfPhoto", fileInput.files[0], "WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
form.append("SelfVideo", fileInput.files[0], "WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
var settings = {
"url": "https://api.itsaaz.ir/ekyc/personal/picture",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "text/plain",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "multipart/form-data"
},
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = new FormData();
data.append("OrderId", "9162da96-a4e3-4a67-86b6-814d03a11cde");
data.append("SelfPhoto", fileInput.files[0], "WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
data.append("SelfVideo", fileInput.files[0], "WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/ekyc/personal/picture");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("Authorization", "Bearer YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "multipart/form-data");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/ekyc/personal/picture");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: text/plain");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: multipart/form-data");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_mime *mime;
curl_mimepart *part;
mime = curl_mime_init(curl);
part = curl_mime_addpart(mime);
curl_mime_name(part, "OrderId");
curl_mime_data(part, "9162da96-a4e3-4a67-86b6-814d03a11cde", CURL_ZERO_TERMINATED);
part = curl_mime_addpart(mime);
curl_mime_name(part, "SelfPhoto");
curl_mime_filedata(part, "whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
part = curl_mime_addpart(mime);
curl_mime_name(part, "SelfVideo");
curl_mime_filedata(part, "iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg");
curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
res = curl_easy_perform(curl);
curl_mime_free(mime);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('OrderId', '9162da96-a4e3-4a67-86b6-814d03a11cde');
data.append('SelfPhoto', fs.createReadStream('whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg'));
data.append('SelfVideo', fs.createReadStream('iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg'));
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/ekyc/personal/picture',
headers: {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data',
...data.getHeaders()
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/ekyc/personal/picture',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"OrderId\"\r\n\r\n9162da96-a4e3-4a67-86b6-814d03a11cde\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"SelfPhoto\"; filename=\"WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg\"\r\nContent-Type: \"{Insert_File_Content_Type}\"\r\n\r\n" + fs.readFileSync('whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg') + "\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"SelfVideo\"; filename=\"WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg\"\r\nContent-Type: \"{Insert_File_Content_Type}\"\r\n\r\n" + fs.readFileSync('iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg') + "\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--";
req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
req.write(postData);
req.end();
var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/ekyc/personal/picture',
'headers': {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
},
formData: {
'OrderId': '9162da96-a4e3-4a67-86b6-814d03a11cde',
'SelfPhoto': [
fs.createReadStream('whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')
],
'SelfVideo': [
fs.createReadStream('iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')
]
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/ekyc/personal/picture')
.headers({
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
})
.field('OrderId', '9162da96-a4e3-4a67-86b6-814d03a11cde')
.attach('file', 'whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')
.attach('file', 'iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/ekyc/personal/picture"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"text/plain",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"multipart/form-data"
};
[request setAllHTTPHeaderFields:headers];
NSArray *parameters = @[
@{ @"name": @"OrderId", @"value": @"9162da96-a4e3-4a67-86b6-814d03a11cde" },
@{ @"name": @"SelfPhoto", @"fileName": @"whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg" },
@{ @"name": @"SelfVideo", @"fileName": @"iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg" }
];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
[body appendFormat:@"--%@\r\n", boundary];
if (param[@"fileName"]) {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
if (error) {
NSLog(@"%@", error);
}
} else {
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
[body appendFormat:@"%@", param[@"value"]];
}
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let parameters = [|
[| ("name", "OrderId"); ("value", "9162da96-a4e3-4a67-86b6-814d03a11cde") |];
[| ("name", "SelfPhoto"); ("fileName", "whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg") |];
[| ("name", "SelfVideo"); ("fileName", "iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg") |]
|];;
let boundary = "----WebKitFormBoundary7MA4YWxkTrZu0gW";;
let postData = ref "";;
for x = 0 to Array.length parameters - 1 do
let (_, paramName) = parameters.(x).(0) in
let (paramType, _) = parameters.(x).(1) in
let accum = "--" ^ boundary ^ "\r\n" ^ "Content-Disposition: form-data; name=\"" ^ paramName ^ "\"" in
if paramType = "value" then (
let (_, paramValue) = parameters.(x).(1) in
postData := if Array.length parameters.(x) == 3 then (
let (_, contentType) = parameters.(x).(2) in
!postData ^ accum ^ "\r\n" ^ "Content-Type: " ^ contentType ^ "\r\n\r\n" ^ paramValue ^ "\r\n"
) else (
!postData ^ accum ^ "\r\n\r\n" ^ paramValue ^ "\r\n"
);
)
else if paramType = "fileName" then (
let (_, filepath) = parameters.(x).(1) in
postData := !postData ^ accum ^ "; filename=\""^ filepath ^"\"\r\n";
let ch = open_in filepath in
let fileContent = really_input_string ch (in_channel_length ch) in
close_in ch;
postData := !postData ^ "Content-Type: {content-type header}\r\n\r\n"^ fileContent ^"\r\n";
)
done;;
postData := !postData ^ "--" ^ boundary ^ "--"
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/ekyc/personal/picture" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "text/plain"
|> fun h -> Header.add h "Authorization" "Bearer YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "multipart/form-data"
|> fun h -> Header.add h "content-type" "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/ekyc/personal/picture',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('OrderId' => '9162da96-a4e3-4a67-86b6-814d03a11cde','SelfPhoto'=> new CURLFILE('whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg'),'SelfVideo'=> new CURLFILE('iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')),
CURLOPT_HTTPHEADER => array(
'accept: text/plain',
'Authorization: Bearer YOUR-TOKEN',
'Content-Type: multipart/form-data'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/ekyc/personal/picture');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'multipart/form-data'
));
$request->addPostParameter(array(
'OrderId' => '9162da96-a4e3-4a67-86b6-814d03a11cde'
));
$request->addUpload('SelfPhoto', 'whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg', 'WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg', '<Content-Type Header>');
$request->addUpload('SelfVideo', 'iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg', 'WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg', '<Content-Type Header>');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/ekyc/personal/picture');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->addForm(array(
'OrderId' => '9162da96-a4e3-4a67-86b6-814d03a11cde'
), array(
array('name' => 'SelfPhoto', 'type' => '<Content-Type Header>', 'file' => 'whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg', 'data' => null),
array('name' => 'SelfVideo', 'type' => '<Content-Type Header>', 'file' => 'iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg', 'data' => null)
));
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'text/plain',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'multipart/form-data'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", "text/plain")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "multipart/form-data")
$multipartContent = [System.Net.Http.MultipartFormDataContent]::new()
$stringHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$stringHeader.Name = "OrderId"
$stringContent = [System.Net.Http.StringContent]::new("9162da96-a4e3-4a67-86b6-814d03a11cde")
$stringContent.Headers.ContentDisposition = $stringHeader
$multipartContent.Add($stringContent)
$multipartFile = 'whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg'
$FileStream = [System.IO.FileStream]::new($multipartFile, [System.IO.FileMode]::Open)
$fileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$fileHeader.Name = "SelfPhoto"
$fileHeader.FileName = "WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"
$fileContent = [System.Net.Http.StreamContent]::new($FileStream)
$fileContent.Headers.ContentDisposition = $fileHeader
$multipartContent.Add($fileContent)
$multipartFile = 'iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg'
$FileStream = [System.IO.FileStream]::new($multipartFile, [System.IO.FileMode]::Open)
$fileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$fileHeader.Name = "SelfVideo"
$fileHeader.FileName = "WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg"
$fileContent = [System.Net.Http.StreamContent]::new($FileStream)
$fileContent.Headers.ContentDisposition = $fileHeader
$multipartContent.Add($fileContent)
$body = $multipartContent
$response = Invoke-RestMethod 'https://api.itsaaz.ir/ekyc/personal/picture' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import mimetypes
from codecs import encode
conn = http.client.HTTPSConnection("api.itsaaz.ir")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=OrderId;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("9162da96-a4e3-4a67-86b6-814d03a11cde"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=SelfPhoto; filename={0}'.format('WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')))
fileType = mimetypes.guess_type('whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')[0] or 'application/octet-stream'
dataList.append(encode('Content-Type: {}'.format(fileType)))
dataList.append(encode(''))
with open('whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg', 'rb') as f:
dataList.append(f.read())
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=SelfVideo; filename={0}'.format('WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')))
fileType = mimetypes.guess_type('iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')[0] or 'application/octet-stream'
dataList.append(encode('Content-Type: {}'.format(fileType)))
dataList.append(encode(''))
with open('iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg', 'rb') as f:
dataList.append(f.read())
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/ekyc/personal/picture", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "https://api.itsaaz.ir/ekyc/personal/picture"
payload={'OrderId': '9162da96-a4e3-4a67-86b6-814d03a11cde'}
files=[
('SelfPhoto',('WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg',open('whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg','rb'),'image/jpeg')),
('SelfVideo',('WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg',open('iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg','rb'),'image/jpeg'))
]
headers = {
'accept': 'text/plain',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'multipart/form-data'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
require "uri"
require "net/http"
url = URI("https://api.itsaaz.ir/ekyc/personal/picture")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "text/plain"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "multipart/form-data"
form_data = [['OrderId', '9162da96-a4e3-4a67-86b6-814d03a11cde'],['SelfPhoto', File.open('whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')],['SelfVideo', File.open('iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg')]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
http --ignore-stdin --form --follow --timeout 3600 POST 'https://api.itsaaz.ir/ekyc/personal/picture' \
'OrderId'='9162da96-a4e3-4a67-86b6-814d03a11cde' \
'SelfPhoto'@whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg \
'SelfVideo'@iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg \
accept:'text/plain' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'multipart/form-data'
# wget doesn't support file upload via form data, use curl -F \
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: text/plain' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: multipart/form-data' \
--body-data 'OrderId=9162da96-a4e3-4a67-86b6-814d03a11cde' \
'https://api.itsaaz.ir/ekyc/personal/picture'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = [
[
"key": "OrderId",
"value": "9162da96-a4e3-4a67-86b6-814d03a11cde",
"type": "text"
],
[
"key": "SelfPhoto",
"src": "whpfnMtnj/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg",
"type": "file"
],
[
"key": "SelfVideo",
"src": "iW3jl-jH1/WhatsApp Image 2021-05-12 at 17.56.27 (1).jpeg",
"type": "file"
]] as [[String : Any]]
let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
if param["disabled"] == nil {
let paramName = param["key"]!
body += "--\(boundary)\r\n"
body += "Content-Disposition:form-data; name=\"\(paramName)\""
if param["contentType"] != nil {
body += "\r\nContent-Type: \(param["contentType"] as! String)"
}
let paramType = param["type"] as! String
if paramType == "text" {
let paramValue = param["value"] as! String
body += "\r\n\r\n\(paramValue)\r\n"
} else {
let paramSrc = param["src"] as! String
let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
let fileContent = String(data: fileData, encoding: .utf8)!
body += "; filename=\"\(paramSrc)\"\r\n"
+ "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
}
}
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/ekyc/personal/picture")!,timeoutInterval: Double.infinity)
request.addValue("text/plain", forHTTPHeaderField: "accept")
request.addValue("Bearer YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("multipart/form-data", forHTTPHeaderField: "Content-Type")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
سرویس دریافت پروفایل کاربر:
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
2-در این سرویس شما می توانید اطلاعات پروفایل کابر را توسط orderid دریافت نمایید.
https://api.itsaaz.ir/ekyc/personprofile
Post
ClientId: yekpay
Authorization: Basic YOUR-TOKEN
Content-Type: application/json
{
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}
{
"data": {
"orderId": "شماره درخواست",
"status": "وضعیت",
"firstName": "نام",
"lastName": "نام خانوادگی",
"birthDate": "تاریخ تولد",
"fatherName": "نام پدر",
"nationalCode": "کدملی",
"mobile": "شماره همراه",
"serialNationalCard": "شماره کارت ملی",
"nationalCardExpirationDate": "تاریخ انقضای کارت ملی",
"nationalCardFrontImage": "عکس روی کارت ملی",
"nationalCardBackImage": "عکس پشت کارت ملی",
"ncPersonPhoto": "عکس ثبت احوالی فرد",
"signature": "امضا",
"gender": "جنسیت",
"identityId": شماره شناسایی,
"isDead": در قید حیات نیست,
"certifFirstPageImage": "عکس صفحه اول شناسنامه",
"certifSecondPageImage": "عکس صفحه دوم شناسنامه",
"personSelfPhoto": " عکس شخص"
},
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | orderId | String | شماره درخواست |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/ekyc/personprofile");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("ClientId", "yekpay");
request.AddHeader("Authorization", "Basic YOUR-TOKEN");
request.AddHeader("Content-Type", "application/json");
var body = @"{" + "\n" +
@" ""orderId"": ""7857c653-9632-48d6-aa92-b74a7f281a1d""" + "\n" +
@"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/ekyc/personprofile' \
--header 'ClientId: yekpay' \
--header 'Authorization: Basic YOUR-TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}'
var headers = {
'ClientId': 'yekpay',
'Authorization': 'Basic YOUR-TOKEN',
'Content-Type': 'application/json'
};
var request = http.Request('POST', Uri.parse('https://api.itsaaz.ir/ekyc/personprofile'));
request.body = json.encode({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.itsaaz.ir/ekyc/personprofile"
method := "POST"
payload := strings.NewReader(`{
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("ClientId", "yekpay")
req.Header.Add("Authorization", "Basic YOUR-TOKEN")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /ekyc/personprofile HTTP/1.1
Host: api.itsaaz.ir
ClientId: yekpay
Authorization: Basic YOUR-TOKEN
Content-Type: application/json
Content-Length: 57
{
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"orderId\": \"7857c653-9632-48d6-aa92-b74a7f281a1d\"\n}");
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/ekyc/personprofile")
.method("POST", body)
.addHeader("ClientId", "yekpay")
.addHeader("Authorization", "Basic YOUR-TOKEN")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/ekyc/personprofile")
.header("ClientId", "yekpay")
.header("Authorization", "Basic YOUR-TOKEN")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"7857c653-9632-48d6-aa92-b74a7f281a1d\"\n}")
.asString();
var myHeaders = new Headers();
myHeaders.append("ClientId", "yekpay");
myHeaders.append("Authorization", "Basic YOUR-TOKEN");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/ekyc/personprofile", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var settings = {
"url": "https://api.itsaaz.ir/ekyc/personprofile",
"method": "POST",
"timeout": 0,
"headers": {
"ClientId": "yekpay",
"Authorization": "Basic YOUR-TOKEN",
"Content-Type": "application/json"
},
"data": JSON.stringify({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = JSON.stringify({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.itsaaz.ir/ekyc/personprofile");
xhr.setRequestHeader("ClientId", "yekpay");
xhr.setRequestHeader("Authorization", "Basic YOUR-TOKEN");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.itsaaz.ir/ekyc/personprofile");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "ClientId: yekpay");
headers = curl_slist_append(headers, "Authorization: Basic YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\n \"orderId\": \"7857c653-9632-48d6-aa92-b74a7f281a1d\"\n}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var data = JSON.stringify({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
});
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/ekyc/personprofile',
headers: {
'ClientId': 'yekpay',
'Authorization': 'Basic YOUR-TOKEN',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/ekyc/personprofile',
'headers': {
'ClientId': 'yekpay',
'Authorization': 'Basic YOUR-TOKEN',
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
});
req.write(postData);
req.end();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/ekyc/personprofile',
'headers': {
'ClientId': 'yekpay',
'Authorization': 'Basic YOUR-TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.itsaaz.ir/ekyc/personprofile')
.headers({
'ClientId': 'yekpay',
'Authorization': 'Basic YOUR-TOKEN',
'Content-Type': 'application/json'
})
.send(JSON.stringify({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.itsaaz.ir/ekyc/personprofile"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"ClientId": @"yekpay",
@"Authorization": @"Basic YOUR-TOKEN",
@"Content-Type": @"application/json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\n \"orderId\": \"7857c653-9632-48d6-aa92-b74a7f281a1d\"\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref "{\n \"orderId\": \"7857c653-9632-48d6-aa92-b74a7f281a1d\"\n}";;
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/ekyc/personprofile" in
let headers = Header.init ()
|> fun h -> Header.add h "ClientId" "yekpay"
|> fun h -> Header.add h "Authorization" "Basic YOUR-TOKEN"
|> fun h -> Header.add h "Content-Type" "application/json"
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.itsaaz.ir/ekyc/personprofile',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}',
CURLOPT_HTTPHEADER => array(
'ClientId: yekpay',
'Authorization: Basic YOUR-TOKEN',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.itsaaz.ir/ekyc/personprofile');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'ClientId' => 'yekpay',
'Authorization' => 'Basic YOUR-TOKEN',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.itsaaz.ir/ekyc/personprofile');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'ClientId' => 'yekpay',
'Authorization' => 'Basic YOUR-TOKEN',
'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("ClientId", "yekpay")
$headers.Add("Authorization", "Basic YOUR-TOKEN")
$headers.Add("Content-Type", "application/json")
$body = "{`n `"orderId`": `"7857c653-9632-48d6-aa92-b74a7f281a1d`"`n}"
$response = Invoke-RestMethod 'https://api.itsaaz.ir/ekyc/personprofile' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import json
conn = http.client.HTTPSConnection("api.itsaaz.ir")
payload = json.dumps({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
})
headers = {
'ClientId': 'yekpay',
'Authorization': 'Basic YOUR-TOKEN',
'Content-Type': 'application/json'
}
conn.request("POST", "/ekyc/personprofile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
import json
url = "https://api.itsaaz.ir/ekyc/personprofile"
payload = json.dumps({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
})
headers = {
'ClientId': 'yekpay',
'Authorization': 'Basic YOUR-TOKEN',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "json"
require "net/http"
url = URI("https://api.itsaaz.ir/ekyc/personprofile")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ClientId"] = "yekpay"
request["Authorization"] = "Basic YOUR-TOKEN"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
})
response = https.request(request)
puts response.read_body
printf '{
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}'| http --follow --timeout 3600 POST 'https://api.itsaaz.ir/ekyc/personprofile' \
ClientId:'yekpay' \
Authorization:'Basic YOUR-TOKEN' \
Content-Type:'application/json'
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'ClientId: yekpay' \
--header 'Authorization: Basic YOUR-TOKEN' \
--header 'Content-Type: application/json' \
--body-data '{
"orderId": "7857c653-9632-48d6-aa92-b74a7f281a1d"
}' \
'https://api.itsaaz.ir/ekyc/personprofile'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\n \"orderId\": \"7857c653-9632-48d6-aa92-b74a7f281a1d\"\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/ekyc/personprofile")!,timeoutInterval: Double.infinity)
request.addValue("yekpay", forHTTPHeaderField: "ClientId")
request.addValue("Basic YOUR-TOKEN", forHTTPHeaderField: "Authorization")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()