Reports Data API not working properly
Hello guys,
I'm facing two issues when trying to get report data through the API :
1/ Authentication issue : When the request is being sent to the instance, authentication isn't done properly and the login page is sent back as response. I traced it back to this PR : https://github.com/adobe/acc-js-sdk/pull/57/files which removed the Cookie from headers. Currently the auth is done through : const headers = this._getAuthHeaders(false); which is cleaner but disallows the cookies in the headers due to the "false" in the setCookie parameter of _getAuthHeaders method.
I hacked it by hardcoding the parameter to "true" adding back the cookies to the request headers and it solves the authentication issue but this brings me to the next issue.
2/ FEATURE_NOT_SUPPORTED : Reports Data
The query response return an html document which triggers the CampaignException.FEATURE_NOT_SUPPORTED("Reports Data") since the code in the report method expects an xml that begins with "<ctx".
When digging further, I noticed that the _noRender=true param is not working properly. This param is supposed to limit the response to the ctx XML only.
Looking at the report code in ACC, there is no mention of _noRender and there is no attempt to getting from the request parametrs. The only code that allow to set the g_bNoRendering flag to true is in the first lines of the report as such :
The parameter used for this is request.bNoRendering which I couldn't figure how to set.
Expected Behaviour
Report request is sent instance and report data is sent back
Actual Behaviour
Login page as a reponse due to authentication issue.
Reproduce Scenario (including but not limited to)
Call to Client.getReportData() method.
Platform and Version
Client : Adobe Campaign Classic 7.4.1 build 9383 Server : Adobe Campaign Classic 7.2.2 build 9349 @adobe/acc-js-sdk": "1.1.38"