PHP code example of mpclarkson / freshdesk-php-sdk
1. Go to this page and download the library: Download mpclarkson/freshdesk-php-sdk 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/ */
mpclarkson / freshdesk-php-sdk example snippets
g
use \Freshdesk\Api;
$api = new Api("your_freshdesk_api_key", "your_freshdesk_domain");
$all = $api->tickets->all();
$some = $api->tickets->all(['page' => 2]);
$new = $api->tickets->create($data);
$updated = $api->tickets->update($data);
$api->tickets->delete($id);
$existing = $api->tickets->view($id);
//Responses are simple arrays, e.g.:
$id = $existing['id'];
$first = $all[0];
use \Freshdesk\Api;
$api = new Api("your_freshdesk_api_key", "your_freshdesk_domain");
//Page 2 with 50 results per page
$page2 = $this->forums->all(['page' => 2, 'per_page' => 50]);
//Tickets for a specific customer
$tickets = $this->tickets->view(['company_id' => $companyId]);