Clarity

 View Only
  • 1.  REST API in GEL Script

    Posted Dec 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 Dec 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 Dec 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 Dec 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 Dec 23, 2017 09:27 PM

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



  • 6.  RE: Re: REST API in GEL Script

    Posted Oct 02, 2022 09:15 AM
    Hello Miller,

    I am stuck with the same. Everything working REsT is also getting ping but in GEl it 401 error when PUT URL is trying to work. What access issue did you find was help ful and to whom you gave it? Kindly help.


  • 7.  RE: Re: REST API in GEL Script

    Posted Oct 03, 2022 05:47 PM
    Sorry, but I really can't recall and I no longer have access to a Clarity environment to try and replicate the problem.  I think, and this is only a guess, I may have given my integration user every right available (ie made the integration user in effect a system administrator).