Send additional log in requests

WorkZone automatically registers user access to the primary entities File, Record and Contact in logs.

The logging feature registers both the user, the entities that the user has accessed, and additional information regarding the origin of the access such as the name of the integration system that issued the request. This additional information should also be sent when the WorkZone our OData service is accessed through code.

The DataServiceContext will automatically trigger the event SendingRequest2 whenever a request to the server is issued. You can write an event handler for the SendingRequest2 event to ensure the additional logging information is always included in all requests. The following example illustrates one way of doing this.

Example:

Create an event handler for the SendingRequest2 event to send additional logging information with the OData request


context.SendingRequest2 += (sender, args) =>
    {
        if (!args.IsBatchPart) // SendingRequest2 will be called for each contained request in a Batch request. We only need to supply the headers on the top level
        {
            // Specifying the UseLog-Application MUST ALWAYS be performed
            args.RequestMessage.SetHeader("UseLog-Application", "NameOfIntegration/System");
            // If you are always connecting with a system user, you should use the UseLog-Identity to specify the identity of the user you are servicing
            args.RequestMessage.SetHeader("UseLog-Identity", servicingUser);
        }
    };
				

The copy image is missing