Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $curl = curl_init();
- $post = [
- 'name' => 'name',
- 'description' => 'description',
- 'client_id' => 1,
- 'manager_id' => 1,
- ];
- $apiToken = '14266863287c8a4f2bddc9c518721068';
- curl_setopt_array($curl, array(
- CURLOPT_URL => "https://vtcrm.fru-it.ru/api/tickets",
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => "",
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 30,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => "POST",
- CURLOPT_POSTFIELDS => http_build_query($post),
- CURLOPT_HTTPHEADER => array(
- "Cache-Control: no-cache",
- "Postman-Token: 70d16a4c-ff26-47e0-af7e-d47d0b9c2ffa",
- "Authorization: Bearer " . $apiToken,
- ),
- ));
- $response = curl_exec($curl);
- $err = curl_error($curl);
- if ($err) {
- echo "cURL Error #:" . $err;
- } else {
- echo $response;
- }
Advertisement
Add Comment
Please, Sign In to add comment