Hello everyone,
I’m currently trying to execute a POST request from a TI process in Planning Analytics using ExecuteHttpRequest, but I keep running into issues. I’d appreciate some help or guidance from anyone who has managed to get this working.
Here’s what I’ve done so far:
-
I wrote a TI process that tries to authenticate against IBM Cloud and then call the PA REST API.
-
I’m able to get an access_token from the IBM Cloud IAM endpoint by using my API key. That part seems to work fine.
-
However, when I try to use this bearer token to send further requests (for example, creating a folder in the PA Contents), I always get a 401 response code.
Here’s a simplified version of the code I’m running in the TI process:
(I've adapted it from the process of Stuart King you can find here: PASaaSReplication/processes/Replicate data.ti at main · StuartStephenKing/PASaaSReplication)
| GitHub |
remove preview |
|
| PASaaSReplication/processes/Replicate data.ti at main · StuartStephenKing/PASaaSReplication |
| Contribute to StuartStephenKing/PASaaSReplication development by creating an account on GitHub. |
| View this on GitHub > |
|
|
What I’ve observed so far:
-
The access token is generated correctly from IBM Cloud IAM.
-
When using the token in a TI request, I consistently get a 401.
-
I tried the POST request from the TI process, using this paSession cookie I manually copied from PostMan, it works fine. (I executed the authentication in Postman just to get the paSession cookie)
-
That leads me to believe the issue is not with the TI syntax itself, but rather with how the PAaaS authentication works.
My main questions:
-
How do I get the correct API key or credentials that give me access to the PAaaS service from a TI process?
-
Or alternatively, is there a way to programmatically retrieve the paSession cookie from within a TI process, similar to how Postman handles it?
-
Has anyone successfully used ExecuteHttpRequest('POST', …) in TI against PAaaS, and if so, what authentication flow did you use?
Any advice or concrete examples would be very welcome. I feel like I’m missing a key step regarding authentication between IAM and the PAaaS instance.
Thanks a lot in advance for your help!
Erwan