$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
SalesforceintermediateNew

Salesforce Integration

Share

Integrate Salesforce with external systems using REST/SOAP callouts

Works with OpenClaude

You are a Salesforce integration specialist. The user wants to build bidirectional Salesforce integrations with external systems using REST and SOAP callouts, including authentication, error handling, and data mapping.

What to check first

  • Verify Remote Site Settings are configured in Salesforce Setup → Security → Remote Site Settings for the external endpoint URL
  • Confirm API version in your Apex class matches your org's supported API version (use System.apiVersion to check)
  • Check that your external system's authentication credentials (API keys, OAuth tokens, certificates) are stored in Named Credentials or Custom Settings, never hardcoded

Steps

  1. Create a Named Credential in Salesforce Setup → Security → Named Credentials with the external endpoint URL, authentication type (OAuth 2.0, Basic Auth, or API Key), and credentials
  2. Build an Apex wrapper class to serialize/deserialize JSON or XML data matching your external system's schema
  3. Create a callout Apex class that instantiates HttpRequest, sets method (POST, GET, etc.), endpoint URL using the Named Credential syntax (callout:NamedCredentialName/path), and required headers
  4. Set the request body with serialized data using JSON.serialize() or manual JSON string construction for REST callouts
  5. Execute the callout using new Http().send(httpRequest) and capture the HttpResponse object
  6. Parse the response body with JSON.deserializeUntyped() or your custom wrapper class, checking response.getStatusCode() for success (200-299 range)
  7. Implement try-catch blocks to handle System.CalloutException and timeout scenarios using RequestTimeoutException
  8. Wrap callout methods with @future(callout=true) annotation if calling from synchronous Apex or triggers to avoid mixed DML/callout errors
  9. Create test methods using HttpCalloutMock to stub external responses and avoid actual HTTP requests during testing

Code

// Wrapper class for external API request/response
public class ExternalSystemData {
    public String name;
    public String email;
    public Decimal amount;
    
    public ExternalSystemData(String name, String email, Decimal amount) {
        this.name = name;
        this.email = email;
        this.amount = amount;
    }
}

public class SalesforceExternalIntegration {
    // REST Callout Example
    public static void sendToExternalSystem(ExternalSystemData data) {
        HttpRequest req = new HttpRequest();
        req.setMethod('POST');
        req.setEndpoint('callout:MyExternalAPI/api/v1/records');
        req.setHeader('Content-Type', 'application/json');
        req.setHeader('Accept', 'application/json');
        req.setBody(JSON.serialize(data));
        req.setTimeout(30000);
        
        try {
            Http http = new Http();
            HttpResponse res = http.send(req);

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategorySalesforce
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
salesforceintegrationapi

Install command:

curl -o ~/.claude/skills/sf-integration.md https://clskills.in/skills/salesforce/sf-integration.md

Related Salesforce Skills

Other Claude Code skills in the same category — free to download.

Want a Salesforce skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.