Clarity

Expand all | Collapse all

REST API in GEL Script

Jump to Best Answer
  • 1.  REST API in GEL Script

    Posted 12-21-2017 09:19 PM

    Hi team

    I'm trying to read out some resource information from the REST API in a GEL Script, and I'm getting a 401 (unauthorized) error.  I can log into PPM with my Integration User and get a response from the REST URL (https://cppm-nnnn.ondemand.ca.com/ppm/rest/v1/resources/5005400 ).  I can get a response back when I hit /auth/login, but when I try to access the REST through a GEL script, I get the 401 error.  I can run the script with my own credentials and get the correct response, but of course ideally I want the integration user to be able to run it.

     

    Anyone have any clues what I'm missing? I'm guessing it's a security right somewhere, but I've given the integration user all of the ones I can think of.

     

    Many thanks in advance, and Merry Christmas to all.



  • 2.  Re: REST API in GEL Script

    Posted 12-21-2017 11:44 PM

    Hi TEAConsulting ,

     

    You can follow link GEL Script consuming CA PPM REST API  for sample.

     

    Regards,

    Prashank Singh



  • 3.  Re: REST API in GEL Script

    Posted 12-21-2017 11:48 PM

    Hi Prashank, thanks for the reply.  I've been using that blog-post as my guide, and everything is working happily until I try to execute the REST call with my integration user. It works fine when I call the REST using my own credentials, but I get the Error 400 when I call using the integration user. That leads me to think there is either some security right missing (my integration user has the API right, and also Resource - Edit All among others), or perhaps the API somehow knows the integration user is different from the logged-in user and disallows the script for that reason.



  • 4.  Re: REST API in GEL Script
    Best Answer

    Posted 12-22-2017 12:05 AM

    I have also used integration user and it need to have specific security rights related to API and Object which integration user is trying to access. Also try to look into app-ca log for missing API right.



  • 5.  Re: REST API in GEL Script

    Posted 12-23-2017 09:27 PM

    Turns out it was related to an access right. Problem now solved! Thanks so much for your help, Prashank.