Examples
This section provides examples of using REST API resources to do a variety of different tasks, including working with objects, organization information, and queries.
For complete reference information on REST API resources, see Reference.
-
Getting Information About My Organization
The examples in this section use REST API resources to retrieve organization-level information, such as a list of all objects available in your organization.
-
The examples in this section use REST API resources to retrieve object metadata information. For modifying or creating object metadata information, see the Metadata API Developer Guide.
-
The examples in this section use REST API resources to create, retrieve, update, and delete records, along with other record-related operations.
-
Delete Lightning Experience Event Series
Use the HTTP DELETE method to remove one or more IsRecurrence2 events in a series. You can remove a single event, all events following and including a specific event, or an entire event series.
-
Working with Searches and Queries
The examples in this section use REST API resources to search and query records using Salesforce Object Search Language (SOSL) and Salesforce Object Query Language (SOQL), and other search APIs.
-
Get an Image from a Rich Text Area Field
Use the sObject Rich Text Image Get resource to retrieve an image from a rich text area field. In this example, we retrieve an image from a custom rich text field of a Lead record called
LeadPhotoRichText__c. We assume that an image has already been uploaded to this field. -
You can use the sObject Basic Information, sObject Rows, or sObject Collections resources to insert or update binary large objects (blobs) in Salesforce, such as images or PDFs. You can upload files or binary data of any type to any standard object that contains a blob field.
-
Use the sObject Blob Get resource to get blob data for a given record. To get blob data, a record with blob data must exist in Salesforce.
-
Working with Recently Viewed Information
The examples in this section use REST API Query and Recently Viewed resources to programmatically retrieve and update recently viewed record information.
-
The examples in this section use REST API resources to manage user passwords, such as setting or resetting passwords.
-
Working with Approval Processes and Process Rules
The examples in this section use REST API resources to work with approval processes and process rules.
-
These examples use REST API event monitoring data that contains information useful for assessing org usage trends and user behavior. Event monitoring is accessed through the Lightning Platform SOAP API and REST API by way of the EventLogFile object. Therefore, you can integrate log data with your own back-end storage and data marts to correlate data from multiple orgs and across disparate systems.
-
The examples in this section use composite resources to improve your application’s performance by minimizing the number of round-trips between the client and server.