How to send input value through freshdesk api

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>

@mafioznick,
Good Day! welcome to the community
The question which you asked is unclear,
can you please elaborate in detail, so that we will give a best solution

Thanks

1 Like

Hello @mafioznick , could you please expand a little like @Santhosh has requested? Can you describe what you are trying to achieve? Also, what is the input id that you refer to in your question?
Have you had a chance to check out our sample apps repository yet? I wonder if this sample might help you (without fully appreciating your ask, of course) - marketplace-sample-apps/Freshworks-Samples/Freshdesk/simple-fd-req-app at master · freshworks/marketplace-sample-apps · GitHub

2 Likes