function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mustapha L 1mustapha L 1 

Easiest way to just "read" Sobject

Hi All,

i'm totally new with API stuff, 
i had a look on guide (API REST, AJAX SOAP...etc) but i'm a bit lost.
i'm looking for a way to just "read" the SObject (REsult of Query) and inject result into our own Mysql databse for post process on our own Web App (PHP).

could you let me know the easiest way to to that please ?
notice that we just want to "copy" data, not do any changes on SF database.
and volume of data is really low.

Many thanks for all assistance you could provide.
Best Answer chosen by mustapha L 1
scottbcovertscottbcovert
Hi Mustapha,

Don't worry, everyone has to start somewhere and you're definitely right that all the different APIs Salesforce offers can sometimes be overwhelming.

I personally prefer using the REST API when integrating with Salesforce from an external source, such as a Heroku app, etc. and since you seem comfortable in PHP I'd recommend checking out this cookbook:

http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-php

Best of luck!

All Answers

scottbcovertscottbcovert
Hi Mustapha,

Don't worry, everyone has to start somewhere and you're definitely right that all the different APIs Salesforce offers can sometimes be overwhelming.

I personally prefer using the REST API when integrating with Salesforce from an external source, such as a Heroku app, etc. and since you seem comfortable in PHP I'd recommend checking out this cookbook:

http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-php

Best of luck!
This was selected as the best answer
Pierre Ghiot 1Pierre Ghiot 1
Hello Mustapha,

I'm currenlty working on an open-source PHP wrapper for Salesforce REST API, you can check it here : https://github.com/Mograine/SfRest

You can either install it "as it", or just check the code to maybe understand how Salesforce REST api work.

If you prefer to code it "from scratch", Scottbcovert's link is the best place to begin.

Good luck to you
mustapha L 1mustapha L 1
WHOUA !!!
Many thanks to you both for your time !
I had stated with the first answer, i have tried to implement it. I have the SalesForce Login page, but once authenticated i have the error 
"call to token URL ....unable to get local issuer certificate, curl_errno 60"
for information i'm doing test on locally with "WAMPSERVER"

any idea about reason of this ?
Regards
scottbcovertscottbcovert
Hi Mustapha,

This might be a good blog post for you to emulate: ​http://lechmigdal.blogspot.com/2012/06/forcecom-rest-api-getting-token-with.html (http://lechmigdal.blogspot.com/2012/06/forcecom-rest-api-getting-token-with.html)

The first step is authenticating to receive your Oauth token and then from there using that as an Authorization header in further calls to the API.