Need help in converting Base64 encode string to PDF in an API exposed from APPIAN to SAP as input parameter

Hi Appian Team,

We have a use case where Appian API integrated with SAP , and  the SAP system will input base 64 encoded strings for pdf, we have to read the same from the input variables and convert the same to PDF.

Can anyone help us to implement the  same if we anyone have already implemented or have knowledge about this?

thanks

Sunu Sam

  Discussion posts and replies are publicly visible

Parents Reply
  • HI Stefan ,

    attaching sample code from my POC.

    thanks please reply!

    Sunu Sam

    a!localVariables(
      /*Check whether the request body contains a document*/
      local!success: not(isnull(http!request.body)),
      if(
        local!success,
        a!startProcess(
          processModel: cons!Base64ToPdfConversionPOC,
          processParameters: {
            /*A document*/
            Transcript: todocument(http!request.body),
            
          },
          /*If a document was uploaded, return a successful response*/
          onSuccess: a!httpResponse(
            statusCode: 200,
            headers: { },
            /*Print the document id, name, and extension of the uploaded document*/
            body: concat(
              "Upload Successful: ",
              document(http!request.body, "id"),
              " - ",
              document(http!request.body, "name"),
              ".",
              document(http!request.body, "extension")
            )
          )
        ),
        /*If no document was uploaded, return an error code*/
        a!httpResponse(
          statusCode: 400,
          headers: { },
          body: "400 Document Not Provided"
        )
      )
    )

Children
No Data