Newer Version Available

This content describes an older version of this product. View Latest

ExternalServiceRegistration

Represents the External Service configuration for an org. This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

ExternalServiceRegistration components have the suffix .externalServiceRegistration and are stored in the externalServiceRegistrations folder.

Version

ExternalServiceRegistration components are available in API version 39.0 and later.

In API version 47.0 and earlier, External Services supported Interagent and a limited subset of OpenAPI 2.0. As of API version 48.0, External Services supports OpenAPI 2.0 but doesn’t support InteragentHyperSchema. As of API version 54.0, External Services supports a limited subset of OpenAPI 3.0. See External Services Considerations in Salesforce Help.

Note

Fields

Field Name Field Type Description
description string The external service description defined when the service is created.
label string Required. The service name as it appears on the External Services wizard.
namedCredential string The reference by name to be used for the service.
NamedCredentialReferenceId reference The reference by ID to be used for the named credential. When used, supersedes namedCredential. Available in API version 57.0 and later.
operations ExternalServiceOperation[] Items defined for this operation.
registrationProvider string Reserved for future use.
registrationProviderType ExternalServiceRegistrationProviderType (enumeration of type string) Indicates the source of the API specification registered with the External Services wizard. Valid values include:
  • Custom - The API spec was manually configured.
  • ExternalConnector - Reserved for future use.
  • Heroku - (Pilot) The API spec represents a Heroku app. Reserved for future use.
  • MuleSoft - The API spec was selected from MuleSoft.
  • SchemaInferred - The API spec was provided during the HTTP Callout configuration process. Available in API version 57.0 and later.
schema string The content of the OpenAPI 2.0 or OpenAPI 3.0 schema in JSON or YAML format. Nillable.
schemaAbsoluteUrl string The full, absolute URL to the schema. Populated when a user selects Absolute URL during registration.
schemaType string The schema format. OpenAPI for Open API 2.0 or InteragentHyperSchema for API version 47.0 and earlier. If not specified, schema type is derived based on the schema content. Nillable.
schemaUploadFileExtension string The file's extension. Populated when a user selects Upload from local during registration.
schemaUploadFileName string The file's name without the file extension. Populated when a user selects Upload from local during registration.
schemaUrl string The path should begin with "/" and be relative to the named credential endpoint.
serviceBinding string Used to map non-supported media types for this external service registration to supported media types. Nillable. Available in API version 53.0 and later.
status string Required. Indicates service registration status. Valid values include:
  • complete - The API spec is valid and the registration is ready to use.
  • incomplete - The service registration hasn’t completed.
systemVersion int The internal version of External Services used to register the API specification. Available in API version 55.0 and later.
  • 1 - Retired legacy External Services.
  • 2 - External Services with limitations on object and operation name length.
  • 3 - Current version. External Services with automatically derived developer names fitting within 80 characters.

ExternalServiceOperation

Field Name Field Type Description
active boolean Required. Indicates whether the operation is active (true), or inactive (false).
name string Required. The operation’s name.

Declarative Metadata Sample Definition

The following is an example of an ExternalServiceRegistration component that references an external credit service.

1<?xml version="1.0" encoding="UTF-8"?>
2<ExternalServiceRegistration xmlns="http://soap.sforce.com/2006/04/metadata">
3  <label>BankService</label>
4  <namedCredential>Bank</namedCredential>
5  <schema>{
6  "swagger": "2.0",
7  "basePath": "/",
8  "info": {
9    "version": "1.0",
10    "title": "External Service for demo bank",
11    "description": "### External Service for demo bank",
12    "x-vcap-service-name": "DemoBankRestServices"
13  },
14  ...
15  "paths": {
16  "/accounts/{accountName}": {
17      ...
18    }
19  },
20  "definitions": {
21    "accountDetails": {
22      ...
23    },
24    "errorModel": {
25      ...
26    }
27  }
28}</schema>
29  <schemaType>OpenApi</schemaType>
30  <schemaUrl>/accounts/schema</schemaUrl>
31  <status>Complete</status>
32</ExternalServiceRegistration>

serviceBinding

The following JSON-encoded string defines the mapping of a non-supported media type to a supported media type for external service request and response body serialization.

1{"compatibleMediaTypes":{
2    "application/x-acme-json":"application/json"
3}}

The non-supported media type application/x-acme-json is mapped to the supported media type application/json for this External Services registration. The External Services runtime takes into account the non-supported media type for request and response header processing and serializes the request and response content by the mapped supported media type.

Wildcard Support in the Manifest File

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.