Jump to content
Sign in to follow this  
rahultailwal

Selecting contacts from salesforce using php

Recommended Posts

Hi, I have make a form in which user will enter his salesforce username and password and the i have to login to saleforce system and get the all the contacts details. and then save to my php database. Please suggest any code for this. Thanks,

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
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. :(

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...