API Triggers
API triggers send your scraped data to web API endpoints. Whether you need to push data to a REST API, execute a GraphQL mutation, or call a SOAP web service, RTILA X has a trigger for it.
API triggers are the most versatile trigger category because virtually every modern application exposes an API. If your destination has an API, you can send data to it.
REST API
Section titled “REST API”The REST API trigger sends data to any REST API endpoint using standard HTTP methods. This is the most commonly used API trigger because REST APIs are the most common type of web API.
Description
Section titled “Description”The REST API trigger makes an HTTP request to a specified URL. You can choose the HTTP method (GET, POST, PUT, DELETE, PATCH), include custom headers, add query parameters, and send a JSON request body. The response is stored in an output variable for use by subsequent triggers.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | ✅ Yes | “” | The API endpoint URL to send the request to. Supports ${variable} substitution. |
| method | string | ✅ Yes | “GET” | The HTTP method. Options: GET, POST, PUT, DELETE, PATCH. |
| headers | object | No | {} | Custom HTTP headers as key-value pairs. Example: {"Authorization": "Bearer ${api_key}", "Content-Type": "application/json"}. |
| params | object | No | {} | URL query parameters as key-value pairs. Example: {"page": "1", "limit": "20"}. |
| json_data | object | No | {} | The JSON request body for POST, PUT, or PATCH requests. Supports ${variable} substitution. |
Example: Send Data to an API
Section titled “Example: Send Data to an API”{ "url": "https://api.example.com/products", "method": "POST", "headers": { "Authorization": "Bearer ${api_key}", "Content-Type": "application/json" }, "json_data": { "name": "${product_name}", "price": "${product_price}", "source": "${page_url}" }}Example: Call an API with Query Parameters
Section titled “Example: Call an API with Query Parameters”{ "url": "https://api.example.com/search", "method": "GET", "params": { "q": "${search_term}", "page": "1", "limit": "50" }}Response Format
Section titled “Response Format”The REST API trigger stores the response in the output variable with these fields:
| Field | Type | Description |
|---|---|---|
| status | number | The HTTP status code (e.g., 200, 404, 500). |
| statusText | string | The HTTP status text (e.g., “OK”, “Not Found”). |
| headers | object | Response headers as key-value pairs. |
| body | string | The raw response body as a string. |
| json | object or null | The parsed JSON response, or null if not valid JSON. |
- Use
POSTfor creating new records,PUTfor updating existing records, andPATCHfor partial updates. - Always include the
Content-Type: application/jsonheader when sending JSON data. - Use
${variable}substitution in the URL, headers, and body to make your API calls dynamic. - Check the response status code in subsequent triggers to verify the API call succeeded.
GraphQL API
Section titled “GraphQL API”The GraphQL API trigger executes GraphQL queries or mutations against a GraphQL endpoint. GraphQL is a modern query language that lets you request exactly the data you need.
Description
Section titled “Description”The GraphQL API trigger sends a GraphQL query or mutation to a GraphQL endpoint. You provide the GraphQL query string and optional variables. The response is stored in an output variable.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | ✅ Yes | “” | The GraphQL endpoint URL. Example: https://api.example.com/graphql. |
| query | string | ✅ Yes | “” | The GraphQL query or mutation string. Supports ${variable} substitution. |
| variables | object | No | {} | GraphQL variables as key-value pairs. Example: {"id": "${product_id}"}. |
| headers | object | No | {} | Custom HTTP headers. Example: {"Authorization": "Bearer ${api_key}"}. |
Example: Execute a GraphQL Mutation
Section titled “Example: Execute a GraphQL Mutation”{ "url": "https://api.example.com/graphql", "query": "mutation CreateProduct($name: String!, $price: Float!) { createProduct(name: $name, price: $price) { id name price } }", "variables": { "name": "${product_name}", "price": "${product_price}" }, "headers": { "Authorization": "Bearer ${api_key}" }}Example: Execute a GraphQL Query
Section titled “Example: Execute a GraphQL Query”{ "url": "https://api.example.com/graphql", "query": "query GetProduct($id: ID!) { product(id: $id) { name price description } }", "variables": { "id": "${product_id}" }}Response Format
Section titled “Response Format”The GraphQL API trigger stores the response in the output variable with these fields:
| Field | Type | Description |
|---|---|---|
| data | object | The GraphQL response data. |
| errors | array or null | Any GraphQL errors returned by the server. |
- Use GraphQL mutations for creating or updating data.
- Use GraphQL queries for reading data.
- GraphQL variables are passed separately from the query string, making them safer than string interpolation.
- Always include authentication headers if your GraphQL endpoint requires them.
SOAP API
Section titled “SOAP API”The SOAP API trigger calls SOAP web services using WSDL-based service definitions. SOAP is an older but still widely used protocol, especially in enterprise environments.
Description
Section titled “Description”The SOAP API trigger calls a SOAP web service operation. You provide the WSDL URL, service name, port name, operation name, and any arguments. The response is stored in an output variable.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| wsdl_url | string | ✅ Yes | “” | The URL of the WSDL file that describes the SOAP service. |
| service_name | string | ✅ Yes | “” | The name of the service as defined in the WSDL. |
| port_name | string | ✅ Yes | “” | The port (binding) name from the WSDL. |
| operation_name | string | ✅ Yes | “” | The operation (method) to call. |
| arguments | object | No | {} | Operation arguments as key-value pairs. Supports ${variable} substitution. |
Example: Call a SOAP Service
Section titled “Example: Call a SOAP Service”{ "wsdl_url": "https://api.example.com/service?wsdl", "service_name": "ProductService", "port_name": "ProductServicePort", "operation_name": "CreateProduct", "arguments": { "name": "${product_name}", "price": "${product_price}" }}Response Format
Section titled “Response Format”The SOAP API trigger stores the response in the output variable. The format depends on the SOAP service’s response structure.
- SOAP services are common in enterprise environments (banking, healthcare, government).
- The WSDL URL describes the service’s operations, parameters, and response formats.
- You can find the service name, port name, and operation name by examining the WSDL file.
- SOAP arguments are passed as an object with key-value pairs matching the operation’s expected parameters.
Choosing the Right API Trigger
Section titled “Choosing the Right API Trigger”| Scenario | Recommended Trigger |
|---|---|
| Sending data to a modern web API | REST API |
| Creating records via API | REST API with POST method |
| Updating records via API | REST API with PUT or PATCH method |
| Querying data from an API | REST API with GET method |
| Working with a GraphQL endpoint | GraphQL API |
| Calling an enterprise SOAP service | SOAP API |
| Sending webhooks | REST API with POST method |
| Calling a third-party API | REST API |
Error Handling
Section titled “Error Handling”API triggers can fail for various reasons:
| Error | Cause | Solution |
|---|---|---|
| Connection timeout | The API server is unreachable | Check the URL and your internet connection |
| 401 Unauthorized | Invalid or missing authentication | Check your API key or authentication headers |
| 403 Forbidden | Insufficient permissions | Check your API permissions |
| 404 Not Found | Invalid URL | Verify the API endpoint URL |
| 429 Too Many Requests | Rate limit exceeded | Add delays between requests or reduce request frequency |
| 500 Internal Server Error | Server-side error | Check the API server status |
| Invalid JSON | Malformed request body | Check your JSON syntax |
Tip: Use the response status code in subsequent triggers to handle errors gracefully. For example, you can use an if trigger to check if the status code is 200 before proceeding.