banner



What Can You Do After You Register An External Service?

Earlier we enter the world of External Services, we have some prerequisites to consummate. In the past unit, we covered API specs and what constitutes a valid and supported one for External Services. In addition to a valid and supported schema, nosotros need a elementary way to secure our external web service and our Salesforce org. For this task, we tin use Named Credentials to authenticate our callouts to the bank service endpoints.

In a typical project, the external web service provider would supply the elements for a Named Credential. Those elements include the URL of a callout endpoint and its required authentication parameters. In the last unit, nosotros said that API specs incorporate the endpoint information and authentication parameters for REST-based API web services. We're going to use this information to define a Named Credential for our org. Go ahead and attempt it out in your Trailhead Playground.

  1. From Setup, enter Named Credentials in the Quick Detect box, so select Named Credentials.
  2. Click New Named Credential.
  3. For Label, utilize Bank.
  4. For Proper name, use Bank (in English language).
  5. For URL, apply https://th-external-services.herokuapp.com
  6. Go out other fields as they are and click Save.

You lot'll detect more resources on authentication and Named Credentials at the end of this unit. Note that in a real-earth example, you would additionally set the Authentication Protocol in Named Credentials besides equally specifying your Auth Provider definition (both configured in Setup).

Use the External Services Wizard to Register Your Web Service

Because we have a valid API spec, this part is unproblematic. Adding our bank external service in External Services tells Salesforce how information technology will interact.

  1. From Setup, enter External Services in the Quick Find box, so select External Services.
  2. Click New  External Service.
  3. For External Service Name, enter BankService (no infinite).
  4. For Select a Named Credential, select Bank(the Named Credential we only created).
  5. Select Service Schema Relative URL, and enter /accounts/schema. This cord is added to the Named Credential we merely fabricated. It's the relative URL that points to the API spec. Together, they course the full URL from our service provider. For example: https://thursday-external-services.herokuapp.com/accounts/schema.
  6. Click Save & Next.
  7. Select all of the Operations.
  8. Click Next.
  9. A list of External Service Actions appears. These actions are now available to y'all in Flow Builder. Use the scrollbar to view them all. The operations in your API spec have now get invocable deportment in Salesforce!
  10. Click Washed.

Here's an example of the External Service Actions page.

Yous can also view the list of actions by clicking on BankService in the main External Services folio.

We'll create a simple period in the next unit of measurement and evidence you lot how to notice the deportment in the Flow palette. For now, let'due south wait at the getAccount action and some of its parameters.

  • The getAccount action retrieves account information.
  • The accountName parameter specifies the account.
  • There are several output parameters for the getAccount activeness, besides. The codes, such as 200, correlate to specific response codes divers in the API spec. We'll talk over these more in the next unit of measurement, but you lot tin likewise run into these definitions nicely formatted in the Swagger Editor when you validate the API spec's schema.

If you've been with united states since unit one, we've now covered the first four steps discussed in that unit of measurement:

  1. An external services provider, such as a bank, shares their Rest-based API spec: We got this data from our fictional bank.
  2. Based on the OpenAPI specification, the spider web service provider, a developer (or maybe you) creates a JSON-based schema definition that describes the bank's API: While nosotros didn't create this API spec ourselves, we reviewed the elements of the schema and the requirements for a supported one. When yous work with external services, y'all or your developer can define the schema y'all demand for your employ case.
  3. A Salesforce ambassador declaratively creates a Named Credential to authenticate to the service endpoint using the URL provided past the external service provider: We divers our named credential, https://thursday-external-services.herokuapp.com.
  4. A Salesforce ambassador declaratively registers the service and uses both the API spec and Named Credential during the registration process: We but registered our first external service and looked at the actions in the wizard.

Source: https://trailhead.salesforce.com/en/content/learn/modules/external-services/register-an-external-service

Posted by: croninhearating.blogspot.com

0 Response to "What Can You Do After You Register An External Service?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel