IDM api call from LN

Hi all,

 

I am trying to call IDM api from Infor LN 10.6 program script. But I am not able to have it working. I am trying to use function http.get(...). Most probably the problem is in passing certificate. 

If I try to omit certificate  by parameter HTTP_VERIFYPEER, false I amd getting response without any error. But once I try to get the body from bodystream by function  jsonvalue = Json.read(bodystream, errormsg)   I am getting error "unexpecte char while reading JSON value [current char: ASCII 60 (0x3c): "<"] "

IDM api is working fine as I am using it from ION workflow. 

Does anyone has any idea or experience how to call REST api of IDM directly from Infor LN 4GL script?

 

best regards

Tomas

  • Hi,
    You need to have authentication in place for the call to work. I don't have any experience in calling IDM from Infor LN 4GL but without a certificate the call will fail and a default HTML error page will be returned, and thus the JSON parsing of that will fail. If you can print out the value returned somehow you can confirm this.

    Another option, which I don't think is the case here, is that XML is returned by default and you should be able to add an Accept header application/json to let the service know that you would like the response in JSON.

    More on Accept headers:
    stackoverflow.com/.../rest-api-use-the-accept-application-json-http-header