Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ya_client_id = "taxi/park/be25363d52c644f9b05daa451e1816df";
- $ya_api = "AIzvufB/saacjW+npx/YeOpyzXShrwPzZlvZcku";
- $park_id = "be25363d52c644f9b05daa451e1816df";
- $url = "https://fleet-api.taxi.yandex.net/v1/parks/driver-profiles/list";
- $count_strings = 1000;
- $page = 0;
- $post_data = '{
- "limit": '.$count_strings.',
- "offset": '.$page.',
- "query": {
- "park": {
- "id": "'.$park_id.'",
- "driver_profile": {
- "work_status": [
- "working"
- ]
- }
- }
- },
- "fields": {
- "account": [
- "balance",
- "balance_limit"
- ],
- "driver_profile": [
- "phones"
- ],
- "car": []
- },
- "sort_order": [
- {
- "direction": "asc",
- "field": "driver_profile.created_date"
- }
- ]
- }';
- $curl = curl_init();
- curl_setopt_array($curl, [
- CURLOPT_URL => $url,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => "",
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => false,
- CURLOPT_CUSTOMREQUEST => "POST",
- CURLOPT_POSTFIELDS => $post_data,
- CURLOPT_HTTPHEADER => [
- "Accept: application/json",
- "Content-Type: application/json",
- "X-Client-ID: $ya_client_id",
- "X-API-Key: $ya_api",
- "Accept-Language: ru"
- ],
- ]);
- $response = curl_exec($curl);
- curl_close($curl);
- $json = json_decode($response, true);
- var_dump($json);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement