cancel
Showing results for 
Search instead for 
Did you mean: 

// How to retrieve payload based on message id in cpi //

Rakesh1610
Newcomer
0 Kudos
258

Hi SAP community,

I have requirement where I need to retrieve payload based on message id in cpi 

could any one help me on this with a detailed explanation?

Regards 

Rakesh

Accepted Solutions (0)

Answers (1)

Answers (1)

MAVR
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @Rakesh1610 

The answer to your questions is complex.
Important Note: a) SAP Cloud Integration does not log the payload for the messages unless TRACE is explicitly enabled (TRACE will only last 10 min, and the data will be removed after 60 min). b) SAP Cloud Integration has a flexible pipeline: this means you can have one or many source payloads, one or many intermediate payloads, one or many enriched payloads, one or many transformed payloads, and one or many target payloads, all linked to the same message-id.

Yes. You can use APIs or UI to download the payload from a specific message-and-step.

Documentation: https://api.sap.com/api/MessageProcessingLogs/path/get_MessageProcessingLogs___MessageGuid___

Please find an example

Step 1: Use message-id
/api/v1/MessageProcessingLogs('your-message-id-here')

Step 2: Navigate to Runs to get RunId
/api/v1/MessageProcessingLogs('your-message-id')/Runs

Step 3: Navigate to RunSteps
/api/v1/MessageProcessingLogRuns('your-run-id-here')/RunSteps

Step 4: $filter or select a "child" based on your stepId or other criteria
/api/v1/MessageProcessingLogRunSteps(RunId='your-run-id-here',ChildCount=your-child-count)/TraceMessages

Step 5: Navigate to value using TraceId to extract the payload.
/api/v1/TraceMessages(your-TraceId-here)/$value

I hope this helps you. Keep integrating 🖖🏻

Best regards,

Ricardo