0% found this document useful (0 votes)
4 views7 pages

Integration (Rest SOAP Bulk API)

The document provides an overview of Salesforce's integration options, including REST, SOAP, and Bulk APIs, along with their respective error handling and status codes. It outlines the use cases for each API type, detailing their strengths and limitations, such as data volume handling and processing types. Additionally, it includes links to relevant resources and troubleshooting tips for common issues encountered during API usage.

Uploaded by

csable
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

Integration (Rest SOAP Bulk API)

The document provides an overview of Salesforce's integration options, including REST, SOAP, and Bulk APIs, along with their respective error handling and status codes. It outlines the use cases for each API type, detailing their strengths and limitations, such as data volume handling and processing types. Additionally, it includes links to relevant resources and troubleshooting tips for common issues encountered during API usage.

Uploaded by

csable
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Integration(Rest/SOAP/Bulk API)

Status Codes and Error Responses


[Link]

Common Error Codes


[Link]

+++++++++++++REST API++++++++++++
[Link]

HTTP requests like GET, POST, PATCH, PUT, and DELETE.

corepods(CAN40) 00DDp000000JtTW logRecordType(L) | timechart limit=20 useOther=false


span=1h count by userId

corepods(SWE62) 00D28000000bcbo "/services/data/v62.0/tooling/executeAnonymous/"


earliest=10/29/2024:13:04:00 latest=10/29/2024:13:06:00

(index=SWE62) 00D28000000bcbo 5-AiC33rhm05—QkHIRS1F earliest=10/29/2024:13:04:00


latest=10/29/2024:13:06:00 method=POST

Login Related Issue: Invalid Grant/Authentication failure: Login More than 3600 request

Triage API Request Issues


[Link]
011811764860&page=0_0#

Handle Errors in REST API


[Link]

++++++++++++++BULK API++++++++++++++

Bulk API V1 Triage Flowchart


[Link]
df24b819b03f&page=0_0#

Bulk API V1 Slowness Runbook


[Link]

BULK API call through Workbench to create Bulk Job


[Link]

BULK API 1.0 (Workbench)


To Generate Session ID: OrgID *** Session Id
[Link]([Link]().substring(0, 15) + '*' + [Link]().substring(15));
SALESFORCE BULK API V1 (Using Postman)
[Link]

SALESFORCE BULK API V2


[Link]

++++++++++++++++++OAuth 2.0 ++++++++++++++

[Link]

 ttps://[Link]/salesforce-oauth-flows-guidelines-and-
h
tips/#:~:text=OAuth%202.0%20Web%20Server%20Authentication%20Flow,-
Allows%20apps%20with&text=After%20successful%20approval%20to%20grant,OAuth%20code%2C%20client_id%20and%20c
lient_secret

[Link]

[Link] : RS256
Public Key: [Link] (Certificate)
Private Key: [Link] (Beign Private Key)
Signature Verified: Assertion
Body(Hiding the URL) and Params(Appending the URL) Both work

[Link]

++++++++

✅Apex REST API


Class name: MyAccountAPI

[1] You annotate your Apex class & methods with @RestResource & @HttpXXX.
[2] Expose your Apex classes & methods as REST endpoints.

Use Cases:
Returning custom JSON structures.

[Link]([Link]() + [Link]().substring(15));

Postman:
[Link]
[Link]/services/apexrest/MyAccountAPI/001Ws00003EhXdSIAV

Reccord
[Link]

Salesforce Doc:
[Link]

✅Composite API
[
{
"message": "Composite Api is not enabled.",
"errorCode": "API_DISABLED_FOR_ORG"
}
]

That means your REST request will need to specify API version 39.0 (a.k.a. Spring '17) or later for this call to succeed.

Salesforce Doc:
[Link]

✅ Bulk API v1
[Link]

[1] Job Creation


Pass the sessionID in the header as per below format

[Link]

X-SFDC-Session:
[Link]
Body:
{
"operation": "insert",
"object": "Account",
"contentType": "JSON"

[2] Batch Creation


[Link]

Body:
[
{
"Name": "Test1",
"Phone": "1234567890",
"Industry": "Technology"
},
{
"Name": "Beta Industries Test2",
"Phone": "9876543210",
"Industry": "Finance"
},
{
"Name": "Gamma LLC Test3",
"Phone": "5551234567",
"Industry": "Healthcare"
}
]

[3] Batch Results:


[Link]
[Link]/services/async/60/job/750Ws00000JIZyt/batch/751Ws00000KCyxm/result

{
"state": "Closed"
}

✅ Bulk API v2
[Link]

[Link]

[1] POST
[Link]

Url:- /services/data/v58.0/jobs/ingest/
Method:- POST
Header:- Content-Type: application/json; charset=UTF-8
Accept: application/json
Body:- { "object" : "Account",
"contentType" : "CSV",
"operation" : "insert",
"lineEnding" : "LF" }

[2] PUT

[Link]
[Link]/services/data/v58.0/jobs/ingest/750Ws00000JIlrxIAD/batches

Url:- /services/data/v58.0/ingest/{jobID}/batches
Method:- PUT
Header:- Content-Type: Text/CSV; charset=UTF-8
Accept: application/json
Body:- Data in CSV format

[3]
Url:- /services/data/v58.0/ingest/{jobID}/
Method:- PATCH
Header:- Content-Type: application/json; charset=UTF-8

Accept: application/json
Body:- {
"state": "UploadComplete"

[4]
Url:- /service/data/v58.0/ingest/{jobID}/
Method:- GET
Header:- Content-Type: application/json; charset=UTF-8
Accept: application/json

[5]

Url:- /service/data/v58.0/ingest/{jobID}/successfulResults
Method:- GET
Header:- Content-Type: application/json; charset=UTF-8
Accept: application/json

[6]

Url:- /service/data/v58.0/ingest/{jobID}/FailedResults
Method:- GET
Header:- Content-Type: application/json; charset=UTF-8
Accept: application/json
[Link]
us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_bulkapi.htm

[Link]

Note:
[Link]

Scenario Best Choice C D E F G H

Update 2
1 records in a REST API
page

Insert 5 related
records &
update parent Composite API
2
in one go

3 Migrate 1 Bulk API


million records

<b>Feature</b> <b>REST API</b> <b>Composite API</b> <b>Bulk API</b>

1 🔷 Purpose Perform CRUD, query, and


describe operations on
Salesforce records
Perform multiple REST calls in a single request,
with dependencies between them
Load or query large datasets asynchronously

2 🔷 Data Volume Small to medium


Small to medium (but more efficient than many
REST calls) Large datasets (thousands to millions of records)

3 🔷 Processing Type Synchronous Synchronous Asynchronous (runs in background)

4 🔷 Use Case When you need to work with a


few records at a time
When you need to minimize round trips and
chain dependent operations When you need to import, export, or query massive data

5 🔷 Batching No batching — 1 call per


request
Multiple sub-requests in a single HTTP call (up to
25) Data split into batches internally or manually

6 🔷 Dependencies Between Calls Not supported — each call is


independent
Supported — can pass results of one sub-
request to another Not supported — each batch is independent

7 🔷 Speed Fast for a few records


Faster than multiple REST calls due to fewer
round trips Optimized for throughput on very large data

8 🔷 Response Time Immediate Immediate (but slower than a single REST call) Delayed — you poll for job completion

9 🔷 Limits Subject to daily API call limits


Counts as 1 API call, but counts sub-requests
towards daily limit Higher limits for data volume, fewer API calls

10 🔷 When to Use? Small, simple operations, low


data volume
When you need to reduce API calls and chain
operations Large imports/exports or mass updates

11

12

470946679

[1] The Bulk API V2 Script might be failing due to a private network or internal network change or any configuration change. It
fails with the error: "Failure writing to File store." This typically happens when Salesforce doesn't receive the file for processing.

[2] You can also try to have less jobs than 200 because if the jobs are more than 200 as it happened on July 8th, 2025, it might
also be one reason the issue "Failure writing to File store”

As on July 8, 2025:
25 Batches for one Job = 250,000 Records per Job

Twenty-five Batches * 8 = 200 Batches were executed.

And according to the KI below, if it's crossing more than 200 you might face the issue, it recommends either you have batches
less than 200 OR Use Bulk API V1.

Based on the logs, the problem stems from an "Early EOF; Failure writing to File store," typically caused by a connection
problem or incomplete receipt of the request body.

It seems there might be a connectivity issue on the client end. To proceed, they should contact their network team to
investigate and resolve the connection issue.

[Link]

You might also like