Problem authenticating in call using LL_WEBREPORT_RESTCLIENT

Options

Hello everyone,

I'm having problems callling the ContentServer REST API in a WebReport. I've seen examples here in the forum and in the knowledge base (for example https://knowledge.opentext.com/knowledge/llisapi.dll/kcs/kbarticle/view/KB19450624) but I cannot get them to work. Even copying and pasting the samples always gives me the same error.

This is the code I'm using (this is a test to just create a folder with a call to the REST API):

<BR><BR><BR><STRONG>TICKET</STRONG><BR><BR><BR>
[LL_REPTAG_OTCSTICKET /]

<BR><BR><BR><STRONG>HEADER</STRONG><BR><BR><BR>
[LL_REPTAG_{ { 'otcsticket', [LL_REPTAG_OTCSTICKET QUOTE /] } } ASSOCACTION:CREATE SETVAR:header /]
[LL_REPTAG_!header INSPECT /]

<BR><BR><BR><STRONG>PARAMETROS</STRONG><BR><BR><BR>
[LL_REPTAG_{ { "type", 0 }, { "parent_id", 110403 }, { "name", "samplefolder" } } ASSOCACTION:CREATE SETVAR:parms /]
[LL_REPTAG_!parms INSPECT /]

<BR><BR><BR><STRONG>WEBSERVICE</STRONG><BR><BR><BR>
[LL_WEBREPORT_RESTCLIENT
@HOST:our.server.address.com
@PORT:8080
@URI:/OTCS/cs.exe/api/v2/nodes
@METHOD:POST
@TIMEOUT:10
@BODY:[LL_REPTAG_!parms /] 
@HEADER:[LL_REPTAG_!header /]
@OUTPUT:ASSOC:SALIDA /]
[LL_REPTAG_!SALIDA INSPECT /]


I always get the same error:


I've also seen some other samples that get the ticket by calling the auth service, those samples retrieve the ticket without problems, but the next call fails.

I'm using version 21.3 of Content Server.

The call using PostMan works without problems, I copy and paste the ticket in a PostMan call with those parameters and it creates the new folder perfectly. This makes me think that there is some problem with the way I'm sending the header, the REST service doesn't seem to find the otcsticket...

Am I doing something wrong? Has anyone got this to work?

Thanks in advance

--

Javier

Comments

  • The 401 indicates that the website that contains Livelink has Integrated Windows Authentication(IWA) turned on. Simply put OT 's REST API can never work with such a website. In IIS we usually create a parallel website or nowadays since OTDS can understand IWA we make the main website anonymous. Yours looks like the cgi of the application looks Tomcat so do your users come to the livelink site as


    as a check do this

    URLTOFOOLBOThttp://our.server.address.com@PORT:8080/OTCS/cs.exe make yourself logged in comfortably
    
    

    then tack on to that URL this extra thing that I have ?func=admin.testargs you may have to ask a SA if it doesn't work for you. What you are looking for is REMOTE_USER that if populated means that it is passing your token

    so you must have created something on TC like waffle to allow IWA tokens in that I guess is your problem.

    Create a new context so it does not rely on IWA and that code will work

    There is no way for livelink REST API calls to work off a "non -anonymous" website or application.

    I also do not know how Postman tackles the IWA handshake

  • BTW Remote_User empty or that key not present is what OT restapi will understand and execute the call with