Jump to content

Selecting contacts from salesforce using php


rahultailwal
 Share

Recommended Posts

have you come up with any code so far? did you set up your database?

Link to comment
Share on other sites

  • 2 weeks later...

i have got the code php toolkit http://wiki.developerforce.com/page/PHP_Toolkit . but there is a problem that we need to login with security token. and i also want the full contact details. This quesy "Select Id, CreatedDate, Contact.Name, Contact.Email From Contact"; is for name and email but i also want address and i dont know what should be in query to fetch the address. i tried address, addresses and other column names but i dont know what is there for address.

Link to comment
Share on other sites

but there is a problem that we need to login with security token.
Why is that a problem?
i dont know what should be in query to fetch the address. i tried address, addresses and other column names but i dont know what is there for address.
Well, I guess your options are to keep guessing, or check the documentation. http://wiki.develope...m/page/Database If they support it, you can also use a SHOW COLUMNS query to get the column information for a table. http://dev.mysql.com/doc/refman/5.0/en/show-columns.html
Link to comment
Share on other sites

Thanks for reply. "but there is a problem that we need to login with security token." Here if we are login using our php script then it requires a security token after password filed. And i dont want this user will only provide his password. You can download and run the partner.php script and can see what is there for password. http://wiki.develope...age/PHP_Toolkit 2. Show columns query is not working for salesforce. :(

Link to comment
Share on other sites

If this is the file you're referring to: https://github.com/developerforce/Force.com-Toolkit-for-PHP/blob/master/test/partner.php I don't see a security token there, only a username and password. Regardless, if Salesforce requires you to use a security token or whatever else to access their service that's not something you can change. You need to follow their rules. With regard to the database structure, that will be in the documentation somewhere. They have to have their database structure published if they expect people to query the database directly.

Link to comment
Share on other sites

Yes there is nothing about token but if you see this file https://github.com/developerforce/Force.com-Toolkit-for-PHP/blob/master/samples/userAuth.php here u can see that a security token is required for authentication. If you run the partner.php then u will get error because u need to put security token for it. and no user would want to go to salesforce and generate a security token and then come to my site and login.

Link to comment
Share on other sites

user dont need to get token, your application will do that authentication and get you the token

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...