12/18/2023 0 Comments Change header using base64 encoding![]() Get CSRF-token and Cookie (Step 2): The Attachments API need a CSRF token as part of message header to get invoked. The value of X-CSRF-Token needs to be obtained in next step, by connecting with S/4 system before we can trigger the Attachments APIģ. Also, we define a message header element X-CSRF-Token as a constant.This component receives the payload (format mentioned above in the picture Payload_format.jpg ) from external system over HTTPS and stores it as part of message body.Receive Payload (Step 1) : Element Type: Transformation->Content Modifier The endpoint needs to be defined in this connection as shown in the image. Sender is an external system (element type: Participant), e.g., postman, which sends the payload over HTTPS to the endpoint of this iflow. Sender: Element Type: Participants ->Sender Iflow does the following steps and activities within.ġ. The iflow basically reads the incoming payload and extracts the various elements out of it to prepare the required header and body content that is required by the Attachments API. The contents of the iflow can be seen in the image below. ![]() Thus, we developed an integration flow (iflow) which receives the payload from external system, transforms it and passes it to S/4 system. We need a middleware like SAP CPI which can decode the base64 content and help to obtain other technical parameters to consume the services of the Attachments API. Nice to have read the help documentation on Attachments Refer to blog for reading.Have basic idea of various components used in integration flow in SAP CPI.Communication Arrangement is defined for Billing Integration scenario in S/4.Communication system and Communication user for inbound is defined in S/4.Assuming, below pre-requisites and other required things are already in place. To solve this problem I will focus only on the development required in the middleware (SAP CPI), in this blog. Hence, we need to do these steps in the middleware like SAP CPI and pass the message header and body as expected by Attachments API. It required decoding of this content and obtaining technical parameters before the file could be uploaded to the Billing Document instance. The Attachments API does not consume the base64 encoded file content directly as a message body. File content should not be sent without encoding for security reasons. Content of the pdf file encoded as base64 (highlighted in image). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |