Best.
Original Message:
Sent: Fri February 09, 2024 08:09 AM
From: Paul Mendelson
Subject: CA V12.0.1 - REST API Get Modules
I prefer going through the gateway instead of contacting the server directly. Log into your Cognos instance and paste this into the console:
const getCookie = function (name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
}
let gateway = __glassAppController.glassContext.gateway
, xsrfToken = getCookie('XSRF-TOKEN')
, modules = await fetch(gateway+"/api/modules", {
"headers": {
"accept": "application/json, text/javascript, */*; q=0.01",
"x-xsrf-token": xsrfToken
},
"method": "GET",
"mode": "cors",
"credentials": "include"
}).then(x=>x.json());
console.log(modules);
------------------------------
Paul Mendelson
Original Message:
Sent: Tue February 06, 2024 03:48 AM
From: LOIC POTIN
Subject: CA V12.0.1 - REST API Get Modules
Hello All,
Finally i have tested again the <sandbox_server_cognos>:9300/api/api-docs/#/modules/list_modules today and i was surprised to see that this time i got the full list of data modules in the system.
It is probably related to a cache ...
Best
------------------------------
LOIC POTIN
Original Message:
Sent: Thu January 18, 2024 08:49 AM
From: LOIC POTIN
Subject: CA V12.0.1 - REST API Get Modules
Hello all,
I am testing REST API in Cognos Analytics V12.0.1 and i have seen a strange behaviour with the Get Modules API. This API should return all the data modules i have in my sandbox environment but it doesn't return the full list, only some of them.
Are you aware of the problem with this API, have you noticed the same strange behaviour ?
Is there a size limit for the Json file which contains the API return ? if yes how to update it ?
In Cognos Analytics V11.1.7 the same API works fine.
Any help would be appreciated.
------------------------------
LOIC POTIN
------------------------------