- 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// Array for custom fields $custom_fields = array( "cf_custom_text_field" => $text_input, "cf_custom_number_field" => $number_input );
- Make sure any input field changes you make in index.php are reflected in the POST data section in submit.php
// POST data $text_input=$_POST['text_input']; $number_input=$_POST['number_input']; $drop_down=$_POST['drop_down']; $date_field=$_POST['date_field']; $text_area=$_POST['text_area'];