PHP code example of marqu3s / octadesk-api
1. Go to this page and download the library: Download marqu3s/octadesk-api library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
marqu3s / octadesk-api example snippets
$subdomain = "mysubdomainatoctadesk";
$userEmail = "[email protected] ";
$apiToken = "octa.yyyyyyyyyyyy.zzzzzzzzzzzz";
$api = new LoginApi($subdomain, $userEmail);
$accessToken = $api->getAccessToken($apiToken);
$apiUrl = "https://api.octadesk.services";
$userEmail = "[email protected] ";
# The token obtained using LoginApi (to use with v0.0.1). See above.
# Or token generated at Octadesk API page under admin settings (to use with v1.0.0)
$accessToken = "OCTADESK.xxxxxx.xxxxxxx.xxxxxxx";
$api = new TicketsApi($apiUrl, $accessToken, $userEmail, "application/json", OctadeskApi::API_V0);
# Get tickets requested by someone.
$filters = [
[
"property" => "requester.id",
"operator" => OctadeskApi::FILTER_OPERATOR_EQ,
"value" => $personOctadeskUuid,
],
];
$sort = ["property" => "number", "direction" => "desc"];
$page = 1;
$ticketsPerPage = 10;
$response = $api->search($filters, $sort, $page, $ticketsPerPage);