Generic REST Reference (Standard UI Driven)

Let's see a few REST API examples to configure for the orchestrated system.

Create Account API Request Response

To configure Create Account API, use the following example:

Create Account API Details

  • Name: Create User
  • Method: POST
  • URL: <target-system>/admin/v1/Users
  • Headers
    • Content-Type: application/json
    • Authorization: <<CREDENTIALS>>. The value <<CREDENTIALS>> is resolved at runtime using OCI Vault or User entered credentials configured in Integration Settings.
  • Request Body for REST API

    The schemas attribute shown in the example:

    {
      "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
      "userName": "<EL>attributes.get('name').get(0)</EL>",
      "name": {
        "givenName": "<EL>attributes.get('firstName').get(0)</EL>",
        "familyName": "<EL>attributes.get('lastName').get(0)</EL>"
      },
      "password": "<EL>attributes.get('password').get(0)</EL>",
      "emails": [
        {
          "value": "<EL>attributes.get('email').get(0)</EL>",
          "type": "work",
          "primary": true
        }
      ]
    }
  • Response
    {
      "items": "",
      "responseValues": [],
      "attributes": [
        {
          "name": "uid",
          "value": "<JP>$.id</JP>",
          "responseOfSubRequestId": null,
          "items": null,
          "subAttributes": []
        }
      ]
    }
    This API creates a target account and maps the returned identifier to the uid attribute.

Group Search API

Group Search Account API Details

  • Name: Group Search (Permission)
  • Method: POST
  • URL: <target-system>/admin/v1/Groups/.search
  • Headers
    • Content-Type: application/json
    • Authorization: <<CREDENTIALS>>. The value <<CREDENTIALS>> is resolved at runtime using OCI Vault or User entered credentials configured in Integration Settings.
  • Request Body for REST API

    Include the schemas attribute shown in the example:

    {
      "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:SearchRequest"
      ],
      "attributes": [
        "displayName",
        "externalId"
      ],
      "sortBy": "displayName",
      "startIndex": "UQ:<EL>currentOffset</EL>",
      "count": "UQ:<EL>limit</EL>"
    }
  • Response

    Using the JSON Editor, use the following response:

    {
      "items": "<JP>$.Resources[*]</JP>",
      "responseValues": [],
      "attributes": [
        {
          "name": "uid",
          "value": "<JP>$.Resources[<EL>currentIndex</EL>].id</JP>",
          "responseOfSubRequestId": null,
          "items": null,
          "subAttributes": []
        },
        {
          "name": "name",
          "value": "<JP>$.Resources[<EL>currentIndex</EL>].displayName</JP>",
          "responseOfSubRequestId": null,
          "items": null,
          "subAttributes": []
        }
      ]
    }

Country Lookup API

  • Name: Search Countries
  • Method: GET
  • URL: <target-system>/admin/v1/AllowedValues/countries
  • Headers
    • Content-Type: application/json
    • Authorization: <<CREDENTIALS>>. The value <<CREDENTIALS>> is resolved at runtime using OCI Vault or User entered credentials configured in Integration Settings.
  • Response

    Using the JSON Editor, use the following response:

    {
      "items": "<JP>$.attrValues[*]</JP>",
      "responseValues": [],
      "attributes": [
        {
          "name": "uid",
          "value": "<JP>$.attrValues[<EL>currentIndex</EL>].value</JP>",
          "responseOfSubRequestId": null,
          "items": null,
          "subAttributes": []
        },
        {
          "name": "name",
          "value": "<JP>$.attrValues[<EL>currentIndex</EL>].value</JP>",
          "responseOfSubRequestId": null,
          "items": null,
          "subAttributes": []
        }
      ]
    }

Add Group Membership API

  • Name: Add Group Membership
  • Method: PATCH
  • URL: <target-system>/admin/v1/Groups/<EL>attributes.get('groups').get('uid').get(0)</EL>
  • Headers
    • Content-Type: application/json
    • Authorization: <<CREDENTIALS>>. The value <<CREDENTIALS>> is resolved at runtime using OCI Vault or User entered credentials configured in Integration Settings.
  • Request

    Use the following request:

    {
      "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
      ],
      "Operations": [
        {
          "op": "add",
          "path": "members",
          "value": [
            {
              "value": "<EL>attributes.get('uid').get(0)</EL>",
              "type": "User"
            }
          ]
        }
      ]
    }
  • Response
    Using the JSON Editor, use the following response:
    Name: uid
    Value: <EL>attributes.get('uid').get(0)</EL>
    Or, use the JSON Editor
    {
      "items": "",
      "responseValues": [],
      "attributes": [
        {
          "name": "uid",
          "value": "<EL>attributes.get('uid').get(0)</EL>",
          "responseOfSubRequestId": null,
          "items": null,
          "subAttributes": []
        }
      ]
    }

Delete Account API

  • Name: Delete Account API
  • Method: DELETE
  • URL: <target-system>/admin/v1/Users/<EL>attributes.get('uid').get(0)</EL>
  • Headers
    • Content-Type: application/json
    • Authorization: <<CREDENTIALS>>. The value <<CREDENTIALS>> is resolved at runtime using OCI Vault or User entered credentials configured in Integration Settings.
  • Parameter: forceDelete: true
  • Response

    Use the following response:

    Name: uid
    Value: <EL>attributes.get('uid').get(0)</EL>
    Or, use the JSON Editor
    {
      "items": "",
      "responseValues": [],
      "attributes": [
        {
          "name": "uid",
          "value": "<EL>attributes.get('uid').get(0)</EL>",
          "responseOfSubRequestId": null,
          "items": null,
          "subAttributes": []
        }
      ]
    }

Change Password API Request Response

The following example shows how to configure a Change Password API for an account. The Change Password API option is available when the __PASSWORD__ system attribute is configured for the account.

  • Name: Change Password
  • Method: PUT
  • URL: <target-host>/admin/v1/UserPasswordChanger/<EL>attributes.get('uid').get(0)</EL>
  • Headers
    • Content-Type: application/json
    • Authorization: <<CREDENTIALS>>. The value <<CREDENTIALS>> is resolved at runtime using OCI Vault or User entered credentials configured in Integration Settings.
  • Request

    Use the following JSON request:

    {
      "password": "<EL>attributes.get('password').get(0)</EL>",
      "schemas": [
        "<target-specific-schema>"
      ]
    }
    Or, use the JSON editor to configure the Change Password API
    {
      "id": "<UUID>",
      "name": "Change Password",
      "paginationType": "NONE",
      "method": "PUT",
      "url": "https://<target-host>/<change-password-endpoint>/<EL>attributes.get('uid').get(0)</EL>",
      "queryParameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "<<CREDENTIALS>>"
        }
      ],
      "body": {
        "type": "JSON",
        "textBody": {
          "password": "<EL>attributes.get('password').get(0)</EL>",
          "schemas": [
            "<target-specific-schema>"
          ]
        }
      },
      "subRequests": []
    }
    The URL and request body depend on the Change Password API exposed by the target application.

Response Validation

You can define a response validation expression for APIs to validate the business use cases and decide whether a 2xx response represents a successful operation.

Response validation checks the response body in addition to the HTTP status code

For example, consider a Create Account API that returns the following response:

{
  "id": "12345",
  "userName": "jsmith"
}
To verify that the username returned by the target application matches the account name in the request, specify the following in Response validation expression:
<EL>attributes.get('name').get(0)</EL> === <JP>$.userName</JP> ? 'success' : 'Failure : Error creating users'
After the execution of the operation, response validation expression is evaluated. If the expression returns success, the operation is marked as successful. Any other result marks the operation as failed, and that returned result is used as the failure message.