Inbound REST call logging

Sebastiaan de V
Kilo Guru

For an integration with a third party system, we are building a REST integration using import sets with the Import API. We would like to track all REST communication (incoming and outgoing). 

Is it possible in the REST Import API to see and log (e.g. in a table) the incoming REST message, either the actual complete REST request or only the body (JSON). I couldn't find the question on the community. You can see the REST message if you enable REST debugging (glide.rest.debug=true), but I don't think you can access that in a script.

Anyone found a solution for this without resorting to a Scripted REST API?

 

10 REPLIES 10

Syvo
Mega Guru

Hi Sebastiaan,

The transformation occurs synchronously, would you have access to the request object in the transform script?
Just wondering.

HTH
Sylvain

Sebastiaan de V
Kilo Guru

That would be ideal, but I don't know if/how I can access the request from there.

In your transform script, you can add something like:

gs.log("request constructor: " + (request !== undefined ? request.constructor : "undefined"),"your source");

Then import 1 record, and search the system logs for the source "your source".

Sebastiaan de V
Kilo Guru

Hi Syvo,

That is the idea, but this doesn’t work, since there is no reference to the actual request that I know of. Your example gives an error on “request not not defined”.

anyone any idea how this would be possible.

regards,

Sebastiaan