Skip to main content

Hi I made an Google Script app(Used this template) to create help desk ticket but when I run my app its getting error 410 “Deprecated API”

 

api POST a create ticket are getting error 410 "Deprecated API"

Hi I made an Google Script app(Used this template) to create help desk ticket but when I run my app its getting error 410 “Deprecated API”

 

api POST a create ticket are getting error 410 "Deprecated API"

Looks like you are using the old API 

Have you checked https://developers.freshdesk.com/api/#create_ticket ? 
Looks like the github are 11 year old. 


Thanks  for your guide. that worked but Im getting 401 Authentication required error now. 

This is my code 

function createTicket(e) {

var API_KEY='My API ';

var ENDPOINT = 'My domain'; // change to https if SSL is configured.

var headers = {
'Content-type': 'application/json',
'Authorization': 'Basic ' + Utilities.base64Encode(API_KEY + ':X')
};


var payload = '{"helpdesk_ticket":{"description":"Description ...","subject":"Title","email":"user@test.com","priority":1,"status":2},"cc_emails":"example1@example.com"}';



var url = ENDPOINT + '/api/v2/tickets';

var options = {
'method': 'post',
'headers': headers,
'payload': payload,
muteHttpExceptions: true
};

var response = UrlFetchApp.fetch(url, options);

Logger.log("code: " + response.getResponseCode());
Logger.log("text: " + response.getContentText());
}

 


Hmm, where did my post go ? Oh well. 

 

401 you need to look at the API key and 'Authorization': 'Basic ' + Utilities.base64Encode(API_KEY + ':X')


401 Authentication required error now. That’s what I get.


All resolved the issue was my domain url was wrong.

 

Thanks anyway


Reply