SalesforceApexRestOperator¶
Use the SalesforceApexRestOperator
to execute Apex Rest.
Using the Operator¶
You can also use this library to call custom Apex methods:
This would call the endpoint https://<instance>.salesforce.com/services/apexrest/User/Activity
with payload
as
the body content encoded with json.dumps
payload = {"activity": [{"user": "12345", "action": "update page", "time": "2014-04-21T13:00:15Z"}]}
apex_operator = SalesforceApexRestOperator(
task_id="apex_task", method="POST", endpoint="User/Activity", payload=payload
)
You can read more about Apex on the Force.com Apex Code Developer’s Guide.