Salesforce Decode
Salesforcedecode
Back to questions
IntegrationBeginnercalloutshttp

What are callouts in Apex integrations?

Real World Scenario

Salesforce must POST order status to external shipping API from a trigger. You explain callout basics.

Expected Answer

• Callouts are HTTP requests from Apex to external endpoints using HttpRequest/HttpResponse • Must set endpoint URL, method, headers, body, and timeout • Callouts cannot occur with pending DML in same transaction without async pattern • Use Named Credentials to store endpoint and auth without hardcoding secrets • Mock callouts in tests with HttpCalloutMock

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Setup record storing endpoint URL and authentication protocol referenced in Apex as callout:My_Named_Credential.

Architect Perspective

Named Credentials + async callouts—junior integration security and reliability checklist.