Newer Version Available

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

User Interface API Quick Start

The best way to learn an API is to use it. Let's go!

Sign up for a Salesforce Developer Edition (also known as a DE org).

This quick start makes a request to the Record UI resource, /ui-api/record-ui/{recordIds}. This resource returns all the information necessary to display a record in an app: layout metadata, object metadata, and record data.

  1. Go to the Workbench API utility.
  2. Log in to your DE org.
  3. Select utilities | Rest Explorer.
  4. Make a GET request to /ui-api/object-info/.
    The response is a directory of all the objects that User Interface API supports and the context user has access to. Grab an object apiName from the response to use in the next request. This example uses the Account object.
  5. Make a GET request to /query?q=SELECT Id FROM {objectApiName}.
    Here’s an example request:
    The Record UI resource requires a record Id. Grab one from the response to use in the next request.
  6. Make a GET request to /ui-api/record-ui/{recordIds}. Substitute the record ID from the previous step.
    Here's an example request:
    Use request parameters to specify the form factor (Large, Medium, Small), layout type (Compact, Full), and access mode (Create, Edit, View) of the record (or records). This example uses the default values, which are Large form factor, Full layout, and View mode.
The response includes nested response bodies. Each response body is a map because you can pass a list of record IDs to the request (for example, /ui-api/record-ui/001R0000003GeJ1IAK,001R0000003GKR0IAO). In our example, we passed only 1 record ID.
  • layoutUserStates—A map of layout user state IDs to user state information for each layout section
  • layouts—A map of object API names to user type layout information for each object
  • objectInfos—A map of object API names to metadata for each object
  • records—A map of record IDs to data for each record