Service Activity for d_pxGetFile to return the STREAM in JSON response

Hello Pega Experts!

Really hoping someone can help me with a Service Activity to use d_pxGetFile (Get File API) and return the pyStream in the JSON response.

I’ve got my Service Package created and my Service REST created.

I have the Service REST set up for the 3 parameters (repositoryName, filePath, and responseType) to be in the query string like so …

https://vervnt-vrvnt1-prod1.pegacloud.net/prweb/api/VervAttachExtract/v1/GetVerventAttachment?repositoryName=pegacloudfilestorage&filePath=attachments//50340164494_statement_M-836580.pdf&responseType=STRING

The query string elements are mapped to Param.MyrepositoryName, Param.filePath, and Param.MyResponseType.

I’ve never written or created any PEGA activities before so I need help with a Service Activity that will use those 3 parameters with d_pxGetFile and return pyStream in the response JSON.

Can anyone help me with this?

Thanks!

@TimR17092474

Forget it. I solved it myself. Thanks.

Hi @TimR17092474!

Do you mind sharing what you did that solved this for you in case another user has the same issue?

Thanks!

@MarissaRogers - your question is valid and I probably should … but my solution is so ugly I would not want to display it here for the world to see. If someone wants to do something similar, they can reach out to me and I will show them my mess. It works, but DAMN its ugly. I’m a pega noob.