API KEY doesn't works

Hello I set this to use Freshdesk's API.


 baseURL = "https://MYACCOUNT.freshdesk.com/api/v2/contacts";

 postData = "{\"name\":\"Alex\",\t\"email\":\"mb_testing@yahoo.it\"}";

 mapp = Map();

 //postData = encodeurl(postData);

 myHeaders = Map();

 myHeaders.put("apykey","MYAPI");

 myHeaders.put("Content-Type","application/json");

 response = postUrl(baseURL,mapp,myHeaders,true);

 info response;


But I obtain {"code":"invalid_credentials","message":"You have to be logged in to perform this  action."}


Anyone could help me to set apikey?


Thanks!

Login or Signup to post a comment