Skip to main content

HTTP Requests

Pro ⭐ Enterprise

The HTTP Request step lets a workflow call an external API, such as your CRM, an analytics platform, a chat tool's incoming webhook or your own backend. You supply the URL, headers and body for each service. These are general HTTP calls, not native integrations. The step is available on the Pro and Enterprise plans.

Overview​

HTTP Request steps can:

  • Call external APIs with any HTTP method
  • Send survey data to your systems
  • Receive responses and map them to workflow parameters
  • Chain requests using data from previous responses

Configuration​

HTTP Methods​

Use for: Retrieving data

GET https://api.example.com/customers/{{contact.id}}

Example: Fetch customer tier before survey

URL Configuration​

Enter the full endpoint URL. Variables are supported:

https://api.example.com/customers/{{contact.id}}
https://crm.company.com/surveys/{{survey.id}}/responses
https://hooks.slack.com/services/T00/B00/XXXX

Headers​

Add custom HTTP headers for authentication and content types:

HeaderExamplePurpose
AuthorizationBearer YOUR_API_TOKENAPI authentication
Content-Typeapplication/jsonRequest body format
X-API-Keyyour-api-keyAPI key authentication
Acceptapplication/jsonExpected response format

Adding Headers:

  1. Click Add Header
  2. Enter the header name (key)
  3. Enter the header value (supports variables)

Request Body​

For POST, PUT, and PATCH requests, configure the request body:

{
"surveyId": "{{survey.id}}",
"score": {{survey.score}},
"respondent": {
"email": "{{contact.email}}",
"name": "{{contact.name}}"
},
"completedAt": "{{survey.completed_at}}",
"customTier": "{{params.customerTier}}"
}
JSON Syntax
  • Strings must be quoted: "{{contact.email}}"
  • Numbers should not be quoted: {{survey.score}}
  • Booleans should not be quoted: {{params.isActive}}

Response Mapping​

Extract values from the API response and store them as workflow parameters:

Mapping Configuration​

JSON PathParameter NameDescription
$.data.customerIdcustomerIdExtract customer ID
$.statusapiStatusExtract response status
$.data.tiercustomerTierExtract tier value

JSON Path Syntax​

$ → Root object
$.property → Direct property access
$.data.nested → Nested property access
$.items[0] → Array index access
$.items[*].id → All IDs from array

Example Response:

{
"customer": {
"tier": "gold",
"points": 1500
}
}

Mapping:

JSON PathParameterResult
$.customer.tiercustomerTier"gold"
$.customer.pointsloyaltyPoints1500

Common Recipes​

Each tab is an HTTP Request step you configure yourself. Read Third-party API recipes before you use one.

Send to CRM​

// POST https://api.crm.com/contacts/{{contact.id}}/surveys

{
"surveyId": "{{survey.id}}",
"score": {{survey.score}},
"completedAt": "{{survey.completed_at}}"
}

Response Mapping:

$.contactId → params.crmContactId
$.status → params.syncStatus

Advanced Patterns​

Chaining Requests​

Use response from one request in subsequent requests:

GET https://api.example.com/customers/{{contact.email}}

Response Mapping:
$.tier → params.customerTier
$.id → params.customerId

Conditional API Calls​

Use conditions to call different APIs based on data:

Error Handling​

Check API response status in conditions:


Authentication Patterns​

Headers:
Authorization: Bearer YOUR_API_TOKEN

Best for: Most REST APIs, OAuth tokens


Third-Party API Recipes​

Recipes, not native integrations

Each recipe below is an HTTP Request step that you configure with the vendor's API address and your own credentials. Pollarix has no native connector for these services. The recipes follow each vendor's public API documentation and were not tested against live accounts, so check the vendor's current API reference before you rely on one.

  • Paste a static API token directly into the header value. Pollarix encrypts HTTP Request step URLs and header values at rest and masks header values in execution logs. Request bodies are not encrypted, so keep secrets out of the body.
  • A {{params.*}} value exists only after an earlier step sets it, for example a response mapping from a lookup request. An unset variable is sent as an empty string.
  • {{survey.score}} is the response's total score on a 0-100 scale, not a raw 0-10 answer.
  • Custom fields or properties a recipe writes to must already exist in your vendor account.
HubSpot Contact Update

Set params.hubspotContactId first, for example by mapping the ID from a HubSpot contact search in an earlier HTTP Request step.

PATCH https://api.hubapi.com/crm/v3/objects/contacts/{{params.hubspotContactId}}

Headers:
Authorization: Bearer YOUR_HUBSPOT_PRIVATE_APP_TOKEN

Body:
{
"properties": {
"last_survey_score": "{{survey.score}}",
"last_survey_date": "{{survey.completed_at}}"
}
}
Zendesk Ticket Creation

The header value is the Base64 encoding of you@example.com/token:YOUR_ZENDESK_API_TOKEN.

POST https://yoursubdomain.zendesk.com/api/v2/tickets.json

Headers:
Authorization: Basic BASE64_OF_EMAIL_TOKEN_AND_API_TOKEN

Body:
{
"ticket": {
"subject": "Survey Feedback - Score: {{survey.score}}",
"requester": {
"email": "{{contact.email}}"
},
"comment": {
"body": "Customer submitted survey with score {{survey.score}}"
}
}
}

Best Practices​

Security​

PracticeDescription
Keep secrets in headersPut API tokens in header values, which Pollarix encrypts at rest and masks in execution logs. Request bodies are not encrypted
Use HTTPSAlways use encrypted connections
Validate responsesCheck status before using data

Performance​

PracticeDescription
Keep requests minimalOnly send required data
Set timeoutsConfigure for slow APIs
Handle errorsUse condition steps for error paths

Debugging​

  1. Check execution logs for request/response details
  2. Verify URL variables are resolving correctly
  3. Test endpoints independently first
  4. Validate JSON syntax before saving

Troubleshooting​

Request Failed
ErrorCauseSolution
Connection refusedInvalid URL or server downVerify endpoint URL
401 UnauthorizedMissing/invalid authCheck authentication headers
403 ForbiddenInsufficient permissionsVerify API credentials
404 Not FoundWrong endpointCheck URL path
500 Server ErrorTarget API errorCheck API server logs
Response Mapping Failed
  • Verify JSON path syntax
  • Check response structure matches expected format
  • Use $ for root access
  • Test JSON path in online validator
Variable Not Resolving
  • Check variable exists and has value
  • Verify spelling and case
  • Ensure previous step completed successfully
Timeout Errors
  • External API may be slow
  • Consider async processing
  • Check API rate limits

Next Steps​

Was this page helpful?