How to attach a pdf to pega case from pega robotic studio?

I have a pdf file that needs to be attached to pega case, how can i do it from pega robotic studio?

@ShreeHarshaN16839089 There is a new component available in the latest release to help with exactly this.

https://docs.pega.com/bundle/robotic-automation-221/page/robotic-automation/properties-methods-events/pega-api-attachment-component.html

@ThomasSasnett

Perfect, But is there any ways to work with the older versions?

@ShreeHarshaN16839089 What version of Pega Robotics are you using?

It is possible, but not really as straight-forward as it involves some C# and calling the Pega API REST services. It is highly recommended that you use this as an opportunity to upgrade to the latest version to make this process much simpler as well as get all of the advantages and features of the new version as well.

@ThomasSasnett

I’m using 22.1.18 version.

@ShreeHarshaN16839089 Excellent. 22.1.22 is an easier upgrade than attempting to do this using scripts and REST calls.