Lightning API Developer Guide

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 59

Lightning API Developer Guide
Version 39.0, Spring 17
@salesforcedocs
Last updated: March 10, 2017
© Copyright 20002017 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com, inc.,
as are other names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS
Chapter 1: Get Started with Lightning API ...................................1
Lightning API Quick Start .................................................3
Status Codes and Error Responses ..........................................8
Chapter 2: Lightning API Resources ......................................11
Record UI, Get .......................................................11
Record Layout, Get ....................................................13
Object Info, Get ......................................................15
Records, Get, Delete, Patch ..............................................16
Records, Batch Get ....................................................19
Records, Post ........................................................21
Clone Record Defaults, Get ..............................................26
Create Record Defaults, Get ..............................................27
Picklist Values, Get ....................................................28
Chapter 3: Lightning API Request Bodies ..................................30
Record Input ........................................................30
Chapter 4: Lightning API Response Bodies ................................32
Lightning API Top-Level Response Bodies .....................................32
Batch Results ....................................................33
Object Info ......................................................33
Picklist Values ...................................................34
Record Data .....................................................35
Record Defaults ..................................................36
Record Layout ...................................................36
Record UI ......................................................37
Lightning API Nested Response Bodies ......................................38
Batch Result Item .................................................39
Canvas Layout Component ..........................................40
Custom Link Layout Component ........................................41
Error Message ...................................................42
Error with Output ..................................................42
Field ..........................................................43
Field Layout Component .............................................45
Field Value ......................................................46
Filtered Lookup Info ................................................46
Lead Status Picklist Value Attributes .....................................46
Location Field ....................................................47
Opportunity Stage Picklist Value Attributes .................................47
Picklist Value ....................................................48
Record Exceptions .................................................48
Record Exception Error .............................................49
Record Layout Component ...........................................49
Record Layout Item ................................................50
Record Layout Row ................................................50
Record Layout Section ..............................................50
Record Type Info ..................................................51
Reference To Info ..................................................51
Report Layout Component ...........................................52
Theme Info .....................................................52
Visualforce Layout Component ........................................53
INDEX ...........................................................54
Contents
CHAPTER 1 Get Started with Lightning API
EDITIONS
Available in: Developer
Edition
Use Lightning API to create native mobile apps and custom web apps with your own branding and
look and feel. A single REST request returns enough metadata, layout information, and data to
display, edit, or create a record! Lightning API supports most objects that are available in Lightning
Experience.
Note: Lightning API is available as a Developer Preview in all DE orgs. To use the API in
another type of org, contact Salesforce.
The Lightning API base URL is
https://{your_instance}.salesforce.com/services/data/v{api_version}/lapi.
Use the resources in the pilot version of Lightning API to display records.
GET /lapi/record-ui/{recordIds}
GET /lapi/layout/{objectApiName}
GET /lapi/object-info/{objectApiName}
GET /lapi/records/{recordId}
PATCH /lapi/records/{recordId}
DELETE /lapi/records/{recordId}
GET /lapi/records/batch/{recordIds}
POST /lapi/records
GET /lapi/record-defaults/clone/{recordId}
GET /lapi/record-defaults/create/{apiName}
GET /lapi/object-info/{objectApiName}/picklist-values/{recordTypeId}/{fieldApiName}
The first resource in the list, the Record UI resource, is the top dog of Lightning API. To display a record, your code makes this simple
request:
GET /lapi/record-ui/001R0000003GeJ1IAK
Behind the scenes, Salesforce does the heavy lifting.
Checks field-level security settings, sharing settings, and perms.
Makes SOQL queries to get record data.
Gets object metadata and theme information.
Gets layout information.
You are one happy developer, because Salesforce transforms the results into an easy-to-consume JSON response with all the metadata
and data you need to display a record.
Authorization
Like other Salesforce REST APIs, Lightning API uses OAuth 2.0.
1
Versioning
Lightning API is versioned. Specify the API version number in each request.
GET https://{your_instance}.salesforce.com/services/data/v39.0/lapi
Response Filtering
Lightning API is built on the same REST framework as Chatter REST API and observes the same filtering rules.
Also, several Lightning API resources support additional parameters that change the response to include what your UI needs.
formFactorThe layout display size for the record.
Large(Default) Use this value to get a layout for desktop display size.
MediumUse this value to get a layout for tablet display size.
SmallUse this value to get a layout for phone display size.
layoutTypeThe layout type for the record.
CompactUse this value to get a layout that contains a record's key fields.
Full(Default) Use this value to get a full layout.
modeThe 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 theyre
calculated at run time, like formulas in a spreadsheet.
CreateUse this mode if you intend to build UI that lets a user create a record. This mode is used by the
/lapi/record-defaults/create/{apiName} resource.
EditUse this mode if you intend to build UI that lets a user edit a record. This mode is used by the
/lapi/record-defaults/clone/{recordId} resource.
View(Default) Use this mode if you intend to build UI that displays a record.
Error Handling
The response header contains an HTTP status code. If the response isnt successful, the response body contains an error message,
and if appropriate, information about the field or object where the error occurred.
Rate Limiting
Lightning API requests are subject to rate limiting. Lightning API has a per user, per application, per hour rate limit. When you exceed
the rate limit, all Lightning API resources return a 503 Service Unavailable error code.
Required Fields
When youre building UI, to determine which fields to mark as required for create and update, use the
ObjectInfo.fields[].required property.
Lightning API Quick Start
The best way to learn an API is to use it. Let's go!
Status Codes and Error Responses
The response header contains an HTTP status code. If the response isnt successful, the response body contains an error message,
and if appropriate, information about the field or object where the error occurred.
SEE ALSO:
Digging Deeper into OAuth 2.0 on Force.com
2
Get Started with Lightning API
Lightning 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 top dog of Lightning APIs, the Record UI resource, /lapi/record-ui/{recordIds}.
This resource returns all the information you need 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. The Record UI resource requires a record ID. To grab one:
a. Click queries > SOQL Query.
b. Select an object, such as Account, select the Id field, and click Query.
c. Copy one of the IDs in the list of query results. Either keep it in your clipboard, or copy it to a notepad to grab later.
4. Select utilities > Rest Explorer.
5. Make a GET request to /lapi/record-ui/{recordIds}. Substitute the record ID from your SOQL query.
Here's a sample request:
GET /lapi/record-ui/001R0000003GeJ1IAK
The response includes three nested response bodies. Each response body is a map because you can pass a list of record Ids to the request
(for example, /lapi/record-ui/001R0000003GeJ1IAK,001R0000003GKR0IAO). In our example, we passed only one
record ID.
layoutsA map of object API names to layout information for each object
objectInfosA map of object API names to metadata for each object
recordsA map of record IDs to data for each record
Tip: To get these response bodies individually, use GET /lapi/layout/{objectApiName}, GET
/lapi/object-info/{objectApiName}, and GET /lapi/records/{recordId}.
{
"layouts" : {
"Account" : {
"012000000000000AAA" : {
"Full" : {
"View" : {
"id" : "00hR0000000NPP3IAO",
"layoutType" : "Full",
"mode" : "View",
"sections" : [ {
"columns" : 2,
"heading" : "Account Information",
"isCollapsed" : false,
"layoutRows" : [ {
"layoutItems" : [ {
"editableForNew" : false,
"editableForUpdate" : false,
"label" : "Account Owner",
"layoutComponents" : [ {
3
Lightning API Quick StartGet Started with Lightning API
"componentType" : "Field",
"label" : "Owner ID",
"value" : "OwnerId"
} ],
"lookupIdApiName" : "OwnerId",
"sortable" : false
}, {
"editableForNew" : true,
"editableForUpdate" : true,
"label" : "Phone",
"layoutComponents" : [ {
"componentType" : "Field",
"label" : "Account Phone",
"value" : "Phone"
} ],
"lookupIdApiName" : null,
"sortable" : false
} ]
}, {
"layoutItems" : [ {
"editableForNew" : true,
"editableForUpdate" : true,
"label" : "Account Name",
"layoutComponents" : [ {
"componentType" : "Field",
"label" : "Account Name",
"value" : "Name"
} ],
"lookupIdApiName" : "Id",
"sortable" : false
}, {
"editableForNew" : true,
"editableForUpdate" : true,
"label" : "Fax",
"layoutComponents" : [ {
"componentType" : "Field",
"label" : "Account Fax",
"value" : "Fax"
} ],
"lookupIdApiName" : null,
"sortable" : false
} ]
}, {
"layoutItems" : [ {
"editableForNew" : true,
"editableForUpdate" : true,
"label" : "Parent Account",
"layoutComponents" : [ {
"componentType" : "Field",
"label" : "Parent Account ID",
"value" : "ParentId"
} ],
"lookupIdApiName" : "ParentId",
"sortable" : false
4
Lightning API Quick StartGet Started with Lightning API
}, {
"editableForNew" : true,
"editableForUpdate" : true,
"label" : "Website",
"layoutComponents" : [ {
"componentType" : "Field",
"label" : "Website",
"value" : "Website"
} ],
"lookupIdApiName" : null,
"sortable" : false
} ]
} ],
"rows" : 3,
"useHeading" : false
},
... layout info about some sections removed to save space ...
{
"columns" : 3,
"heading" : "Custom Links",
"isCollapsed" : false,
"layoutRows" : [ {
"layoutItems" : [ {
"editableForNew" : false,
"editableForUpdate" : false,
"label" : "",
"layoutComponents" : [ {
"behavior" : "NewWindow",
"componentType" : "CustomLink",
"customLinkUrl" :
"/servlet/servlet.Integration?lid=00bR0000000I2Ja&eid=ENTITY_ID&ic=1",
"label" : "Google Search",
"value" : "GoogleSearch"
} ],
"lookupIdApiName" : null,
"sortable" : false
}, {
"editableForNew" : false,
"editableForUpdate" : false,
"label" : "",
"layoutComponents" : [ {
"behavior" : "NewWindow",
"componentType" : "CustomLink",
"customLinkUrl" :
"/servlet/servlet.Integration?lid=00bR0000000I2JY&eid=ENTITY_ID&ic=1",
"label" : "Google Maps",
"value" : "GoogleMaps"
} ],
"lookupIdApiName" : null,
"sortable" : false
}, {
"editableForNew" : false,
5
Lightning API Quick StartGet Started with Lightning API
"editableForUpdate" : false,
"label" : "",
"layoutComponents" : [ {
"behavior" : "NewWindow",
"componentType" : "CustomLink",
"customLinkUrl" :
"/servlet/servlet.Integration?lid=00bR0000000I2JZ&eid=ENTITY_ID&ic=1",
"label" : "Google News",
"value" : "GoogleNews"
} ],
"lookupIdApiName" : null,
"sortable" : false
} ]
}, {
"layoutItems" : [ {
"editableForNew" : false,
"editableForUpdate" : false,
"label" : "",
"layoutComponents" : [ {
"behavior" : "NewWindow",
"componentType" : "CustomLink",
"customLinkUrl" :
"/servlet/servlet.Integration?lid=00bR0000000I2Jb&eid=ENTITY_ID&ic=1",
"label" : "Hoovers Profile",
"value" : "HooversProfile"
} ],
"lookupIdApiName" : null,
"sortable" : false
} ]
} ],
"rows" : 2,
"useHeading" : true
} ]
}
}
}
}
},
"objectInfos" : {
"Account" : {
"apiName" : "Account",
"createable" : true,
"custom" : false,
"defaultRecordTypeId" : null,
"deleteable" : true,
"feedEnabled" : true,
"fields" : {
"AnnualRevenue" : {
"apiName" : "AnnualRevenue",
"calculated" : false,
"compound" : false,
"controllerName" : null,
"createable" : true,
"custom" : false,
6
Lightning API Quick StartGet Started with Lightning API
"dataType" : "Currency",
"extraTypeInfo" : null,
"filterable" : true,
"filteredLookupInfo" : null,
"highScaleNumber" : false,
"htmlFormatted" : false,
"label" : "Annual Revenue",
"length" : 0,
"nameField" : false,
"picklistValuesUrls" : { },
"precision" : 18,
"reference" : false,
"referenceTargetField" : null,
"referenceToInfos" : [ ],
"relationshipName" : null,
"required" : false,
"scale" : 0,
"sortable" : true,
"updateable" : true
},
... info about some fields removed to save space ...
"Website" : {
"apiName" : "Website",
"calculated" : false,
"compound" : false,
"controllerName" : null,
"createable" : true,
"custom" : false,
"dataType" : "Url",
"extraTypeInfo" : null,
"filterable" : true,
"filteredLookupInfo" : null,
"highScaleNumber" : false,
"htmlFormatted" : false,
"label" : "Website",
"length" : 255,
"nameField" : false,
"picklistValuesUrls" : { },
"precision" : 0,
"reference" : false,
"referenceTargetField" : null,
"referenceToInfos" : [ ],
"relationshipName" : null,
"required" : false,
"scale" : 0,
"sortable" : true,
"updateable" : true
}
},
"keyPrefix" : "001",
"label" : "Account",
"labelPlural" : "Accounts",
7
Lightning API Quick StartGet Started with Lightning API
"layoutable" : true,
"mruEnabled" : true,
"nameFields" : [ "Name" ],
"queryable" : true,
"recordTypeInfos" : {
"012000000000000AAA" : {
"available" : true,
"defaultRecordTypeMapping" : true,
"master" : true,
"name" : "Master",
"recordTypeId" : "012000000000000AAA"
}
},
"searchable" : true,
"themeInfo" : {
"color" : "7F8DE1",
"iconUrl" :
"https://na7-blitz02.soma.salesforce.com/img/icon/t4v35/standard/account_120.png"
},
"updateable" : true
}
},
"records" : {
"001R0000003GeJ1IAK" : {
"apiName" : "Account",
"fields" : {
"AnnualRevenue" : {
"displayValue" : "$50,000,000",
"value" : 5.0E7
},
... data for some fields removed to save space ...
"Website" : {
"displayValue" : null,
"value" : null
}
},
"id" : "001R0000003GeJ1IAK",
"recordTypeInfo" : null
}
}
}
SEE ALSO:
Digging Deeper into OAuth 2.0 on Force.com
Status Codes and Error Responses
The response header contains an HTTP status code. If the response isnt successful, the response body contains an error message, and
if appropriate, information about the field or object where the error occurred.
8
Status Codes and Error ResponsesGet Started with Lightning API
DescriptionHTTP Status Code
Success with GET, PATCH, or HEAD request200
Success with POST request201
Success with DELETE204
The request could not be understood, usually because the ID is not valid for the particular resource.400
The session ID or OAuth token has expired or is invalid. Or, if the request is made by a guest user, the
resource isnt accessible to guest users. The response body contains the message and errorCode.
401
The request has been refused. Verify that the context user has the appropriate permissions to access the
requested data, or that the context user is not an external user.
403
Either the specified resource was not found, or the resource has been deleted.404
A conflict has occurred. For example, an attempt was made to update a request to join a group, but that
request had already been approved or rejected.
409
A precondition has failed. For example, in a batch request, if haltOnError is true and a subrequest
fails, subsequent subrequests return 412.
412
An error has occurred within Force.com, so the request could not be completed. Contact Salesforce
Customer Support.
500
Too many requests in an hour or the server is down for maintenance.503
Example
This request requires a 15 or 18 character record ID, but this record ID doesn't contain enough characters:
GET /lapi/record-ui/003R000000
The response body is:
HTTP/1.1 400 Bad Request
Date: Tue, 29 Nov 2016 00:16:36 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: reflected-xss block;report-uri /_/ContentDomainCSPNoAuth?type=xss
Content-Security-Policy: referrer origin-when-cross-origin
Set-Cookie: BrowserId=q27CK9tSSCeI3klUaYMo6A;Path=/;Domain=.salesforce.com;Expires=Sat,
28-Jan-2017 00:16:36 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
[ {
"errorCode" : "ILLEGAL_QUERY_PARAMETER_VALUE",
9
Status Codes and Error ResponsesGet Started with Lightning API
"message" : "recordId should be a valid record ID: 003R000000"
} ]
SEE ALSO:
Digging Deeper into OAuth 2.0 on Force.com
10
Status Codes and Error ResponsesGet Started with Lightning API
CHAPTER 2 Lightning API Resources
This chapter contains Lightning API resources (also called endpoints).
Record UI, Get
Get layout information, metadata, and data to build UI for a single record or for a collection of records.
Record Layout, Get
Get metadata about page layouts for the specified object type.
Object Info, Get
Get metadata (field list and object properties) about a specific object.
Records, Get, Delete, Patch
Get, delete, and update a specific record's data.
Records, Batch Get
Get data for a batch of records.
Records, Post
Create a new record. Before you create a record, make a request to the Clone Record Default or Create Record Default resources to
get the default metadata and data.
Clone Record Defaults, Get
Get the default layout information, object information, and data for cloning a record. After getting the default values, make a request
to POST /lapi/records to create the record.
Create Record Defaults, Get
Get the default layout information and object information for creating a record. After getting the default values, make a request to
POST /lapi/records to create the record.
Picklist Values, Get
Get the values for a picklist.
Record UI, Get
Get layout information, metadata, and data to build UI for a single record or for a collection of records.
Resource
/lapi/record-ui/{recordIds}
Available version
39.0
HTTP methods
GET
11
Request parameters for GET
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0OptionalThe layout display size for the record. One
of these values:
StringformFactor
Large(Default) Use this value to
get a layout for desktop display size.
MediumUse this value to get a
layout for tablet display size.
SmallUse this value to get a
layout for phone display size.
39.0OptionalThe layout type for the record. A collection
of any of these values:
String[]layoutTypes
CompactUse this value to get a
layout that contains a record's key
fields.
Full(Default) Use this value to get
a full layout.
39.0OptionalThe access mode for the record. This value
determines which fields to get from a
String[]modes
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 theyre
calculated at run time, like formulas in a
spreadsheet. A collection of any of these
values:
CreateUse this mode if you
intend to build UI that lets a user
create a record. This mode is used by
the
/lapi/record-defaults/create/{apiName}
resource.
EditUse this mode if you intend
to build UI that lets a user edit a record.
This mode is used by the
/lapi/record-defaults/clone/{recordId}
resource.
View(Default) Use this mode if you
intend to build UI that displays a
record.
12
Record UI, GetLightning API Resources
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0OptionalA collection of optional field names. If a
field is accessible to the context user, its
String[]optionalFields
included in the response. If a field isnt
accessible to the context user, it isnt
included in the response, but it doesnt
cause an error. Specify optional field names
using the format:
{ObjectApiName}.{FieldName}
Response body for GET
Record UI
SEE ALSO:
Lightning API Quick Start
Record Layout, Get
Get metadata about page layouts for the specified object type.
Resource
/lapi/layout/{objectApiName}
Available version
39.0
HTTP methods
GET
Request parameters for GET
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0OptionalThe layout display size for the record. One
of these values:
StringformFactor
Large(Default) Use this value to
get a layout for desktop display size.
MediumUse this value to get a
layout for tablet display size.
SmallUse this value to get a
layout for phone display size.
13
Record Layout, GetLightning API Resources
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0OptionalThe layout type for the record. One of
these values:
StringlayoutType
CompactUse this value to get a
layout that contains a record's key
fields.
Full(Default) Use this value to get
a full layout.
39.0OptionalThe access mode for the record. This value
determines which fields to get from a
Stringmode
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 theyre
calculated at run time, like formulas in a
spreadsheet. One of these values:
CreateUse this mode if you
intend to build UI that lets a user
create a record. This mode is used by
the
/lapi/record-defaults/create/{apiName}
resource.
EditUse this mode if you intend
to build UI that lets a user edit a record.
This mode is used by the
/lapi/record-defaults/clone/{recordId}
resource.
View(Default) Use this mode if you
intend to build UI that displays a
record.
39.0OptionalThe ID of the record type (RecordType
object) for the new record. If not provided,
the default record type is used.
IdrecordTypeId
Response body for GET
Record Layout
SEE ALSO:
Lightning API Quick Start
14
Record Layout, GetLightning API Resources
Object Info, Get
Get metadata (field list and object properties) about a specific object.
Resource
/lapi/object-info/{objectApiName}
Available version
39.0
HTTP methods
GET
Request parameters for GET
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0OptionalThe layout type for the record. A collection
containing any of these values:
String[]layoutTypes
CompactUse this value to get a
layout that contains a record's key
fields.
Full(Default) Use this value to get
a full layout.
39.0OptionalThe access mode for the record. This value
determines which fields to get from a
String[]modes
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 theyre
calculated at run time, like formulas in a
spreadsheet. A collection containing any
of these values:
CreateUse this mode if you
intend to build UI that lets a user
create a record. This mode is used by
the
/lapi/record-defaults/create/{apiName}
resource.
EditUse this mode if you intend
to build UI that lets a user edit a record.
This mode is used by the
/lapi/record-defaults/clone/{recordId}
resource.
View(Default) Use this mode if you
intend to build UI that displays a
record.
15
Object Info, GetLightning API Resources
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0OptionalThe ID of the record type (RecordType
object) for the new record. If not provided,
the default record type is used.
IdrecordTypeId
Response body for GET
Object Info
SEE ALSO:
Lightning API Quick Start
Records, Get, Delete, Patch
Get, delete, and update a specific record's data.
Resource
/lapi/records/{recordId}
Available version
39.0
HTTP methods
GET, DELETE, PATCH
Request parameters for GET
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0Either fields or
layoutTypes is
required.
Specifies the fields to return. If this property
is specified, the response is a union of
fields and optionalFields.
If the context user doesnt have access to
a field, an error is returned.
String[]fields
If youre not sure whether the context user
has access to a field and you dont want
the request to fail if they dont, use the
optionalFields parameter instead.
16
Records, Get, Delete, PatchLightning API Resources
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0Either fields or
layoutTypes is
required.
Specifies the fields to return. If this property
is specified, the response is a union of
layoutTypes, modes, and
optionalFields.
A collection containing any of these values:
String[]layoutTypes
CompactUse this value to get a
layout that contains a record's key
fields.
Full(Default) Use this value to get
a full layout.
39.0Optional if the
layoutTypes
The access mode for the record. This value
determines which fields to get from a
layout. Layouts have different fields for
String[]modes
parameter is
create, edit, and view modes. For example, specified.
formula fields are rendered in view mode, Otherwise, this
but not in create mode because theyre parameter is
ignored.
calculated at run time, like formulas in a
spreadsheet. A collection containing any
of these values:
CreateUse this mode if you
intend to build UI that lets a user
create a record. This mode is used by
the
/lapi/record-defaults/create/{apiName}
resource.
EditUse this mode if you intend
to build UI that lets a user edit a record.
This mode is used by the
/lapi/record-defaults/clone/{recordId}
resource.
View(Default) Use this mode if you
intend to build UI that displays a
record.
39.0OptionalA collection of optional field names. If a
field is accessible to the context user, its
String[]optionalFields
included in the response. If a field isnt
accessible to the context user, it isnt
included in the response, but it doesnt
cause an error. Specify optional field names
using the format:
{ObjectApiName}.{FieldName}
17
Records, Get, Delete, PatchLightning API Resources
Response body for GET
Record Data
Request body for PATCH
Available
Version
Required or
Optional
DescriptionTypeName
39.0RequiredTo create a record, specify the API name
of an Object from which to create the
record. To update a record, use null.
StringapiName
39.0RequiredMap of field names to field values.
Format data types according to these rules:
Map<String,
Object>
fields
AddressJSON String
Base64JSON String
BooleanJSON Boolean, true or
false
CurrencyJSON Float
DateJSON string in correct format
DateTimeJSON string in ISO 8601
format
DoubleJSON Float
EmailJSON String
EncryptedStringJSON String
IntJSON Number
LocationJSON String
MultiPicklistJSON String
PercentJSON Float
PhoneJSON String
PicklistJSON String
ReferenceJSON String.
StringJSON String
TextAreaJSON String
TimeJSON String in format
HH:MM:SS
UrlJSON String
Response body for PATCH
Record Data
18
Records, Get, Delete, PatchLightning API Resources
Example for PATCH
PATCH /lapi/records/001R0000003Gjrt
{
"apiName": "Account",
"fields": {
"Name": "Universal Containers"
}
}
To provide an address, provide the individual fields as separate inputs. The compound field is only available in the response.
{
"apiName": "Account",
"fields" : {
"Name": "Local Boxes",
"BillingState": "WA",
"BillingStreet" : "123 Main Street",
"BillingCountry" : "USA"
}
}
SEE ALSO:
Records, Batch Get
Records, Post
Lightning API Quick Start
Records, Batch Get
Get data for a batch of records.
Resource
/lapi/records/batch/{recordIds}
Available version
39.0
HTTP methods
GET
Request parameters for GET
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0Either fields or
layoutTypes is
required.
Specifies the fields to return. If this property
is specified, the response is a union of
fields and optionalFields.
If the context user doesnt have access to
a field, an error is returned.
String[]fields
19
Records, Batch GetLightning API Resources
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
If youre not sure whether the context user
has access to a field and you dont want
the request to fail if they dont, use the
optionalFields parameter instead.
39.0Either fields or
layoutTypes is
required.
Specifies the fields to return. If this property
is specified, the response is a union of
layoutTypes, modes, and
optionalFields.
A collection containing any of these values:
String[]layoutTypes
CompactUse this value to get a
layout that contains a record's key
fields.
Full(Default) Use this value to get
a full layout.
39.0Optional if the
layoutTypes
The access mode for the record. This value
determines which fields to get from a
layout. Layouts have different fields for
String[]modes
parameter is
create, edit, and view modes. For example, specified.
formula fields are rendered in view mode, Otherwise, this
but not in create mode because theyre parameter is
ignored.
calculated at run time, like formulas in a
spreadsheet. A collection containing any
of these values:
CreateUse this mode if you
intend to build UI that lets a user
create a record. This mode is used by
the
/lapi/record-defaults/create/{apiName}
resource.
EditUse this mode if you intend
to build UI that lets a user edit a record.
This mode is used by the
/lapi/record-defaults/clone/{recordId}
resource.
View(Default) Use this mode if you
intend to build UI that displays a
record.
39.0OptionalA collection of optional field names. If a
field is accessible to the context user, its
String[]optionalFields
included in the response. If a field isnt
accessible to the context user, it isnt
included in the response, but it doesnt
20
Records, Batch GetLightning API Resources
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
cause an error. Specify optional field names
using the format:
{ObjectApiName}.{FieldName}
Response body for GET
Batch Results
SEE ALSO:
Clone Record Defaults, Get
Create Record Defaults, Get
Records, Get, Delete, Patch
Lightning API Quick Start
Batch Results
Records, Post
Create a new record. Before you create a record, make a request to the Clone Record Default or Create Record Default resources to get
the default metadata and data.
Resource
/lapi/records
Available version
39.0
HTTP methods
POST
Request body example
POST /lapi/records
{
"apiName": "Account",
"fields": {
"Name": "Universal Containers"
}
}
To provide an address, provide the individual fields as separate inputs. The compound field is only available in the response.
{
"apiName": "Account",
"fields" : {
"Name": "Local Boxes",
"BillingState": "WA",
"BillingStreet" : "123 Main Street",
21
Records, PostLightning API Resources
"BillingCountry" : "USA"
}
}
Request body for POST
Available
Version
Required or
Optional
DescriptionTypeName
39.0RequiredTo create a record, specify the API name
of an Object from which to create the
record. To update a record, use null.
StringapiName
39.0RequiredMap of field names to field values.
Format data types according to these rules:
Map<String,
Object>
fields
AddressJSON String
Base64JSON String
BooleanJSON Boolean, true or
false
CurrencyJSON Float
DateJSON string in correct format
DateTimeJSON string in ISO 8601
format
DoubleJSON Float
EmailJSON String
EncryptedStringJSON String
IntJSON Number
LocationJSON String
MultiPicklistJSON String
PercentJSON Float
PhoneJSON String
PicklistJSON String
ReferenceJSON String.
StringJSON String
TextAreaJSON String
TimeJSON String in format
HH:MM:SS
UrlJSON String
Response body for POST
Record Data
22
Records, PostLightning API Resources
Response body example
{
"apiName" : "Account",
"fields" : {
"AnnualRevenue" : {
"displayValue" : null,
"value" : null
},
"BillingCity" : {
"displayValue" : null,
"value" : null
},
"BillingCountry" : {
"displayValue" : null,
"value" : null
},
"BillingPostalCode" : {
"displayValue" : null,
"value" : null
},
"BillingState" : {
"displayValue" : null,
"value" : null
},
"BillingStreet" : {
"displayValue" : null,
"value" : null
},
"CreatedBy" : {
"displayValue" : "Deanna Li",
"value" : {
"apiName" : "User",
"fields" : {
"Id" : {
"displayValue" : "005R0000000IEDsIAO",
"value" : "005R0000000IEDsIAO"
},
"Name" : {
"displayValue" : "Deanna Li",
"value" : "Deanna Li"
}
},
"id" : "005R0000000IEDsIAO",
"recordTypeInfo" : null
}
},
"CreatedById" : {
"displayValue" : "005R0000000IEDsIAO",
"value" : "005R0000000IEDsIAO"
},
"CreatedDate" : {
"displayValue" : "11/22/2016 12:36 PM",
"value" : "2016-11-22T20:36:12.000Z"
23
Records, PostLightning API Resources
},
"Description" : {
"displayValue" : null,
"value" : null
},
"Fax" : {
"displayValue" : null,
"value" : null
},
"Industry" : {
"displayValue" : null,
"value" : null
},
"LastModifiedBy" : {
"displayValue" : "Deanna Li",
"value" : {
"apiName" : "User",
"fields" : {
"Id" : {
"displayValue" : "005R0000000IEDsIAO",
"value" : "005R0000000IEDsIAO"
},
"Name" : {
"displayValue" : "Deanna Li",
"value" : "Deanna Li"
}
},
"id" : "005R0000000IEDsIAO",
"recordTypeInfo" : null
}
},
"LastModifiedById" : {
"displayValue" : "005R0000000IEDsIAO",
"value" : "005R0000000IEDsIAO"
},
"LastModifiedDate" : {
"displayValue" : "11/22/2016 12:36 PM",
"value" : "2016-11-22T20:36:12.000Z"
},
"Name" : {
"displayValue" : "Universal Containers",
"value" : "Universal Containers"
},
"NumberOfEmployees" : {
"displayValue" : null,
"value" : null
},
"Owner" : {
"displayValue" : "Deanna Li",
"value" : {
"apiName" : "User",
"fields" : {
"Id" : {
"displayValue" : "005R0000000IEDsIAO",
24
Records, PostLightning API Resources
"value" : "005R0000000IEDsIAO"
},
"Name" : {
"displayValue" : "Deanna Li",
"value" : "Deanna Li"
}
},
"id" : "005R0000000IEDsIAO",
"recordTypeInfo" : null
}
},
"OwnerId" : {
"displayValue" : "005R0000000IEDsIAO",
"value" : "005R0000000IEDsIAO"
},
"ParentId" : {
"displayValue" : null,
"value" : null
},
"Phone" : {
"displayValue" : null,
"value" : null
},
"ShippingCity" : {
"displayValue" : null,
"value" : null
},
"ShippingCountry" : {
"displayValue" : null,
"value" : null
},
"ShippingPostalCode" : {
"displayValue" : null,
"value" : null
},
"ShippingState" : {
"displayValue" : null,
"value" : null
},
"ShippingStreet" : {
"displayValue" : null,
"value" : null
},
"Type" : {
"displayValue" : null,
"value" : null
},
"Website" : {
"displayValue" : null,
"value" : null
}
},
"id" : "001R0000003GeJ1IAK",
25
Records, PostLightning API Resources
"recordTypeInfo" : null
}
SEE ALSO:
Clone Record Defaults, Get
Create Record Defaults, Get
Records, Get, Delete, Patch
Lightning API Quick Start
Clone Record Defaults, Get
Get the default layout information, object information, and data for cloning a record. After getting the default values, make a request to
POST /lapi/records to create the record.
Resource
/lapi/record-defaults/clone/{recordId}
Available version
39.0
HTTP methods
GET
Request parameters for GET
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0OptionalThe layout display size for the record. One
of these values:
StringformFactor
Large(Default) Use this value to
get a layout for desktop display size.
MediumUse this value to get a
layout for tablet display size.
SmallUse this value to get a
layout for phone display size.
39.0OptionalThe ID of the record type (RecordType
object) for the new record. If not provided,
the default record type is used.
IdrecordTypeId
26
Clone Record Defaults, GetLightning API Resources
Response body for GET
Record Defaults
SEE ALSO:
Records, Post
Lightning API Quick Start
Create Record Defaults, Get
Get the default layout information and object information for creating a record. After getting the default values, make a request to POST
/lapi/records to create the record.
Resource
/lapi/record-defaults/create/{apiName}
Available version
39.0
HTTP methods
GET
Request parameters for GET
Available
Version
Required or
Optional
DescriptionTypeParameter
Name
39.0OptionalThe layout display size for the record. One
of these values:
StringformFactor
Large(Default) Use this value to
get a layout for desktop display size.
MediumUse this value to get a
layout for tablet display size.
SmallUse this value to get a
layout for phone display size.
39.0OptionalThe ID of the record type (RecordType
object) for the new record. If not provided,
the default record type is used.
IdrecordTypeId
Response body for GET
Record Defaults
SEE ALSO:
Records, Post
Lightning API Quick Start
27
Create Record Defaults, GetLightning API Resources
Picklist Values, Get
Get the values for a picklist.
Resource
/lapi/object-info/{objectApiName}/picklist-values/{recordTypeId}/{fieldApiName}
Available version
39.0
HTTP methods
GET
Response body for GET
Picklist Values
Example
When you make a request to /lapi/record-ui/{recordIds} or /lapi/object-info/{objectApiName}, if
the response includes a picklist field, it also includes a picklistValueUrl property. That property contains a Picklist Values
resource with the {objectApiName}, {recordTypeId}, and {fieldApiName} filled in, as in this example:
GET /services/data/v39.0/lapi/object-info/Account/picklist-values/012000000000000AAA/Type/
{
"controllerValues" : { },
"defaultValue" : null,
"url" :
"/services/data/v39.0/lapi/object-info/Account/picklist-values/012000000000000AAA/Type",
"values" : [ {
"attributes" : null,
"label" : "Analyst",
"picklistValueType" : "Standard",
"validFor" : [ ],
"value" : "Analyst"
}, {
"attributes" : null,
"label" : "Competitor",
"picklistValueType" : "Standard",
"validFor" : [ ],
"value" : "Competitor"
},
... some picklist values removed for space ...
{
"attributes" : null,
"label" : "Other",
"picklistValueType" : "Standard",
"validFor" : [ ],
"value" : "Other"
28
Picklist Values, GetLightning API Resources
} ]
}
SEE ALSO:
Record UI, Get
Object Info, Get
Lightning API Quick Start
29
Picklist Values, GetLightning API Resources
CHAPTER 3 Lightning API Request Bodies
The successful execution of a request to a resource can return a response body in JSON format.
A request to a resource always returns an HTTP response code, whether the request was successful or not.
Record Input
A description of a record to use in a request to create or update a record.
Record Input
A description of a record to use in a request to create or update a record.
Example
POST /lapi/records
{
"apiName": "Account",
"fields": {
"Name": "Universal Containers"
}
}
To provide an address, provide the individual fields as separate inputs. The compound field is only available in the response.
{
"apiName": "Account",
"fields" : {
"Name": "Local Boxes",
"BillingState": "WA",
"BillingStreet" : "123 Main Street",
"BillingCountry" : "USA"
}
}
Properties
Available
Version
Required or
Optional
DescriptionTypeName
39.0RequiredTo create a record, specify the API name
of an Object from which to create the
record. To update a record, use null.
StringapiName
30
Available
Version
Required or
Optional
DescriptionTypeName
39.0RequiredMap of field names to field values.
Format data types according to these rules:
Map<String,
Object>
fields
AddressJSON String
Base64JSON String
BooleanJSON Boolean, true or
false
CurrencyJSON Float
DateJSON string in correct format
DateTimeJSON string in ISO 8601
format
DoubleJSON Float
EmailJSON String
EncryptedStringJSON String
IntJSON Number
LocationJSON String
MultiPicklistJSON String
PercentJSON Float
PhoneJSON String
PicklistJSON String
ReferenceJSON String.
StringJSON String
TextAreaJSON String
TimeJSON String in format
HH:MM:SS
UrlJSON String
SEE ALSO:
Records, Post
31
Record InputLightning API Request Bodies
CHAPTER 4 Lightning API Response Bodies
A request to a resource returns a response body. Some response bodies also contain nested response bodies.
A request to a resource always returns an HTTP response code, whether the request was successful or not.
Lightning API Top-Level Response Bodies
These response bodies are returned from requests to Lightning API resources. They may contain nested response bodies.
Lightning API Nested Response Bodies
These response bodies are nested in top-level response bodies.
Lightning API Top-Level Response Bodies
These response bodies are returned from requests to Lightning API resources. They may contain nested response bodies.
A request to a resource always returns an HTTP response code, whether the request was successful or not.
Batch Results
The results from a request to a batch resource. Results include information for each subrequest in the batch.
Object Info
The metadata for an object.
Picklist Values
The picklist values for a field, scoped to a record type.
Record Data
The field data, API name, and record type information for a record.
Record Defaults
The default information and data needed to create or clone a record. Use these values in a request to POST /lapi/records.
Record Layout
The layout information for a record.
Record UI
The layout information, field information, and data for a record.
SEE ALSO:
Lightning API Nested Response Bodies
32
Batch Results
The results from a request to a batch resource. Results include information for each subrequest in the batch.
Available
Version
Filter Group
and Version
DescriptionTypeProperty
39.0Small, 39.0true if at least one of the results in the result set is an
HTTP status code in the 400 or 500 range; false
otherwise
BooleanhasErrors
39.0Small, 39.0Collection of batch result itemsBatch Result Item[]results
SEE ALSO:
Records, Batch Get
Object Info
The metadata for an object.
Available
Version
Filter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The object's API name.StringapiName
39.0Small, 39.0Indicates whether the object can be
created.
Booleancreateable
39.0Small, 39.0Indicates whether the object is custom.Booleancustom
39.0Medium, 39.0The ID for the default record type for this
object, if any. If there isnt a default type,
StringdefaultRecordTypeId
or if theres only a master type, this value
is null.
39.0Small, 39.0Indicates whether the object can be
deleted.
Booleandeleteable
39.0Medium, 39.0Indicates whether the object can have
feeds.
BooleanfeedEnabled
39.0Medium, 39.0A map of field API name to information
about the field. This map only contains
Map<String, Field>fields
fields relevant to the requested layout
and mode.
39.0Medium, 39.0The key prefix for IDs of this object.StringkeyPrefix
39.0Small, 39.0The object's display label.Stringlabel
39.0Medium, 39.0The plural form of the object's display
label.
StringlabelPlural
33
Batch ResultsLightning API Response Bodies
Available
Version
Filter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0Indicates whether the object can have
a layout.
Booleanlayoutable
39.0Small, 39.0Indicates whether the object can appear
in Most Recently Used lists.
BooleanmruEnabled
39.0Medium, 39.0A collection of the API names of the
fields used to identify the name field for
String[]nameFields
standard and custom objects. Typically
there is one name field per object,
except where FirstName and
LastName fields are used.
39.0Small, 39.0Indicates whether the object can be
queried by the context user.
Booleanqueryable
39.0Medium, 39.0A map of record type IDs to information
about the record type. All record types
Map<String,
Record Type Info>
recordTypeInfos
are visible whether or not the user has
access to them.
39.0Small, 39.0Indicates whether the object can be
searched.
Booleansearchable
39.0Medium, 39.0Theme information for the object.Theme InfothemeInfo
39.0Small, 39.0Indicates whether the object can be
updated.
Booleanupdateable
SEE ALSO:
Object Info, Get
Record UI
Clone Record Defaults, Get
Create Record Defaults, Get
Picklist Values
The picklist values for a field, scoped to a record type.
34
Picklist ValuesLightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0If the picklist is independent, the map is
empty.
If the picklist is dependent, this map
contains the following:
Map<String,
Integer>
controllerValues
If the controlling field is a picklist, the
picklist value is the value index.
If the controlling field is a boolean, 0
indicates false and 1 indicates
true. Values in the map are:
"false": 0
"true": 1
39.0Small, 39.0The default value for the picklist, or null
if there isn't one.
Picklist ValuedefaultValue
39.0Small, 39.0A self-reference URL back to the API that
can be used to retrieve this payload.
Stringurl
39.0Small, 39.0A list of the applicable values for this
object-record-type-field combination.
Picklist Value[]values
SEE ALSO:
Picklist Values, Get
Record Data
The field data, API name, and record type information for a record.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The record's API name.StringapiName
39.0Small, 39.0The field data for this record, matching the
requested layout and mode.
Map<String, Field
Value>
fields
39.0Small, 39.0The ID of this record.Stringid
35
Record DataLightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The record type info for this record, if any.Record Type InforecordTypeInfo
SEE ALSO:
Records, Get, Delete, Patch
Records, Post
Record UI
Clone Record Defaults, Get
Create Record Defaults, Get
Record Defaults
The default information and data needed to create or clone a record. Use these values in a request to POST /lapi/records.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Medium, 39.0Record layout information.Record Layoutlayout
39.0Big, 39.0Object metadata.Object InfoobjectInfo
39.0Small, 39.0Pre-populated record data.Record Datarecord
SEE ALSO:
Clone Record Defaults, Get
Create Record Defaults, Get
Records, Post
Record Layout
The layout information for a record.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The layout ID.Stringid
39.0Small, 39.0The layout type for the record. One of these
values:
StringlayoutType
CompactUse this value to get a
layout that contains a record's key fields.
Full(Default) Use this value to get
a full layout.
36
Record DefaultsLightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The access mode for the record. This value
determines which fields to get from a layout.
Stringmode
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 theyre calculated at run
time, like formulas in a spreadsheet. One of
these values:
CreateUse this mode if you intend
to build UI that lets a user create a
record. This mode is used by the
/lapi/record-defaults/create/{apiName}
resource.
EditUse this mode if you intend to
build UI that lets a user edit a record.
This mode is used by the
/lapi/record-defaults/clone/{recordId}
resource.
View(Default) Use this mode if you
intend to build UI that displays a record.
39.0Small, 39.0A collection of layout sections.Record Layout
Section[]
sections
SEE ALSO:
Record Layout, Get
Record UI
Clone Record Defaults, Get
Create Record Defaults, Get
Record UI
The layout information, field information, and data for a record.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Medium, 39.0A map of object API names to each objects
record layout information.
Map<String, Record
Layout>
layouts
39.0Big, 39.0A map of object API names to each objects
metadata.
Map<String, Object
Info>
objectInfos
37
Record UILightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0A map of record IDs to each records data.Map<String, Record
Data>
records
SEE ALSO:
Record UI, Get
Lightning API Nested Response Bodies
These response bodies are nested in top-level response bodies.
A request to a resource always returns a HTTP response code, whether the request was successful or not.
Batch Result Item
The results of one subrequest in a batch request.
Canvas Layout Component
A canvas component on a record page layout.
Custom Link Layout Component
A custom link component on a record page layout.
Error Message
An error code and error message.
Error with Output
Contains extra information about errors. In rare cases, an error message isn't enough to describe the reason for a failure. For example,
when a conflicting precondition exists, the error result can include the information about the cause of the conflict.
Field
A field's metadata.
Field Layout Component
A field in a record layout.
Field Value
The raw and displayable field values for a field in a record.
Filtered Lookup Info
Metadata for a lookup filter.
Lead Status Picklist Value Attributes
Additional picklist value attributes for lead statuses.
Location Field
A complex location value for a record field.
Opportunity Stage Picklist Value Attributes
Additional picklist value attributes for opportunity stages.
Picklist Value
A single picklist value.
38
Lightning API Nested Response BodiesLightning API Response Bodies
Record Exceptions
A collection of record exception errors.
Record Exception Error
Informaiton about a record exception error.
Record Layout Component
A concrete record layout component.
Record Layout Item
An item in a record layout.
Record Layout Row
A row in a record layout.
Record Layout Section
A section in a record layout.
Record Type Info
Informaiton about a record type.
Reference To Info
Information about a reference field's referenced types and the name field names of those types.
Report Layout Component
A report chart component on a record layout page.
Theme Info
Color and icon information for a theme.
Visualforce Layout Component
A Visualforce component on a record layout page.
SEE ALSO:
Lightning API Top-Level Response Bodies
Batch Result Item
The results of one subrequest in a batch request.
Available
Version
Filter Group
and Version
DescriptionTypeProperty
39.0Small, 39.0A response body for a record passed in a request to
/lapi/records/batch/{recordIds}.
One of these types:result
Record Data
Error Message
Important:
If the
result is
an error,
the type
is a
collection
39
Batch Result ItemLightning API Response Bodies
Available
Version
Filter Group
and Version
DescriptionTypeProperty
of error
messages.
39.0Small, 39.0An HTTP status code indicating the status of this
individual request in the batch.
IntegerstatusCode
Canvas Layout Component
A canvas component on a record page layout.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The value is Canvas.StringcomponentType
39.0Small, 39.0The location in the application where the
canvas app is being called from. One of
these values:
StringdisplayLocation
ChatterThe canvas app was called
from the Chatter tab.
ChatterFeedThe canvas app was
called from a Chatter canvas feed item.
MobileNavThe canvas app was
called from the navigation menu in
Salesforce1.
OpenCTIThe canvas app was called
from an Open CTI component.
PageLayoutThe canvas app was
called from an element within a page
layout. If the displayLocation is
PageLayout, one of the
subLocation values can be
returned.
PublisherThe canvas app was
called from a canvas custom quick
action.
ServiceDeskThe canvas app was
called from a Salesforce Console
component.
VisualforceThe canvas app was
called from a Visualforce page.
NoneThe canvas app was called
from the Canvas App Previewer.
40
Canvas Layout ComponentLightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
The sublocation in the application
where the canvas app was called from when
the canvas app is loaded in a mobile device.
The possible values are:
S1MobileCardFullviewThe
canvas app was called from a mobile
card.
S1MobileCardPreviewThe
canvas app was called from a mobile
card preview.
S1RecordHomePreviewThe
canvas app was called from a record
detail page preview.
S1RecordHomeFullviewThe
canvas app was called from a page
layout.
39.0Small, 39.0The height of the component.Stringheight
39.0Small, 39.0The unique ID of the canvas app definition.StringreferenceId
39.0Small, 39.0Indicates whether to show the scroll bar on
the canvas component (true) or not
(false).
BooleanshowScroll
39.0Small, 39.0The width of the component.Stringwidth
39.0Small, 39.0The API name of the canvas app.Stringvalue
Custom Link Layout Component
A custom link component on a record page layout.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0Indicates how a link behaves on open. One
of these values:
Stringbehavior
NewWindowOpen a new window.
NoSidebarNo sidebar
OnClickJavaScriptWhen the
link is clicked, run JavaScript.
ReplaceReplace the current page.
SidebarSidebar
41
Custom Link Layout ComponentLightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The component type. The value is
CustomLink.
StringcomponentType
39.0Small, 39.0The custom link URL.StringcustomLinkUrl
39.0Small, 39.0The custom link label.Stringlabel
39.0Small, 39.0The value of the custom link component.Stringvalue
Error Message
An error code and error message.
Available
Version
Filter Group
and Version
DescriptionTypeProperty
39.0Small, 39.0An error code with information about the error, for
example, INSUFFICIENT_PRIVILEGES
StringerrorCode
39.0Small, 39.0Description of errorStringmessage
Error with Output
Contains extra information about errors. In rare cases, an error message isn't enough to describe the reason for a failure. For example,
when a conflicting precondition exists, the error result can include the information about the cause of the conflict.
Available
Version
Filter Group
and
Version
DescriptionTypeProperty
39.0Small, 39.0Indicates the type of the output property. The
value is either null or RecordError.
StringenhancedErrorType
39.0Small, 39.0Description of the error.Stringmessage
39.0Small, 39.0The response body returned by the requested
resource. For example, if a successful request
Any response bodyoutput
returns a Object Info response body but an error
triggers the Error with Output response body, the
value of the output property is an Object Info
response body.
When an error occurs related to record create or
update, this value is Record Exceptions.
42
Error MessageLightning API Response Bodies
Field
A field's metadata.
Available
Version
Filter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The API name for this field.StringapiName
39.0Small, 39.0Indicates whether the field is a custom
formula field.
Booleancalculated
39.0Small, 39.0Indicates whether the field is a top-level
compound field.
If the dataType is Location, this
value is usually false.
Booleancompound
39.0Small, 39.0The name of the field that controls the
values of this picklist.
StringcontrollerName
39.0Small, 39.0Indicates whether the field can be
created.
Booleancreateable
39.0Small, 39.0Indicates whether the field is custom.Booleancustom
39.0Small, 39.0Field type. One of these values:StringdataType
Address
Base64
Boolean
ComplexValueComplex Value
Type (CVT).
Currency
Date
DateTime
Double
Email
EncryptedString
Int
Location
MultiPicklist
Percent
Phone
Picklist
Reference
String
TextArea
Time
43
FieldLightning API Response Bodies
Available
Version
Filter Group and
Version
DescriptionTypeProperty Name
Url
39.0Small, 39.0More data type information. One of
these values:
StringextraTypeInfo
ExternalLookupExternal
lookup
ImageUrlImage url
IndirectLookupIndirect
lookup
PersonNamePerson name
PlainTextAreaPlain text
area
RichTextAreaRich text area
SwitchablePersonNameSwitchable
person name
39.0Small, 39.0Indicates whether the field is filterable.
If true, then this field can be specified in
the WHERE clause of a SOQL statement.
Booleanfilterable
39.0Small, 39.0If the field is a reference field type with
a lookup filter, this value contains the
lookup information.
Filtered Lookup
Info
filteredLookupInfo
39.0Small, 39.0Indicates whether the field stores
numbers to 8 decimal places regardless
of what's specified in the field details.
BooleanhighScaleNumber
39.0Small, 39.0Indicates whether the field has been
formatted for HTML and should be
BooleanhtmlFormatted
encoded for display in HTML. Also
indicates whether a field is a custom
formula field that has an IMAGE text
function.
39.0Small, 39.0Text label that is displayed next to the
field in the Salesforce user interface. This
label may be localized.
Stringlabel
39.0Small, 39.0For string fields, the maximum size of
the field in number of Unicode
characters (not bytes).
Integerlength
39.0Small, 39.0Indicates whether the field is a name
field.
BooleannameField
44
FieldLightning API Response Bodies
Available
Version
Filter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0A mapping of record type IDs to API
URLs to use to get picklist values for this
field in the context of a record type.
Map<String,
String>
picklistValuesUrls
39.0Small, 39.0For double fields, indicates the
maximum number of digits that can be
Integerprecision
stored, on both sides of the decimal
point.
39.0Small, 39.0Indicates whether the field is a foreign
key reference to another record.
Booleanreference
39.0Medium, 39.0For indirect lookup relationships on
external objects, the target custom field
of the referenced object.
StringreferenceTargetField
39.0Small, 39.0For fields that refer to other objects, this
list includes information about the
Reference To Info[]referenceToInfos
object types and name fields of the
referenced objects.
39.0Small, 39.0The name of the relationship, if this
relationship is a master-detail
relationship field.
StringrelationshipName
39.0Small, 39.0Indicates whether the field is required
on create or update.
Booleanrequired
39.0Small, 39.0For double fields, indicates the number
of digits to the right of the decimal point.
Integerscale
39.0Small, 39.0Indicates whether a query can sort on
this field.
Booleansortable
39.0Small, 39.0Indicates whether the field can be
updated.
Booleanupdateable
Field Layout Component
A field in a record layout.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The value is Field.StringcomponentType
39.0Small, 39.0The label of the field.Stringlabel
39.0Small, 39.0The API name of the field.Stringvalue
45
Field Layout ComponentLightning API Response Bodies
Field Value
The raw and displayable field values for a field in a record.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The displayable value for a field. For a date,
this value is familiar to users rather than an
StringdisplayValue
ISO 8601 formatted date value, which is the
raw form. Currency values are also formatted
for display. If data can be localized to the
context user's language using the
toLabel() function, that value is also
displayed here.
39.0Small, 39.0The value of a field in its raw data form.Objectvalue
Filtered Lookup Info
Metadata for a lookup filter.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0A collection of controlling fields when the
lookup filter is dependent on the source
object.
String[]controllingFields
39.0Small, 39.0Indicates whether the lookup filter is
dependent on the source object.
Booleandependent
39.0Small, 39.0Indicates whether the lookup filter is
optional.
BooleanoptionalFilter
Lead Status Picklist Value Attributes
Additional picklist value attributes for lead statuses.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0If this status indicates the lead has been
converted, the value is true, otherwise
Booleanconverted
false. For more info, see the
documentation for the LeadStatus standard
object.
46
Field ValueLightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The value is LeadStatus. Indicates that
these value attributes are associated with
the status of a Lead.
StringpicklistAttributesValueType
Location Field
A complex location value for a record field.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0Gets the latitude of the location. This value
maybe null if both latitude and longitude
are null.
Doublelatitude
39.0Small, 39.0Gets the longitude of the location. This value
maybe null if both latitude and longitude
are null.
Doublelongitude
Opportunity Stage Picklist Value Attributes
Additional picklist value attributes for opportunity stages.
Available
Version
Filter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0Indicates whether this opportunity stage
value represents a closed opportunity.
Booleanclosed
Multiple opportunity stage values can
represent a closed opportunity. For more
info, see the doc for the
OpportunityStage standard object.
39.0Small, 39.0The default percentage estimate of the
confidence in closing a specific
DoubledefaultProbability
opportunity for this opportunity stage
value. May be null if forecasting is not
enabled for the org. For more info, see
the doc for the OpportunityStage
standard object.
39.0Small, 39.0The default forecast category value for
this opportunity stage value. May be
StringforecastCategoryName
null if forecasting is not enabled for
the org. For more info, see the doc for
the OpportunityStage standard object.
47
Location FieldLightning API Response Bodies
Available
Version
Filter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The value is OpportunityStage.
Indicates that these value attributes are
StringpicklistAttributesValueType
associated with the status of a
Opportunity.
39.0Small, 39.0Indicates whether this opportunity stage
value represents a won opportunity.
Booleanwon
Multiple opportunity stage values can
represent a won opportunity. For more
info, see the documentation for the
OpportunityStage standard object.
Picklist Value
A single picklist value.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Medium, 39.0For most picklist value types, this property
is null.
If the picklist value is a lead status or an
opportunity stage, this value contains more
Either null or one
of these response
bodies:
attributes
Lead Status
Picklist Value
Attributes
attributes to help consumers understand
the meaning of the value.
Opportunity
Stage Picklist
Value Attributes
39.0Small, 39.0The displayable value of the picklist to use
in a UI.
Stringlabel
39.0Small, 39.0If the picklist is a dependent picklist, the
property contains a list of the controlling
Integer[]validFor
value indexes for which this value is valid. If
the picklist is an independent picklist, the
list is empty.
39.0Small, 39.0The value of the picklist to use in the API.Stringvalue
Record Exceptions
A collection of record exception errors.
48
Picklist ValueLightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0General errors.Record Exception
Error []
errors
39.0Small, 39.0Field-specific errors.Map<String, Record
Exception Error >
fieldErrors
Record Exception Error
Informaiton about a record exception error.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0A field API name. If no field applies, value is
null.
Stringfield
39.0Small, 39.0A field label. If no field applies, value is
null.
StringfieldLabel
39.0Small, 39.0An error messageStringmessage
39.0Small, 39.0An error status codeStringstatusCode
Record Layout Component
A concrete record layout component.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0One of these values:StringcomponentType
AnalyticsCloud
Canvas
CustomLink
EmptySpace
ExpandedLookup
Field
ReportChart
Separator
VisualforcePage
39.0Small, 39.0The value of this component.Stringvalue
49
Record Exception ErrorLightning API Response Bodies
Record Layout Item
An item in a record layout.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0Indicates whether the item
may be edited on create
BooleaneditableForNew
39.0Small, 39.0Indicates whether the item
may be edited on update
BooleaneditableForUpdate
39.0Small, 39.0The text label for the itemStringlabel
39.0Small, 39.0A collection of components
that make up the item
Collection of components. Collection
can contain any of these components:
layoutComponents
Canvas Layout Component
Custom Link Layout Component
Field Layout Component
Record Layout Component
Report Layout Component
Visualforce Layout Component
39.0Small, 39.0The ID field name of a
lookup field.
StringlookupIdApiName
39.0Small, 39.0Indicates whether the item
is sortable
Booleansortable
Record Layout Row
A row in a record layout.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0A collection of items in the row, from left to
right. Might not extend to the last column.
Record Layout Item[]layoutItems
Record Layout Section
A section in a record layout.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The number of columns in the section.Integercolumns
50
Record Layout ItemLightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The heading text for the section.Stringheading
39.0Medium, 39.0Indicates whether the section should initially
be displayed as collapsed.
BooleanisCollapsed
39.0Small, 39.0A collection of the rows in the section.Record Layout Row[]layoutRows
39.0Small, 39.0The number of rows in the section.Integerrows
39.0Medium, 39.0Indicates whether the heading text is
expected to be displayed.
BooleanuseHeading
Record Type Info
Informaiton about a record type.
Available
Version
Filter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0Indicates whether this record type is
available to the context user when
creating a new record.
Booleanavailable
39.0Small, 39.0Indicates whether this is the default
record type mapping for the associated
object.
BooleandefaultRecordTypeMapping
39.0Small, 39.0Indicates whether this is the master
record type. The master record type is
Booleanmaster
the default record type thats used when
a record has no custom record type
associated with it.
39.0Small, 39.0The record type's API name.Stringname
39.0Small, 39.0The ID of the record type.StringrecordTypeId
Reference To Info
Information about a reference field's referenced types and the name field names of those types.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The object API name of a type being
referenced in a relationship.
StringapiName
39.0Small, 39.0A collection of names of the name fields for
this object type. Combined with the
String[]nameFields
51
Record Type InfoLightning API Response Bodies
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
relationship name, you can determine how
to query this type's name fields, for example,
Parent.Name. Typically there is one
name field per object, except where
FirstName and LastName fields are
used.
Report Layout Component
A report chart component on a record layout page.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0Indicates whether to cache data (true) or
not (false).
BooleancacheData
39.0Small, 39.0The value is ReportChart.StringcomponentType
39.0Small, 39.0An error message.Stringerror
39.0Small, 39.0A filter for the report.Stringfilter
39.0Small, 39.0Indicates whether to hide the component
when there's an error (true) or not
(false).
BooleanhideOnError
39.0Small, 39.0A placeholder for the report.Stringplaceholder
39.0Small, 39.0The component's report ID.StringreportId
39.0Small, 39.0Indicates whether to show the title of the
report (true) or not (false).
BooleanshowTitle
39.0Small, 39.0The size of the component.Stringsize
39.0Small, 39.0The value of the component.Stringvalue
Theme Info
Color and icon information for a theme.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0ColorStringcolor
39.0Small, 39.0Icon URLStringiconUrl
52
Report Layout ComponentLightning API Response Bodies
Visualforce Layout Component
A Visualforce component on a record layout page.
Available VersionFilter Group and
Version
DescriptionTypeProperty Name
39.0Small, 39.0The value is VisualforcePage.StringcomponentType
39.0Small, 39.0The height of the component.Stringheight
39.0Small, 39.0Indicates whether to show the section label
with this Visualforce component (true) or
not (false).
BooleanshowLabel
39.0Small, 39.0Indicates whether to show the scroll bar on
the canvas component (true) or not
(false).
BooleanshowScroll
39.0Small, 39.0The value of this component.Stringvalue
39.0Small, 39.0The Visualforce URL.StringvisualforceUrl
39.0Small, 39.0The width of the component.Stringwidth
53
Visualforce Layout ComponentLightning API Response Bodies
INDEX
B
Batch Result Item 39
Batch Results 33
C
Canvas Layout Component 40
Clone Record Defaults 26
Create Record Defaults 27
Custom Link Layout Component 41
E
Error Message 42
Error responses 8
Error with Output response body 42
F
Field 43
Field Layout Component Representation 45
Field Value 46
Filtered Lookup Info 46
L
Lead Status Picklist Value Attributes 46
Lightning API quick start 3
Location Field 47
O
Object Info 33
Object Layout, Get. 13
Object Metadata, Get 15
Opportunity Stage Picklist Value Attributes 47
P
Picklist Value 48
Picklist Values 34
Picklist Values, Get 28
R
Record 35
Record Defaults 36
Record Exception 48
Record Exception Error 49
Record Input 30
Record Layout 36
Record Layout Component 49
Record Layout Item 50
Record Layout Row 50
Record Layout Section 50
Record Type Info 51
Record UI 37
Record UI, Get 11
Records, Batch Get 19
Records, Get 16
Records, Post 21
Reference To Info 51
Report Layout Component 52
Request bodies
Record Input 30
Resources
clone record defaults 26
create record defaults 27
error responses 8
object layout, get 13
object metadata, get 15
picklist values, get 28
record UI, get 11
records, batch get 19
records, get 16
records, post 21
Response bodies
Batch Result Item 39
Batch Results 33
Canvas Layout Component 40
Custom Link Layout Component 41
Error Message 42
Error with Output 42
Field 43
Field Layout Component 45
Field Value 46
Filtered Lookup Info 46
Lead Status Picklist Value Attributes 46
Location Field 47
Object Info 33
Opportunity Stage Picklist Value Attributes 47
Picklist Value 48
Picklist Values 34
Record 35
Record Defaults 36
Record Exception 48
Record Exception Error 49
Record Layout 36
54
Response bodies (continued)
Record Layout Component 49
Record Layout Item 50
Record Layout Row 50
Record Layout Section 50
Record Type Info 51
Record UI 37
Reference To Info 51
Report Layout Component 52
Response bodies (continued)
Theme Info 52
Visualforce Layout Component 53
T
Theme Info 52
V
Visualforce Layout Component 53
55
Index

Navigation menu