سرویس دریافت توکن
برای فراخوانی این سرویس مراحل زیر را طی کنید:
۱-متد فراخوانی سرویس POST می باشد.
https://api.itsaaz.ir/identity/token
Post
Content-Type: application/x-www-form-urlencoded
grant_type= "password"
client_id= "ekyc"
Client_secret= "f63026a9-912d-8978-ac80-4ae5d63db1ac"
username= "test"
password= "t_86574213@T"
{
"access_token": "توکن",
"expires_in": مدت استفاده,
"token_type": "نوع توکن",
"refresh_token": "رفرش توکن",
"scope": "محدوده"
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | Grant_type | String | |
2 | Client_id | String | |
3 | Client_secret | String | |
4 | username | String | |
4 | password | String |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/identity/token");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("grant_type", "password");
request.AddParameter("client_id", "test");
request.AddParameter("Client_secret", "66c0af3a-ff89-8390-3b07-cf88a25e5f3f");
request.AddParameter("username", "test");
request.AddParameter("password", "t_86574213@H");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.itsaaz.ir/identity/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_id=test' \
--data-urlencode 'Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f' \
--data-urlencode 'username=test' \
--data-urlencode 'password=t_86574213@H'
var headers = {
'Content-Type': 'application/x-www-form-urlencoded'
};
var request = http.Request('POST', Uri.parse('https://api.itsaaz.ir/identity/token'));
request.bodyFields = {
'grant_type': 'password',
'client_id': 'test',
'Client_secret': '66c0af3a-ff89-8390-3b07-cf88a25e5f3f',
'username': 'test',
'password': 't_86574213@H'
};
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/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 /identity/token HTTP/1.1
Host: api.itsaaz.ir
Content-Type: application/x-www-form-urlencoded
Content-Length: 123
grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213@H");
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/identity/token")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.itsaaz.ir/identity/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.field("grant_type", "password")
.field("client_id", "test")
.field("Client_secret", "66c0af3a-ff89-8390-3b07-cf88a25e5f3f")
.field("username", "test")
.field("password", "t_86574213@H")
.asString();
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
var urlencoded = new URLSearchParams();
urlencoded.append("grant_type", "password");
urlencoded.append("client_id", "test");
urlencoded.append("Client_secret", "66c0af3a-ff89-8390-3b07-cf88a25e5f3f");
urlencoded.append("username", "test");
urlencoded.append("password", "t_86574213@H");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/identity/token", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var settings = {
"url": "https://api.itsaaz.ir/identity/token",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"data": {
"grant_type": "password",
"client_id": "test",
"Client_secret": "66c0af3a-ff89-8390-3b07-cf88a25e5f3f",
"username": "test",
"password": "t_86574213@H"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = "grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H";
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/identity/token");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
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/identity/token");
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, "Content-Type: application/x-www-form-urlencoded");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'grant_type': 'password',
'client_id': 'test',
'Client_secret': '66c0af3a-ff89-8390-3b07-cf88a25e5f3f',
'username': 'test',
'password': 't_86574213@H'
});
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/identity/token',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
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 qs = require('querystring');
var options = {
'method': 'POST',
'hostname': 'api.itsaaz.ir',
'path': '/identity/token',
'headers': {
'Content-Type': 'application/x-www-form-urlencoded'
},
'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 = qs.stringify({
'grant_type': 'password',
'client_id': 'test',
'Client_secret': '66c0af3a-ff89-8390-3b07-cf88a25e5f3f',
'username': 'test',
'password': 't_86574213@H'
});
req.write(postData);
req.end();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/identity/token',
'headers': {
'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
'grant_type': 'password',
'client_id': 'test',
'Client_secret': '66c0af3a-ff89-8390-3b07-cf88a25e5f3f',
'username': 'test',
'password': 't_86574213@H'
}
};
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/identity/token')
.headers({
'Content-Type': 'application/x-www-form-urlencoded'
})
.send('grant_type=password')
.send('client_id=test')
.send('Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f')
.send('username=test')
.send('password=t_86574213@H')
.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/identity/token"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Content-Type": @"application/x-www-form-urlencoded"
};
[request setAllHTTPHeaderFields:headers];
NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"grant_type=password" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&client_id=test" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&username=test" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&password=t_86574213@H" 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 "grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H";;
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/identity/token" in
let headers = Header.init ()
|> fun h -> Header.add h "Content-Type" "application/x-www-form-urlencoded"
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/identity/token',
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 => 'grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/x-www-form-urlencoded'
),
));
$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/identity/token');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/x-www-form-urlencoded'
));
$request->addPostParameter(array(
'grant_type' => 'password',
'client_id' => 'test',
'Client_secret' => '66c0af3a-ff89-8390-3b07-cf88a25e5f3f',
'username' => 'test',
'password' => 't_86574213@H'
));
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/identity/token');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append(new http\QueryString(array(
'grant_type' => 'password',
'client_id' => 'test',
'Client_secret' => '66c0af3a-ff89-8390-3b07-cf88a25e5f3f',
'username' => 'test',
'password' => 't_86574213@H')));$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Content-Type' => 'application/x-www-form-urlencoded'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/x-www-form-urlencoded")
$body = "grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H"
$response = Invoke-RestMethod 'https://api.itsaaz.ir/identity/token' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
conn = http.client.HTTPSConnection("api.itsaaz.ir")
payload = 'grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/identity/token", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "https://api.itsaaz.ir/identity/token"
payload='grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "net/http"
url = URI("https://api.itsaaz.ir/identity/token")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request.body = "grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H"
response = https.request(request)
puts response.read_body
http --ignore-stdin --form --follow --timeout 3600 POST 'https://api.itsaaz.ir/identity/token' \
'grant_type'='password' \
'client_id'='test' \
'Client_secret'='66c0af3a-ff89-8390-3b07-cf88a25e5f3f' \
'username'='test' \
'password'='t_86574213@H' \
Content-Type:'application/x-www-form-urlencoded'
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'Content-Type: application/x-www-form-urlencoded' \
--body-data 'grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H' \
'https://api.itsaaz.ir/identity/token'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "grant_type=password&client_id=test&Client_secret=66c0af3a-ff89-8390-3b07-cf88a25e5f3f&username=test&password=t_86574213%40H"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/identity/token")!,timeoutInterval: Double.infinity)
request.addValue("application/x-www-form-urlencoded", 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/ai/CompanyInquiry
Post
accept: application/json
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json
{
"nationalId": ""
}
{
"data": {
"nationalId": "شماره ملی",
"companyTitle": "نام شرکت",
"companyRegistrationId": "شماره ثبت شده شرکت",
"establishmentDate": "تاریخ تاسیس",
"address": "آدرس",
"zipcode":"کد پستی",
"companyType": "نوع شرکت",
"status": "وضعیت",
"extraDescription": "توضیحات",
"companyRelatedPeople": [
{
"firstName": "نام",
"lastName": "نام خانوادگی",
"nationalCode": "شماره ملی",
"nationality": "ملیت",
"personType": "نوع",
"officePosition": "موقعیت اداری"
},
{
"firstName": "نام",
"lastName": "نام خانوادگی",
"nationalCode": "شماره ملی",
"nationality": "ملیت",
"personType": "نوع",
"officePosition": "موقعیت اداری"
},
{
"firstName": "نام",
"lastName": "نام خانوادگی",
"nationalCode": "شماره ملی",
"nationality": "ملیت",
"personType": "نوع",
"officePosition": "موقعیت اداری"
},
{
"firstName": "نام",
"lastName": "نام خانوادگی",
"nationalCode": "شماره ملی",
"nationality": "ملیت",
"personType": "نوع",
"officePosition": "موقعیت اداری"
}
]
},
"meta": null,
"error": null
}
پارامترهای ورودی
ردیف | پارامتر ورودی | نوع ورودی | توضیحات |
---|---|---|---|
1 | nationalId | String | شناسه ملی شرکت |
نمونه کد
var client = new RestClient("https://api.itsaaz.ir/ai/CompanyInquiry");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("Authorization", "Bearer YOUR-TOKEN");
request.AddHeader("Content-Type", "application/json");
var body = @"{" + "\n" +
@" ""nationalId"": ""10100830792""," + "\n" +
@"}" + "\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/ai/CompanyInquiry' \
--header 'accept: application/json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"nationalId": "10100830792",
}'
var headers = {
'accept': 'application/json',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json'
};
var request = http.Request('POST', Uri.parse('https://api.itsaaz.ir/ai/CompanyInquiry'));
request.body = '''{\n "nationalId": "10100830792",\n}\n''';
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/ai/CompanyInquiry"
method := "POST"
payload := strings.NewReader(`{
"nationalId": "10100830792",
}
`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "application/json")
req.Header.Add("Authorization", "Bearer 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 /ai/CompanyInquiry HTTP/1.1
Host: api.itsaaz.ir
accept: application/json
Authorization: Bearer YOUR-TOKEN
Content-Type: application/json
Content-Length: 35
{
"nationalId": "10100830792",
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"nationalId\": \"10100830792\",\n}\n");
Request request = new Request.Builder()
.url("https://api.itsaaz.ir/ai/CompanyInquiry")
.method("POST", body)
.addHeader("accept", "application/json")
.addHeader("Authorization", "Bearer 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/ai/CompanyInquiry")
.header("accept", "application/json")
.header("Authorization", "Bearer YOUR-TOKEN")
.header("Content-Type", "application/json")
.body("{\n \"nationalId\": \"10100830792\",\n}\n")
.asString();
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("Authorization", "Bearer YOUR-TOKEN");
myHeaders.append("Content-Type", "application/json");
var raw = "{\n \"nationalId\": \"10100830792\",\n}\n";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.itsaaz.ir/ai/CompanyInquiry", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var settings = {
"url": "https://api.itsaaz.ir/ai/CompanyInquiry",
"method": "POST",
"timeout": 0,
"headers": {
"accept": "application/json",
"Authorization": "Bearer YOUR-TOKEN",
"Content-Type": "application/json"
},
"data": "{\n \"nationalId\": \"10100830792\",\n}\n",
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = "{\n \"nationalId\": \"10100830792\",\n}\n";
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/ai/CompanyInquiry");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("Authorization", "Bearer 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/ai/CompanyInquiry");
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: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR-TOKEN");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\n \"nationalId\": \"10100830792\",\n}\n";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var axios = require('axios');
var data = '{\n "nationalId": "10100830792",\n}\n';
var config = {
method: 'post',
url: 'https://api.itsaaz.ir/ai/CompanyInquiry',
headers: {
'accept': 'application/json',
'Authorization': 'Bearer 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': '/ai/CompanyInquiry',
'headers': {
'accept': 'application/json',
'Authorization': 'Bearer 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 = "{\n \"nationalId\": \"10100830792\",\n}\n";
req.write(postData);
req.end();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.itsaaz.ir/ai/CompanyInquiry',
'headers': {
'accept': 'application/json',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json'
},
body: '{\n "nationalId": "10100830792",\n}\n'
};
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/ai/CompanyInquiry')
.headers({
'accept': 'application/json',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json'
})
.send("{\n \"nationalId\": \"10100830792\",\n}\n")
.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/ai/CompanyInquiry"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"accept": @"application/json",
@"Authorization": @"Bearer YOUR-TOKEN",
@"Content-Type": @"application/json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\n \"nationalId\": \"10100830792\",\n}\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 \"nationalId\": \"10100830792\",\n}\n";;
let reqBody =
let uri = Uri.of_string "https://api.itsaaz.ir/ai/CompanyInquiry" in
let headers = Header.init ()
|> fun h -> Header.add h "accept" "application/json"
|> fun h -> Header.add h "Authorization" "Bearer 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/ai/CompanyInquiry',
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 =>'{
"nationalId": "10100830792",
}
',
CURLOPT_HTTPHEADER => array(
'accept: application/json',
'Authorization: Bearer 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/ai/CompanyInquiry');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'application/json',
'Authorization' => 'Bearer YOUR-TOKEN',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "nationalId": "10100830792",\n}\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/ai/CompanyInquiry');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"nationalId": "10100830792",
}
');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'accept' => 'application/json',
'Authorization' => 'Bearer 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("accept", "application/json")
$headers.Add("Authorization", "Bearer YOUR-TOKEN")
$headers.Add("Content-Type", "application/json")
$body = "{`n `"nationalId`": `"10100830792`",`n}`n"
$response = Invoke-RestMethod 'https://api.itsaaz.ir/ai/CompanyInquiry' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import json
conn = http.client.HTTPSConnection("api.itsaaz.ir")
payload = "{\n \"nationalId\": \"10100830792\",\n}\n"
headers = {
'accept': 'application/json',
'Authorization': 'Bearer YOUR-TOKEN',
'Content-Type': 'application/json'
}
conn.request("POST", "/ai/CompanyInquiry", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
import json
url = "https://api.itsaaz.ir/ai/CompanyInquiry"
payload = "{\n \"nationalId\": \"10100830792\",\n}\n"
headers = {
'accept': 'application/json',
'Authorization': 'Bearer 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/ai/CompanyInquiry")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["Authorization"] = "Bearer YOUR-TOKEN"
request["Content-Type"] = "application/json"
request.body = "{\n \"nationalId\": \"10100830792\",\n}\n"
response = https.request(request)
puts response.read_body
printf '{
"nationalId": "10100830792",
}
'| http --follow --timeout 3600 POST 'https://api.itsaaz.ir/ai/CompanyInquiry' \
accept:'application/json' \
Authorization:'Bearer YOUR-TOKEN' \
Content-Type:'application/json'
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'accept: application/json' \
--header 'Authorization: Bearer YOUR-TOKEN' \
--header 'Content-Type: application/json' \
--body-data '{
"nationalId": "10100830792",
}
' \
'https://api.itsaaz.ir/ai/CompanyInquiry'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\n \"nationalId\": \"10100830792\",\n}\n"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.itsaaz.ir/ai/CompanyInquiry")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "accept")
request.addValue("Bearer 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()