Hi
I am making a request with Jquery in javascript. When I try to authaorize, I get this message:
require_login: true
Here is the code:
$.ajax({
type: 'POST',
url: "https://domain.freshdesk.com/helpdesk/tickets.json",
beforeSend: function( xhr ) {
xhr.setRequestHeader("Authorization", "Basic " + btoa("My_API_KEY:X"));
},
data: {
"helpdesk_ticket":{
"description":"Some details on the issue ...",
"subject":"Support needed..",
"email":"tom@outerspace.com",
"priority":1,
"status":2
},
"cc_emails":"ram@freshdesk.com,diana@freshdesk.com"
}
}).done(function( data ) {
console.log( data );
})
There's obviously something wrong with the way I set the header, but I cannot understand how I am supposed to do it.
Thanks for all help :)