Apex callouts, Named Credentials and Apex REST
Outbound callout rules (uncommitted work, triggers, 100 callouts, 120 seconds), named credentials with external credentials, WSDL2Apex for SOAP, inbound Apex REST and SOAP web services, and the Composite resource for all-or-none multi-step requests.
Given a scenario, apply the programmatic integration techniques and platform features for inbound and outbound communication.
~7 min read · 10 practice questions ·
What the exam expects
- Find why an outbound callout fails: uncommitted work, a trigger context, the callout count or cumulative timeout.
- Configure callout endpoints with a named credential and external credential instead of URLs and secrets in code.
- Choose between HTTP classes and WSDL2Apex for outbound calls, and between Apex REST and Apex SOAP for inbound calls.
- Write an Apex REST class that binds JSON parameters, reads
RestContext.requestand sets status codes. - Use the REST API Composite resource when an external system needs several dependent operations rolled back together without custom Apex.
Key terms: callout (Apex calling an external HTTP or SOAP service), named credential (endpoint URL plus authentication in one definition, referenced as callout:Name), external credential (the authentication settings a named credential uses), Apex REST (a global @RestResource class exposed under /services/apexrest/), Composite resource (a REST API call that runs dependent subrequests).
Key facts
- Detail
- No callout while DML, async Apex, scheduled Apex or email is pending in the transaction (rolling back the DML and releasing savepoints clears it)
- Detail
- 100; cumulative timeout 120 seconds
- Detail
- Default 10 seconds; maximum 120,000 ms
- Detail
- Must be asynchronous
- Detail
callout:Name/path; no Remote Site Setting
- Detail
- No longer updated; use named plus external credentials
- Detail
- Stub, type and Async classes
- Detail
- Must be global; mapping is case-sensitive
- Detail
- No parameters allowed
- Detail
- By name; order doesn't matter
- Detail
- Sends
RestResponse.responseBody
- Detail
- true rolls back the entire request
Sources for this section (9)
- Callout Limits and Limitationsdeveloper.salesforce.com (opens in a new tab)
- Triggersdeveloper.salesforce.com (opens in a new tab)
- Named Credentials as Callout Endpointsdeveloper.salesforce.com (opens in a new tab)
- Named Credentialshelp.salesforce.com (opens in a new tab)
- SOAP Services: Defining a Class from a WSDL Documentdeveloper.salesforce.com (opens in a new tab)
- RestResource Annotationdeveloper.salesforce.com (opens in a new tab)
- Apex REST Methodsdeveloper.salesforce.com (opens in a new tab)
- RestResponse Classdeveloper.salesforce.com (opens in a new tab)
- Composite Request Bodydeveloper.salesforce.com (opens in a new tab)
- Why must a trigger hand its callout to async Apex?
- When is a Remote Site Setting unnecessary for a callout?
- How does a client pass input to an `@HttpGet` Apex REST method?
- Why choose Composite over Composite Batch for dependent record creation?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the Platform Developer II pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 28 lessons of the Platform Developer II guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Inline practice questions and one-click topic practice (10 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams