- A host that supports PHP
- A Freshdesk Account
- A Freshdesk API Key
- First download the createTicket folder
- Place the folder on your PHP host
- Log into your Freshdesk Account / Create a Freshdesk Account
- Obtain your Freshdesk API Key
- Replace the following fields in submit.php; "YOUR_API_KEY" and "YOUR_DOMAIN"
// Your agent API key $api_key = "YOUR_API_KEY"; // Your Freshdesk subdomain // For example "example.freshdesk.com" enter "example" $yourdomain = "YOUR_DOMAIN";
- Obtain your custom Freshdesk fields (if any exist) using the following methods:
- cURL
curl -u YOUR_API_KEY:X -X GET https://YOUR_DOMAIN.freshdesk.com/api/v2/ticket_fields > ~/Desktop/json.txt
- If signed in as a Freshdesk agent go to
https://YOUR_DOMAIN.freshdesk.com/api/v2/ticket_fields
- cURL
- To use default/custom fields use the "name" field; custom fields are prepended by
cf_
- Replace the example
cf_
fields in this section of submit.php with your own// Custom Fields 'custom_fields[cf_input_number]' => $input_number, 'custom_fields[cf_input_text]' => $input_text, 'attachments[]' => curl_file_create($file_path, "application/pdf", $file)
- Make sure any input field changes you make in index.php are reflected in the POST data section in submit.php
// POST data $input_number=$_POST['input_number']; $input_text=$_POST['input_text']; $agent=$_POST['agent'];