How to post database rows into Salesforce API and create records. I've all the login credentials i.e. access token & client ID and I want to create/post sql server database rows into SalesForce API through C#. Anyone kindly help me on this.
2 Answers
you need to load data from sql database, transform it to json format and load to salesforce. You can use REST API
curl https://yourInstance.salesforce.com/services/data/v20.0/sobjects/Account/
-H "Authorization: Bearer token -H "Content-Type: application/json" -d "@newaccount.json"
Example request
{
"Name" : "Express Logistics and Transport"
}
example response
{
"id" : "001D000000IqhSLIAZ",
"errors" : [ ],
"success" : true
}
also you can use SOAP API
If you are working from .NET with the Salesforce APIs you might find the Salesforce Toolkits for .NET to be a good starting point. They will handle most of the REST API calls for you.
You mention moving SQL Server data directly in Salesforce. You might also consider a third party tool like DBAmp that allows Salesforce to appear as a linked server in the database. Having your own C# code do the integration will give you more flexibility, but something like DBAmp could speed up a simple integration.