// Входные данные
$url = "https://data.tronk.info/reportrequest.ashx";
$request_params = array(
"key" => "867983b5-d66d-44d7-b440-5bd00b0b8203",
"mode" => "setqueue",
"gosnumber" => "А111АА11"
);
$get_params = http_build_query($request_params);
// Запрос к серверу
$response = file_get_contents($url."?".$get_params);
// Преобразование ответа
$result = json_decode($response);
import requests
url = "https://data.tronk.info/reportrequest.ashx"
# входные данные
params = {
"key": "867983b5-d66d-44d7-b440-5bd00b0b8203",
"mode": "setqueue",
"gosnumber": "А111АА11",
}
# отправка запроса
response = requests.post(
url=url,
params=params,
)
# преобразование ответа к словарю
data = response.json()
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
string end_point = "https://data.tronk.info/reportrequest.ashx";
Dictionary< string, string > dict_params = new()
{
{ "key", "867983b5-d66d-44d7-b440-5bd00b0b8203" },
{ "mode", "setqueue" },
{ "gosnumber", "А111АА11" },
};
string url_params = string.Join("&", dict_params.Select(kvp => $"{kvp.Key}={kvp.Value}"));
string url = $"{end_point}?{url_params}";
HttpClient client = new();
string response_body = await client.GetAsync(url).Result.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject(response_body);
}
}
// Входные данные
$url = "https://data.tronk.info/reportrequest.ashx";
$request_params = array(
"http" => array(
"header" => "Content-type: application/json\r\n",
"key" => "867983b5-d66d-44d7-b440-5bd00b0b8203",
"mode" => "setqueue",
"gosnumber" => "А111АА11",
"customreport" => "1",
"custom_headerlogo" => "https://mydomain/img/logo/logo.svg",
"custom_companyurl" => "https://mydomain",
"content" => "{
"custom_socialicons": [
{
"icon": "https://mydomain/I/vk.png",
"url": "http://vk.com/vk"
},
{
"icon": "https://mydomain/I/telegram.png",
"url": "https://t.me/tg"
},
{
"icon": "https://mydomain/I/youtube-play2.png",
"url": "https://www.youtube.com/channel/"
}
],
"custom_headerhtml": "TRONK
",
"custom_companyphones": "8-800-000-0000",
"custom_companyemalis": "my@email.com",
"custom_companyschedule": "11:00 - 20:00 МСК",
"custom_companytagtext": {
"tagline": "Здесь будет слоган",
"sitename": "TRONK"
},
"custom_companyappstore": "http://appstore_url",
"custom_companygoogleplay": "http://playmarket_url"
}"
),
);
$context = stream_context_create($request_params);
// Запрос к серверу
$response = file_get_contents($url."?".$context);
// Преобразование ответа
$result = json_decode($response);
import requests
url = "https://data.tronk.info/reportrequest.ashx"
# входные данные
params = {
"key": "867983b5-d66d-44d7-b440-5bd00b0b8203",
"mode": "setqueue",
"gosnumber": "А111АА11",
"customreport": "1",
"custom_headerlogo": "https://mydomain/img/logo/logo.svg",
"custom_companyurl": "https://mydomain",
}
jsonStr = {
"custom_socialicons": [
{
"icon": "https://mydomain/I/vk.png",
"url": "http://vk.com/vk"
},
{
"icon": "https://mydomain/I/telegram.png",
"url": "https://t.me/tg"
},
{
"icon": "https://mydomain/I/youtube-play2.png",
"url": "https://www.youtube.com/channel/"
}
],
"custom_headerhtml": "TRONK
",
"custom_companyphones": "8-800-000-0000",
"custom_companyemalis": "my@email.com",
"custom_companyschedule": "11:00 - 20:00 МСК",
"custom_companytagtext": {
"tagline": "Здесь будет слоган",
"sitename": "TRONK"
},
"custom_companyappstore": "http://appstore_url",
"custom_companygoogleplay": "http://playmarket_url"
}
# отправка запроса
response = requests.post(
url=url,
data=jsonStr,
params=params,
headers={"Content-Type":"application/json"}
)
# преобразование ответа к словарю
data = response.json()
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
string end_point = "https://data.tronk.info/reportrequest.ashx";
Dictionary< string, string > dict_params = new()
{
{ "key", "867983b5-d66d-44d7-b440-5bd00b0b8203" },
{ "mode", "setqueue" },
{ "gosnumber", "А111АА11" },
{"customreport": "1"},
{"custom_headerlogo": "https://mydomain/img/logo/logo.svg"},
{"custom_companyurl": "https://mydomain"},
};
string url_params = string.Join("&", dict_params.Select(kvp => $"{kvp.Key}={kvp.Value}"));
string url = $"{end_point}?{url_params}";
string postData="{
\"custom_socialicons\": [
{
\"icon\": \"https://mydomain/I/vk.png\",
\"url\": \"http://vk.com/vk\"
},
{
\"icon\": \"https://mydomain/I/telegram.png\",
\"url\": \"https://t.me/tg\"
},
{
\"icon\": \"https://mydomain/I/youtube-play2.png\",
\"url\": \"https://www.youtube.com/channel/\"
}
],
\"custom_headerhtml\": \"TRONK
\",
\"custom_companyphones\": \"8-800-000-0000\",
"custom_companyemalis\": \"my@email.com\",
\"custom_companyschedule\": \"11:00 - 20:00 МСК\",
\"custom_companytagtext\": {
\"tagline\": \"Здесь будет слоган\",
\"sitename\": \"TRONK\"
},
\"custom_companyappstore\": \"http://appstore_url\",
\"custom_companygoogleplay\": \"http://playmarket_url\"
}";
HttpClient client = new();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://dadata.ru/demo/v2/clean/vehicle"),
Headers =
{
{ "Accept", "application/json" },
{ "Connection", "keep-alive" },
{ Content = new StringContent(postData)
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
string response_body="";
using (var response = client.SendAsync(request).Result)
{
response_body = response.Content.ReadAsStringAsync().Result;
}
var result = JsonConvert.DeserializeObject(response_body);
}
}
// Входные данные
$url = "https://data.tronk.info/reportrequest.ashx";
$request_params = array(
"key" => "867983b5-d66d-44d7-b440-5bd00b0b8203",
"mode" => "checkqueue",
"id" => 123
);
$get_params = http_build_query($request_params);
// Запрос к серверу
$response = file_get_contents($url."?".$get_params);
// Преобразование ответа
$result = json_decode($response);
import requests
url = "https://data.tronk.info/reportrequest.ashx"
# входные данные
params = {
"key": "867983b5-d66d-44d7-b440-5bd00b0b8203",
"mode": "checkqueue",
"id": 123,
}
# отправка запроса
response = requests.post(
url=url,
params=params,
)
# преобразование ответа к словарю
data = response.json()
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
string end_point = "https://data.tronk.info/reportrequest.ashx";
Dictionary< string, string > dict_params = new()
{
{ "key", "867983b5-d66d-44d7-b440-5bd00b0b8203" },
{ "mode", "checkqueue" },
{ "id", 123 },
};
string url_params = string.Join("&", dict_params.Select(kvp => $"{kvp.Key}={kvp.Value}"));
string url = $"{end_point}?{url_params}";
HttpClient client = new();
string response_body = await client.GetAsync(url).Result.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject(response_body);
}
}
// Входные данные
$url = "https://data.tronk.info/reportrequest.ashx";
$request_params = array(
"key" => "867983b5-d66d-44d7-b440-5bd00b0b8203",
"mode" => "getresult",
"id" => 123
);
$get_params = http_build_query($request_params);
// Запрос к серверу
$response = file_get_contents($url."?".$get_params);
// Преобразование ответа
$result = json_decode($response);
import requests
url = "https://data.tronk.info/reportrequest.ashx"
# входные данные
params = {
"key": "867983b5-d66d-44d7-b440-5bd00b0b8203",
"mode": "getresult",
"id": 123,
}
# отправка запроса
response = requests.post(
url=url,
params=params,
)
# преобразование ответа к словарю
data = response.json()
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
string end_point = "https://data.tronk.info/reportrequest.ashx";
Dictionary< string, string > dict_params = new()
{
{ "key", "867983b5-d66d-44d7-b440-5bd00b0b8203" },
{ "mode", "getresult" },
{ "id", 123 },
};
string url_params = string.Join("&", dict_params.Select(kvp => $"{kvp.Key}={kvp.Value}"));
string url = $"{end_point}?{url_params}";
HttpClient client = new();
string response_body = await client.GetAsync(url).Result.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject(response_body);
}
}