REST Outbound Connector

Hello,

I am trying the REST Outbound Connector. My objective is to send across a payload to an external service API2PDF that takes a payload in various formats and converts it to pdf. Sharing the documentation link for api2pdf.

I intend to send the response to an internal email service task that will send it as an attachment.
I am sharing my configuration for the connector,

So what is happening at the moment is the process hangs at the connector. Not sure what the issue is.

Screenshot 2025-04-18 at 9.08.52 AM

I have tried setting the authentication type to Api key but same issue. We are not using Camunda cloud.
Any tips, suggestions?

Thank you

@Bisoux Here’s a sample configuration for your REST Outbound Connector that integrates with API2PDF.


Example: Camunda REST Outbound Connector for API2PDF (POST)

REST Connector Properties (via Operate or Modeler)

  • URL:

    https://v2.api2pdf.com/wkhtmltopdf/html
    
  • Method:

    POST
    
  • Headers:

    {
      "Content-Type": "application/json",
      "Authorization": "Your-API2PDF-Key"
    }
    
  • Body:

    {
      "html": "<h1>Hello World</h1>",
      "inlinePdf": false,
      "fileName": "anniversary.pdf"
    }
    
  • Result Variable:

    pdfResponse
    
  • Result Expression:

    = { body: body, status: status, headers: headers }
    

Using the Response

You can now use =pdfResponse.body.pdf in the next task (e.g., email worker or script) to access the generated PDF file URL.

If you use Java for downstream workers, you can extract like this:

String pdfUrl = (String) variables.get("pdfResponse", Map.class).get("pdf");

Tips for Troubleshooting

  • Use Postman to test the API with your payload.
  • Check Zeebe logs for connector-related errors (zeebe/connectors container).
  • Ensure your connector runtime has internet access if you’re calling external APIs.
  • If using docker-compose, expose the connector port and inspect logs with:
    docker-compose logs -f connectors
    
1 Like

Thank you @aravindhrs ! I ended up going with our own internal worker for handling http requests. Seems fit for purpose for now given time constraints.