Loading
Extend Salesforce with Clicks, Not Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Create an API Destination and Connection in EventBridge

          Create an API Destination and Connection in EventBridge

          Create an API destination that uses a new connection. In this case, the API destination is a REST API call to Salesforce to publish a platform event back. The connection contains the authentication information for the API call. The connection accepts several authorization methods.

          Prerequisites:

          To use OAuth authorization for the API destination connection, create a connected app in Salesforce by following the steps in Create a Connected App in Salesforce for OAuth. You use the consumer key and secret from the connected app for the API destination connection.

          1. To create an API destination in the EventBridge console, follow the steps in Create an API destination in the AWS documentation. Then set up the configurations that are specific to Salesforce.
          2. Get your Salesforce org’s My Domain name, which is on the My Domain page in Setup. You use the name in the endpoint in the next step.
          3. For the event that you want to send to Salesforce, use an existing custom platform event or define a new one. For example, you can create a platform event with the label Carbon Estimate (API name Carbon_Estimate__e). To learn how to add fields to a platform event, see (Optional) Define a Platform Event. Add the same fields as the ones in the Carbon Comparison event. Also, add this field.
            Field type: Number (3,0), Label: Carbon Reduction Percentage
          4. For API destination endpoint, use this URL after replacing MyDomainName with your org’s domain name and MyEvent__e with the API name of the platform event to return: https://MyDomainName.my.salesforce.com/services/data/v58.0/sobjects/MyEvent__e
            For example, for the Carbon Estimate event, the URL is: https://MyDomainName.my.salesforce.com/services/data/v58.0/sobjects/Carbon_Estimate__e
          5. For HTTP method, select POST.
          6. For the connection, select Create a new connection, and enter a connection name.
          7. For Destination type, select Partners, and then select Salesforce from Partner Destinations.
            If you’re setting up OAuth authorization, provide this information for your Salesforce org.
          8. For Authorization type, make sure that OAuth Client Credentials is selected.
          9. For Authorization endpoint, replace the populated endpoint with one of these options.
            1. If using a production org, enter this URL, and replace MyDomainName with your org’s My Domain name: https://MyDomainName.my.salesforce.com/services/oauth2/token
            2. If using a sandbox without enhanced domains, enter this URL, and replace MyDomainName with your org’s My Domain name and SandboxName with your sandbox name: https://MyDomainName--SandboxName.my.salesforce.com/services/oauth2/token
            3. If using a sandbox with enhanced domains, enter this URL, and replace MyDomainName with your org’s My Domain name and SandboxName with your sandbox name: https://MyDomainName--SandboxName.sandbox.my.salesforce.com/services/oauth2/token
          10. For HTTP method, select POST.
          11. For Client ID, enter the consumer key from the connected app in Salesforce.
          12. For Client secret, enter the consumer secret from the connected app in Salesforce.
          13. Add OAuth HTTP parameters.
            1. Parameter: Body field, Key: grant_type, Value: client_credentials
          Note
          Note If your Salesforce org uses multi-factor authentication (MFA) for API access, users must complete a second authentication challenge to access Salesforce APIs. For more information, see Set Multi-Factor Authentication Login Requirements for API Access.

          After you create the API destination, you can create a rule whose target is the destination. See Create an EventBridge Rule and Connect it to the API Destination.

           
          Loading
          Salesforce Help | Article