Skip to Content

How to Upsert the Attachments into Successfactors Using SAP CPI

This blog describes how to upsert the attachments into Successfactors using SAP Cloud Platform Integration. I am using Job Application OData API to achieve this.

For any Attachment to upsert into Successfactors OData API, we should have to do this through Attachment OData API. Attachment is a generic API to upsert any attachment in Successfactors.

In this blog i am going to explain how to upsert the PDF file into JobApplication API. In my JobApplication API, I have a custom field whose data type is Attachment and having the navigation to Attachment API from that field. If you select the Sub Level-1, you can see the attachment fields. Any how, i have not used the Succssfacors adapter to upsert. I am just showing this screenshot for API navigation and field structure.



Once you select the JobApplication API, the business key field will be automatically ticked the check box and it appears in the upsertable fields list. But coming to the Attachment API, Attachment ID is the business key but we should not upsert any data into this field. In Attachment API, we have to select the fileContent, fileName, module fields. These 3 are the required fields in this API.The DataType for fileContent field is Base64. For module field you can hardcode to RECRUITING.

Integration flow design:


In the above screenshot, I get the PDF File content from HTTP Adapter and after that i am using the Encoder shape to do the Base 64 format of the PDF Content. After that i am creating one header as Content-Type as “application/json”. In Property, i have created one property as PDF and given the value to that property as the Base 64 Encoded data. After that i have created the body, which will accepts by the JobApplication API.

Content Modifier Screenshot:






Sample Json Data to Upsert:

“uri”: “JobApplication(applicationId=’1234′)”
“applicationId”: “1234”,

After that i am logging the payload data in the groovy script. After that, i am using the HTTP adapter to upsert the data into successfactors using POST operation and followed by the response catching using groovy script.

Best Regards,


You must be Logged on to comment or reply to a post.
  • Hi Imran


    Thanks for sharing this blog. I have a question.


    While upserting using HTTP adapter, it is returning status 500. I analyzed everything but everything looks good with json payload and HTTP adapter.

    Could you please suggest?

  • Hi Imran,

    I am also having same requirement, sending Base64Encode from ERP to SF via HCI Middleware (Source and target both XML).

    We have DecodedBase64 file in HCI but while trying to POST the data to Custom Portlet, we are getting Issues. Can we send PDF content into attachment field. Please find the screen shot of HCI_Log. and also find the complete iflow of Payslip. Kindly guide us on this Process.





    • Hi Rawinder,

      Yes, we can send PDF content to attachment field. But it accepts the data in encoded format only. Use the Encoder shape to encode the PDF Content and set that in one property, like my screenshot above. After that take the content modifier and in it’s body, place SF Formatted data(See My last screenshot). Also, use Request-Reply instead of End message. By using this you can see the upsert response from SF System. I also recommend to use HTTP Adapter instead of Successfactors. Try that and let me know if you face any issues.



      • Hi Imran,

        I am sending Encoded Message and want to Decode in HCI but however i am failing to send the Decoded Message to SF. I have followed your steps but failing to Upsert the Decoded Data into SF.

        1. Have few doubts:- Can we convert Encoded data to Decoded data in HCI and Upsert into SF?

        2. I am using Https as recommended but I am getting the data in XML(from source) format so should we send XML target side or  we can send Json as well?