Hi Edward,
Thank you for your answer.
I actually already went through the link you shared with me, which covers how to execute HTTP request from PostMan, but I am actually trying to execute it directly within PAaaS TI process.
After discussing with IBM Support, encoding the API key using the Base64Encode function allowed the POST request to execute successfully.
vNow = TIMST (NOW(), '\Y\m\d\h\i\s' );
vLogFile = '/Logs/Processes/pull_data_from_remote_cubes_' | vNow | '.log';
vUser = TM1User;
vAPIKey = ATTRS('}Clients', vUser, 'PASaaS API Key');
# Construct URL
vBaseURL = 'https://eu-central-1.planninganalytics.saas.ibm.com';
vTenantID = ''; #TO BE CHANGED
vUrl = vBaseURL | '/api/' | vTenantID | '/v0/rolemgmt/v1/users/me';
ASCIIOUTPUT( vLogFile, 'accessToken: ' | vBaseURL );
# Prepare Basic Auth header
vAuthHeader = 'Authorization: Basic ' | Base64Encode('apikey:' | vAPIKey);
# Make request
ExecuteHttpRequest('GET', vUrl, '-k', '-h ' | vAuthHeader, '-h Content-Type:application/json');
# Log output
ASCIIOUTPUT(vLogFile, 'Request URL: ' | vUrl);
responseCode = HttpResponseGetStatusCode();
ASCIIOUTPUT(vLogFile, 'Response Code: ' | NumberToString(responseCode));
responseBody = HttpResponseGetBody();
ASCIIOUTPUT(vLogFile, responseBody);
# Example of POST Request (create folder)
vRemoteDatabase = ''; #TO BE CHANGED
vUrl = vBaseURL | '/api/' | vTenantID | '/v0/tm1/' | vRemoteDatabase | '/api/v1/Contents(' | vQu | 'Files' | vQu | ')/Contents';
vJSONCommand = '{"@odata.type": "#ibm.tm1.api.v1.Folder", "Name": "TestFolder"}';
ExecuteHttpRequest( 'POST', vUrl, '-k', '-h Content-Type:application/json', '-d ' | vJSONCommand);
ASCIIOUTPUT(vLogFile, 'TM1 Config Request URL: ' | vUrl );
responseCode = HttpResponseGetStatusCode();
ASCIIOUTPUT(vLogFile, 'TM1 Config Response Code: ' | NumberToString(responseCode));
Thanks again for your help!
Erwan