+ Start a Discussion
Charni WigginsCharni Wiggins 

General advice needed on which type of API to use?

I have been tasked to build an API that will update Salesforce account records with data in Beauhurst, when the salesforce record has a CH number. 

I was thinking a daily mass update using BULK and the schedular class, but would also like the option for the user to click a button on a single account record page, to update that account record only. - I guess this is another REST api, totally seperate to the daily one?

I've not built an API from scratch before, is there anything I need to be aware of using bulk?

VinayVinay (Salesforce Developers) 
Hi Charni,

Hope below information will be helpful for you.

If you have over a million records to process and speed is a requirement then you can use Bulk API. 

You can find more details from the below link

https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_intro.htm


The Salesforce REST API is best suited for browser or mobile apps which don’t need access to high amounts of records. In case you want to access high amounts of records you should probably explore Salesforce BULK API.

The access token can be obtained by making a POST request to the appropriate endpoint such as https://login.salesforce.com/services/oauth2/token or https://test.salesforce.com/services/oauth2/token. The required parameters are:

a. grant_type: The value should be ‘password’
b. client_id: The Consumer Key from the connected app definition.
c. client_secret: The Consumer Secret from the connected app definition.
d. username: yourusername@domain.com end-user’s username.
e. password: XXXXXXXXXX, we will need to generate a security token from our Salesforce account

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/quickstart.htm

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks,
Vinay
Charni WigginsCharni Wiggins

Hi Vinay,

Thank you for this! Very helpful...

Can I just ask.. what is considered a lot of records? We have 50k account records now, but this will of course increase. 

Would that qualify for BULK API?

VinayVinay (Salesforce Developers) 
Hi Charni,

Yes you can use Bulk API to process 50k records,  since you have mentioned the count would increasing would recommend you use Bulk API.

You can review on how to use Bulk API.

https://trailhead.salesforce.com/en/content/learn/modules/api_basics/api_basics_bulk

Hope this information will help you.  

Kindly mark as 'Best Answer' if think above information was helpful.

Thanks,
Vinay
Tien Tran 29Tien Tran 29

Hi Vinay,

I researched and found that Bulk Api is good for import a huge amount of record. I tried to use Data Loader and enable Bulk API but I got a lot of errors "You have reached the Connect API's hourly request limit for this user and application. Please try again later.". Can you check my questions at https://developer.salesforce.com/forums#!/feedtype=SINGLE_QUESTION_DETAIL&dc=APIs_and_Integration&criteria=OPENQUESTIONS&id=9062I000000IRTTQA4 and advise.

Thanks,
Tien