Make a custom HTTP call

In this guide, we'll show you how to use a generic HTTP connector. It is a powerful tool that can integrate Cargo with virtually any public API. It is especially useful when a dedicated connector is not available in the node catalog.

In the example below, we will make API calls to a service called PandaDoc to automate document and eSigning operations.

Pre-requisites

Before you begin

To follow this guide, you'll need a few things from PandaDoc:

  • A PandaDoc account
  • PandaDoc API key (obtained from PandaDoc Dashboard > Account Settings > Integrations > API)
  • A document template ID from your PandaDoc account

Also, we will need some customer data to populate the document. In this example, we will use the HTTP model as the starting point for the workflow. A data model is defined during workflow creation.


Add an HTTP node to create a document from your template:

  1. Add an HTTP node and link it to the start node
  2. Configure the request:

URL:

https://api.pandadoc.com/public/v1/documents

Method: POST

Headers:

{
  "Authorization": "API-Key YOUR_API_KEY",
}

Body Format: JSON

Raw Body

{
    "name": "Contract for {{nodes.start.customer_name}}",
    "template_uuid": "YOUR_TEMPLATE_ID",
    "recipients": [
      {
        "email": "{{nodes.start.customer_email}}",
        "first_name": "{{nodes.start.customer_first_name}}",
        "last_name": "{{nodes.start.customer_last_name}}",
        "role": "Client"
      }
    ],
    "tokens": [
      {
        "name": "companyName",
        "value": "{{nodes.start.company_name}}"
      },
      {
        "name": "planType",
        "value": "{{nodes.start.plan_type}}"
      }
    ]
}

This creates a new document and returns a document ID in the response.


Add another HTTP node to send the document for signing:

URL:

https://api.pandadoc.com/public/v1/documents/{{nodes.http.data.id}}/send

Method: POST

Headers:

{
  "Authorization": "API-Key YOUR_API_KEY",
}

Body Format: JSON

Raw Body

{
    "message": "Please review and sign this document",
    "subject": "Document ready for signature - {{nodes.start.customer_name}}"
}

The document ID from the previous step is used in the URL to identify which document to send.


Test your workflow by sending a test webhook to the workflow.

// Test payload
{
  "customer_name": "John Smith",
  "customer_email": "john@example.com",
  "customer_first_name": "John",
  "customer_last_name": "Smith",
  "company_name": "Acme Inc",
  "plan_type": "Enterprise"
}

Verify in your PandaDoc dashboard that:

  • The document is created correctly
  • Template tokens are replaced
  • The document is sent to the right recipient

Outcome

Finish line

You have now created a workflow that:

  1. Creates a document from a PandaDoc template
  2. Populates it with customer data
  3. Sends it for signature

This integration can be used to automate your document workflows and contract signing processes.

What's next?