This extension provides custom formula functions, allowing users to send HTTP/REST requests directly from record formulas (e.g., before-save scripts, calculated fields, or workflow actions).
This is ideal for integrating with third-party APIs for data validation, real-time lookups, or triggering external systems.
Sends a cURL-based HTTP request (GET, POST, PUT, PATCH, DELETE).
Retrieves the result of the immediately preceding send call.
Example: Sending Data (POST Request)
Code & Download: https://github.com/tanelaavistu/astro-request-espo
This is ideal for integrating with third-party APIs for data validation, real-time lookups, or triggering external systems.
PHP Code:
ext\astroRequest\send(URL, [METHOD], [DATA], [HEADERS]);
PHP Code:
ext\astroRequest\lastResponse([FIELD]);
Example: Sending Data (POST Request)
PHP Code:
// Base data
$url = 'https://your-url.here/api/v1/testing';
$method = 'POST';
// Create data object
$data = object\create();
object\set($data, 'id', entity\attribute('id'));
// Create headers object
$headers = object\create();
object\set($headers, 'Authorization', 'Bearer your-token-here');
// Send request
$success = ext\astroRequest\send($url, $method, $data, $headers);
// Optional for the formula sandbox
if($success) {
$statusCode = ext\astroRequest\lastResponse('statusCode');
output\printLine($statusCode);
$responseBody = ext\astroRequest\lastResponse('body');
output\printLine($responseBody);
} else {
$error = ext\astroRequest\lastResponse('error');
output\printLine($error);
}
Code & Download: https://github.com/tanelaavistu/astro-request-espo
