Newer Version Available
Authentication, Versioning, and All That Good Stuff
Learn the high-level facts about how to use User Interface API. How do you
authenticate? How is the API versioned? What are the rate limits? All the information you
need, available at a glance.
- Authentication
- Like other Salesforce REST APIs, User Interface API uses OAuth 2.0.
- Versioning
- User Interface API is versioned. Specify the API version number in each request.
1GET https://{your_salesforce_instance}.salesforce.com/services/data/v40.0/ui-api - Error Handling
- The response header contains an HTTP status code. If the response isn’t successful, the response body contains an error message, and if appropriate, information about the field or object where the error occurred.
- Rate Limiting
- User Interface API requests are subject to rate limiting. User Interface API has a per user, per application, per hour rate limit. When you exceed the rate limit, all User Interface API resources return a 503 Service Unavailable error code.
- Required Fields
- When you’re building UI, to determine which fields to mark as required for create and update, use the ObjectInfo.fields[].required property.
- In the Salesforce user interface, an admin with “Customize Application” permission can mark a field as required in a layout. Use the Record Layout Item.required property to tell you whether a field is required in a layout for create and update.
- Response Filtering
- User Interface API is built on the same REST framework as Chatter REST API and observes the same filtering rules.
- Also, several User Interface API resources support additional parameters that change the response
to include what your UI needs.
-
formFactor—The layout display size for the record.
- Large—(Default) Use this value to get a layout for desktop display size.
- Medium—Use this value to get a layout for tablet display size.
- Small—Use this value to get a layout for phone display size.
-
layoutType—The layout type for the record.
- Compact—Use this value to get a layout that contains a record's key fields.
- Full—(Default) Use this value to get a full layout.
-
mode—The access mode for the record. This value determines which fields to
get from a layout. Layouts have different fields for create, edit, and view modes.
For example, formula fields are rendered in view mode, but not in create mode
because they’re calculated at run time, like formulas in a spreadsheet.
- Create—Use this mode if you intend to build UI that lets a user create a record. This mode is used by the /ui-api/record-defaults/create/{apiName} resource.
- Edit—Use this mode if you intend to build UI that lets a user edit a record. This mode is used by the /ui-api/record-defaults/clone/{recordId} resource.
- View—(Default) Use this mode if you intend to build UI that displays a record.
-
formFactor—The layout display size for the record.
- Supported Objects
- User Interface API supports custom objects and these objects that are available in Lightning Experience.
-
- Account
- AccountTeamMember
- Asset
- AssetRelationship
- AssignedResource
- AttachedContentNote
- Campaign
- CampaignMember
- Contact
- ContentWorkspace
- Contract
- ContractContactRole
- Entitlement
- EnvironmentHubMember
- LicensingRequest
- MaintenanceAsset
- MaintenancePlan
- MarketingAction
- MarketingResource
- OperatingHours
- ProcessInstanceHistory
- Quote
- ResourceAbsence
- ServiceAppointment
- ServiceResource
- ServiceResourceSkill
- ServiceTerritory
- ServiceTerritoryMember
- ServiceTerritoryLocation
- SkillRequirement
- SocialPost
- Tenant
- TimeSheet
- TimeSheetEntry
- TimeSlotShipment
- UsageEntitlement
- UsageEntitlementPeriod
- WorkOrder
- WorkOrderLineItem
- WorkType