Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
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
          RemoteCalls.remoteApiCallAsync

          RemoteCalls.remoteApiCallAsync

          Initiates remote calls to Salesforce and consumes the response from it. You can configure or customize business logic contracts in Visual Studio Code based Modeler to invoke remoteApiCallAsync with request payload. These APIs are governed by Apex REST API limits and support only JSON format response.

          Required Editions

          Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled

          Parameters

          This method takes a single object as a parameter and consists of these three parameters.

          • path - Specify a relative URL path as a string that starts with ‘/’. Required.
          • method - Specify a HTTP method. Optional. When a method isn’t specified, the request is considered ‌a GET type of REST request.
          • data - JSON string to be passed as request to remote call.

          Returns

          result (promise): The method returns a promise that’s fulfilled with data from the remote API. If the remote endpoint returns an error, it'll be included in the response from the promise. If there's an error that prevents the remote API from being invoked, the promise will be fulfilled with a JSON response that contains two attributes: success and message. The success attribute is set to false.

          In the business logic contract of your customization project, add this code to call the remotecallAPI: RemoteCalls.remoteCallApiAsync(<data>)

          Sample Code

          The definition must contain all mandatory parameters for GET and POST. Here are a few remoteApiCallAsync sample definitions.

          Sample GET requests:

          • RemoteCalls.remoteCallApiAsync({path:'/remoteapi'})
          • RemoteCalls.remoteCallApiAsync({ path:'/remoteapi', method: "GET" })

          Sample POST request:

          RemoteCalls.remoteCallApiAsync({ path:'/remoteapi', method: "POST", data: {} })

           
          Loading
          Salesforce Help | Article