I received this error after I upgraded sugar7.8, Which calling my filedownload.
{"error":"need_login","error_message":"No valid authentication for user."}
After some Investigation found tht sugar upgraded the API calls for OAuth. Following is my CODE:
api.fileDownload(api.buildURL("Quotes/" + model.get("id") + "/pdf/download?OAuth-Token=" + api.getOAuthToken()), { success: function() { app.alert.show("pdf_download_api_success", { level: "success", messages: SUGAR.language.get('Quotes', 'LBL_QUOTE_PDF_GENERATED'), autoClose: true }); },});
I checked the detials in the Following url: But I could not able to add headder to the HTTPS request can some one help?
https://developer.sugarcrm.com/2016/11/15/security-changes-coming-in-sugar-7-8/