Salesforce API Configuration – The Ultimate Guide You’ll Laugh & Learn From!

Hey Trailblazers!

Welcome back to The BNM Tuts, where we make complex Salesforce things as easy as debugging a typo in your Apex class (okay, almost). Today we’re cracking open the mystery box labeled Salesforce API Configuration — and yes, we promise to keep it fun, real, and wildly useful.

What is API in Salesforce? (Or: Why Your Org Is Talking to Strangers)

In the tech world, APIs are like translators at a UN meeting — they help your Salesforce org talk to other systems, like SAP, AWS, your grandmother’s Excel sheet (kidding… or are we?).

API = Application Programming Interface — and in Salesforce, it’s your gateway to data integration bliss.

What is an API in Salesforce?

API (Application Programming Interface) allows external systems and applications to interact with Salesforce programmatically. Salesforce provides multiple APIs for different use cases.

Why Use APIs in Salesforce?

  • Automate repetitive tasks
  • Integrate Salesforce with external systems (ERP, HR, marketing tools, etc.)
  • Access and manipulate Salesforce data securely
  • Enable real-time or scheduled data exchange

🛠️ Key Types of APIs in Salesforce (The API Avengers)

Before we configure anything, let’s meet the team:

API NameUse CaseFormat
REST APILightweight integration (CRUD via HTTP)JSON/XML
SOAP APIEnterprise-level integration (WS-Security, WSDL)XML
Bulk API 1.0 & 2.0Handle large data sets (ETL jobs)CSV/JSON
Streaming APIPush notifications for record changesCometD
Pub/Sub APIEvent-based integration (platform events)gRPC/JSON
Metadata APIDeploy/retrieve metadata (e.g., Apex, Layouts)ZIP/XML
Tooling APICustom Dev Tools (Apex code, debug logs)JSON/XML
GraphQL APIOptimized data querying via single API callJSON

Pre-requisites for API Access

  • Salesforce Editions: API is enabled by default in Enterprise, Unlimited, Developer, and Performance Editions.
  • User Permissions:
    • “API Enabled”
    • “Modify All Data” (optional, depends on use case)
  • Connected App for OAuth-based authentication

⚙️ How to Configure APIs in Salesforce (The Non-Boring Way)

Let’s roll up our sleeves and configure this thing — BNM Tuts style.

🎯 Step 1: Create a Connected App (No, not a Tinder profile)

  1. Go to Setup → Search “App Manager”
  2. Click New Connected App
  3. Fill these vibe-killing but necessary fields:
    • App Name: “BNM_API_App” (Or something cooler)
    • Email: Your work email (no, not iloveapis69@gmail.com)
    • Enable OAuth Settings
      • Callback URL: Use https://login.salesforce.com/services/oauth2/callback
      • Selected OAuth Scopes:
        • Full access (full)
        • Perform requests on your behalf (refresh_token, offline_access)
        • Access and manage your data (api)

🎉 You just made your org API-ready. Look at you, configuring like a boss.

🔑 Step 2: Grab the Keys (Client ID & Secret – not your house keys)

After saving the app:

  • You’ll get a Client ID and Client Secret
  • Keep them safe. Like, Fort Knox safe. Or at least “Don’t email them to yourself” safe.

🔄 Step 3: Authenticate Like a Rockstar

Use Postman, cURL, or even Apex to get that access token. Here’s a sample cURL command:

curl -X POST https://login.salesforce.com/services/oauth2/token \
  -d "grant_type=password" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "username=YOUR_USERNAME" \
  -d "password=YOUR_PASSWORD+SECURITY_TOKEN"

Now Salesforce will send you an access_token — your golden ticket 🍫 to call the APIs.

Authentication Methods

MethodUse CaseRequires
OAuth 2.0Secure web/mobile integrationsConnected App
Username-PasswordBackend automation scriptsUser credentials
JWT Bearer TokenHeadless integration (server)Certificate
Session IDTemporary access via ApexSession token

📡 Sample API Calls to Brag About

🕵️‍♂️ Get Account Records (REST API Style)

GET /services/data/v60.0/sobjects/Account/
Authorization: Bearer YOUR_ACCESS_TOKEN

📦 Upload Bulk Records (Bulk API)

Use CSV, chunk it up, and push to:

/services/data/v60.0/jobs/ingest

🎧 Streaming API Fun (PushTopics FTW)

  1. Create a PushTopic
  2. Listen in real-time using CometD protocol

Feels like a Salesforce party where you don’t even need to knock.

Using SOAP API

  1. Download Enterprise WSDL or Partner WSDL
  2. Use tools like SoapUI, Postman, or programming languages with SOAP support (Java, .NET)
  3. Key operations:
    • login()
    • query()
    • create()
    • update()

Bulk API 2.0 (High-volume data loads)

  • Endpoint: /services/data/v60.0/jobs/ingest
  • Supports:
    • Create job
    • Upload CSV
    • Close job
    • Get job status
  • Ideal for ETL and data warehousing tools

Streaming API (Real-time record change events)

  • Uses PushTopics, Generic Events, or Change Data Capture
  • Requires CometD client library
  • Subscribe to real-time record changes

Metadata API (Deploy Metadata)

  • Deploy Apex, Profiles, Workflows, etc.
  • Tools:
    • Salesforce CLI (sfdx force:mdapi:*)
    • Workbench
    • ANT Migration Tool

Tooling API

  • Access metadata and developer tools
  • Use for:
    • Query Apex classes, Triggers
    • Debug logs
    • Code coverage

Security Best Practices

✅ Use OAuth 2.0 for secure integrations
✅ Never expose client secrets
✅ Use Named Credentials (in Salesforce) for external endpoints
✅ Enable IP restrictions and Login IP Ranges
✅ Set API Usage Limits and monitor logs

Monitoring API Usage

Go to:
Setup → System Overview
or
Setup → API Usage Notifications

Use:

  • Limits REST endpoint: /services/data/vXX.X/limits

🤯 Common Gotchas (We’ve Suffered So You Don’t Have To)

  • Wrong callback URL → Boom. “invalid_grant” error.
  • 🔐 Security token missing → Facepalm.
  • 🔄 Refresh token not working? You didn’t request offline_access, did you?
  • 🧼 Soap XML errors → Even Google gives up. Use Postman’s WSDL parser!

🎁 Bonus: When to Use Which API?

Use CaseBest API
Fetch 1-100 records on mobile appREST API
Push 1 million records nightlyBulk API
Show live order updatesStreaming API
Automate deploymentMetadata API
Build custom dev toolsTooling API

Tools to Test Salesforce APIs

Common Errors & Solutions

ErrorReasonFix
INVALID_SESSION_IDToken expiredRefresh token or login again
API_DISABLED_FOR_ORGAPI not enabledUpgrade edition or enable API
REQUEST_LIMIT_EXCEEDEDExceeded daily API callsOptimize calls / request increase
INVALID_GRANTWrong credentials / IP restrictionCheck username, password, IP

Real-World Use Cases

  1. Sync Salesforce Leads with HubSpot – REST API
  2. Export Daily Opportunity Reports – Bulk API
  3. Push Order Status Updates to External System – Platform Events
  4. Deploy Custom Metadata between Sandboxes – Metadata API
  5. Create Integration with SAP ERP – SOAP API

🧠 Final Thoughts from BNM Tuts

Configuring Salesforce APIs doesn’t have to feel like decoding alien math. With this post, you’re now an API Jedi, ready to integrate, automate, and dominate.
(Okay, maybe not dominate, but you get it.)

Further Reading and References

👉 So next time someone says, “Can you integrate this system with Salesforce?”
You say:
“Sure. REST or SOAP?” 😉

🚨 Wait! One More Thing…

If this helped you laugh and learn, drop a comment, share it with your team, or shout out @TheBNMTuts on LinkedIn.

#HappyTrailblazing
The BNM Tuts

Leave a Reply

Your email address will not be published. Required fields are marked *