Create a REST Web Service for Similar Records API

Here's how you create a REST Web Service for Similar Records API:

  1. Enter an active sandbox. From the navigator, go to Configurations > Application Composer > Common Setup > Web Services.
  2. On the Web Services page, click the new web service icon.
  3. On the Select Connection Type window, select REST and click OK.

    Create a REST web service.

  4. On the Create REST Web Service Connection page, enter a Connection Name. For example, SalesMLQueryAPISimilarRecords.

    Ensure that you use same connection name in Global Function Groovy as well. See the Create a Global Function for SalesMLQueryAPI Similar Records section in this topic.

  5. Leave the API-based REST Service checkbox blank.
  6. Select OData for REST Service Type.
  7. Enter a URL in the format, https://<host>/crmRestApi/salesML/resources/latest/salesMLQueryAPI For example, https://fuscdrmsmcxxx-fa-ext.oracle.com/crmRestApi/salesML/resources/latest/salesMLQueryAP.
  8. Select any of these values for Authentication Scheme:
    • Call with Basic Authentication.
    • Propagate user identity using SAML.
    • Propagate user identity using SAML over SSL.

      Here's a screenshot of the Create REST Web Service Connection page. The page shows the API name, REST service related settings selected, and a sample URL entered.


      Enter the web service details.
  9. Next, enter information in the Select and Configure Methods against the Resource section:
    1. Select the POST checkbox.
    2. Let the Method Name be POST and Format be JSON.
    3. Select Code Sample for Request Payload and enter this code into the text field:
      {
          "UseCaseCode" : "CX_SIMILAR_ACCOUNTS",
          "QueryMetadata":"whereClause:partyid =  300100006784914;numberOfRows:5"
      }
      
    4. Select Code Sample for Response Payload and enter this code into the text field:
      {
              "PARTYID": "300100006785018",
              "INDUSTRYCODE": "",
              "ORGANIZATIONSIZE": "",
              "STATE": "CA",
              "COUNTRY": "US",
              "POSTALCODE": "94065",
              "CITY": "Redwood Shores",
              "EMPLOYEESTOTAL": "1",
              "PROB": "0.8740334165546894",
              "CLUSTER_ID": "370",
              "RNK_CLUS2": "6"
      }
      

    Select the POST configure method.
  10. Click Save and Close.

    The application creates a web service for the similar records API.