What are the primary characteristics and architectural advantages of using the Salesforce REST API for integrations?
Answer
Basics: REST maps operations to URLs and HTTP verbs. A client sends an access token (OAuth) with each call. JSON is compact, human readable and natively supported by JavaScript and mobile SDKs, unlike XML envelopes. It solves the need for simple, stateless access to Salesforce data without generating client code from a WSDL.
How it works:
- Authenticate with OAuth 2.0 and get an access token and the instance URL.
- Call resources under
/services/data/vXX.0/:sobjects/Account/{id}(GET, PATCH, DELETE),sobjects/Account(POST),query?q=(SOQL),search?q=(SOSL),limits,describe. - Salesforce returns JSON and an HTTP status (200, 201, 204, 400, 401, 403, 404).
- Errors come as a JSON array with
errorCodeandmessage. - Large query results paginate through
nextRecordsUrl(batches of about 2,000 by default).
Advanced / deep dive: Efficiency features matter: the Composite resource runs up to 25 subrequests in one call with reference IDs between steps; sObject Collections act on up to 200 records at once; Composite Graph handles dependent trees; upsert by External ID uses PATCH /sobjects/Obj/ExtField__c/value. Compared to SOAP, REST is lighter, stateless and cacheable with conditional headers; compared to Bulk API it fits real-time, low-to-medium volume, not millions of rows. UI API (a REST family) returns layout and field-level-security-aware data for building UIs. The API call count applies to a 24-hour rolling org allocation, plus a concurrent long-running limit (25 requests longer than 20 seconds, verify in docs). Sharing, FLS and object permissions of the authenticated user apply.