i need help, how send form input value through this freshdesk api… what i need to change, to insert input id in ticket_data as value… please help
<input id="lc-calendar_till" type="hidden" placeholder="Date from">
<script>
$(document).ready(function(){
$("button").click( // click to send
function() {
var yourdomain = 'domainxxxx';
var api_key = 'apikeyherexxx';
ticket_data = '{ "description": "here is description", "subject": "Subject text", "email": "mail@gmail.com", "priority": 1, "status": 2 }';
$.ajax(
{
url: "https://"+yourdomain+".freshdesk.com/api/v2/tickets",
type: 'POST',
contentType: "application/json; charset=utf-8",
dataType: "json",
headers: {
"Authorization": "Basic " + btoa(api_key + ":x")
},
data: ticket_data,
}
);
}
);
});
</script>