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> 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 Apex Code Developer’s Guide.

Was this entry helpful?