Integration Procedure Invocation from REST APIs

With a REST API, you can use either a GET or a POST call to invoke an Integration Procedure and retrieve the result. The difference between the two is that a GET call can't pass data with a JSON request body.

You invoke a REST call with a URL formatted like this:

/services/apexrest/{namespace}/v1/integrationprocedure/{Type}_{SubType}/

The namespace is typically omnistudio. Specify the Type and SubType of the Integration Procedure.

You use parameters to pass data to an Integration Procedure in three ways:

  • As inline values in the URL path (GET or POST)

  • As query parameter=value pairs append to the URL (GET or POST)

  • By specifying a JSON request body (POST only)

Note
Note

When using an Integration Procedure with a REST API, follow these guidelines:

  • In JSON notation, curly braces are literal. They delimit JSON objects.

  • In REST URL notation, curly braces surround variable values that you must replace. Don't include the braces in an actual request.

  • Treat all parts of the REST URL as case-sensitive.

You can also set Integration Procedure options such as chainable or queueableChainable as query parameters with a REST call:

/services/apexrest/vlocity_ins/v1/integrationprocedure/Create_Cases/?queueableChainable=true

For an example of a REST call to an Integration Procedure, see Invoke a Chainable Integration Procedure with REST Calls.

  • Integration Procedure Invocation Using GET
    To request and receive JSON data results from an Integration Procedure, issue a GET call. With a GET call, you can specify inline URL path parameters and append query parameters to the URL. If you must pass data with a JSON request body, use a POST call instead.
  • Integration Procedure Invocation Using POST
    To send JSON data to and receive results from an Integration Procedure, issue a POST call. With a POST call, you can specify inline URL path parameters, append query parameters to the URL, and include a JSON request body.

Integration Procedure Invocation Using GET

To request and receive JSON data results from an Integration Procedure, issue a GET call. With a GET call, you can specify inline URL path parameters and append query parameters to the URL. If you must pass data with a JSON request body, use a POST call instead.

In this example, an Integration Procedure that creates cases requires a Contact name and returns the Id of the newly created case. The Contact name is appended to the URL as a query parameter. The value %20 is the URL-encoded space between the first and last names.

  • GET URL:

    /services/apexrest/vlocity_ins/v1/integrationprocedure/Create_Cases/?Contact=Dennis%20Reynolds
  • Result:

    {
      "Case": {
        "Id": "0036100001HDn3QAAT"
      }
    }

In this second example, the syntax of the URL looks like this:

/services/apexrest/{namespace}/v1/integrationprocedure/{Type}_{SubType}/{inlinevalue1}/{inlinevalue2}/?{Param1}={Value1}

You can call the URL with these values:

/services/apexrest/vlocity_cmt/v1/integrationprocedure/IP_Rest/Apple/Phones/?product=iPhoneX

The GET call sends this input to the Integration Procedure. Values passed in the URL path are added under the options node of the JSON, with keys named PathN.

{
  "options": {
    "Path1": "Apple",
    "Path2": "Phones",
    "product": "iPhoneX",
    "isDebug": "true"
  }

}

Integration Procedure Invocation Using POST

To send JSON data to and receive results from an Integration Procedure, issue a POST call. With a POST call, you can specify inline URL path parameters, append query parameters to the URL, and include a JSON request body.

In this example, an Integration Procedure that creates cases requires a Contact name and returns the Id of the newly created case. The Contact name is specified in a JSON request body.

  • POST URL:

    /services/apexrest/vlocity_ins/v1/integrationprocedure/Create_Cases/
  • POST JSON data:

    {
      "Contact": "Dennis Reynolds"
    }
  • Result:

    {
      "Case": {
        "Id": "0036100001HDn3QAAT"
      }
    }

In this second example, the syntax of a URL looks like this:

/services/apexrest/{namespace}/v1/integrationprocedure/{Type}_{SubType}/{inlinevalue1}/{inlinevalue2}/?{Param1}={Value1}

You can call the URL with these values:

/services/apexrest/vlocity_cmt/v1/integrationprocedure/IP_Rest/Apple/Phones/?product=iPhoneX

The POST call sends this input to the Integration Procedure. Values passed in the URL path are added under the options node of the JSON, with keys named PathN.

{
  "options": {
    "Path1": "Apple",
    "Path2": "Phones",
    "product": "iPhoneX",
    "isDebug": "true"
  }
}