- Issue created by @camoa
- πΊπΈUnited States camoa
Call Salesforce API action implemented and committed.
What it does: Make direct calls to any Salesforce REST API endpoint with full response access. Supports standard REST API, custom Apex endpoints, Composite API, and more. No more custom code needed for complex Salesforce integrations.
Key features:
- All HTTP methods: GET, POST, PUT, PATCH, DELETE
- Automatic path detection (relative for standard API, absolute for Apex)
- Request body support with JSON validation
- Custom headers configuration
- Full response object access (MDVIP compatible)
Available tokens:
- Response data:
[token:data]
(parsed JSON),[token:raw_body]
(raw string) - HTTP metadata:
[token:status_code]
,[token:reason_phrase]
,[token:protocol_version]
- Headers:
[token:headers]
(all),[token:content_type]
,[token:api_usage]
(Sforce-Limit-Info) - Status flags:
[token:success]
(1 if 2XX),[token:is_json]
- SObject helpers:
[token:fields:FieldName]
,[token:record_id]
,[token:sobject_type]
- Error handling:
[token:error]
,[token:request_endpoint]
,[token:request_method]
Example usage:
- Get record:
sobjects/Account/001D000000AbcDE
- SOQL query:
query?q=SELECT Id, Name FROM Contact LIMIT 10
- Custom Apex:
/services/apexrest/MyService/method
- Composite API:
composite/tree/Account
Testing: Successfully tested with multiple endpoints. Response tokens properly populated, status codes accessible, API usage tracking working. Created test controller and Drush commands for easy testing.
Files added/changed:
src/Plugin/Action/SalesforceCallApi.php
(new action)config/schema/salesforce_eca.schema.yml
(configuration schema)src/Controller/SalesforceEcaTestController.php
(test controller)src/Commands/SalesforceEcaCommands.php
(Drush commands)
Now you can call any Salesforce API endpoint directly from ECA workflows without writing custom code. This enables complex integrations like custom Apex calls, bulk operations, and advanced error handling.