0
votes

https://eu1.salesforce.com/services/data/v20.0/sobjects/Contact/{contactId}.xml?fields=Id, Name, FirstName, LastName, Salutation, Title, Email, HomePhone, MobilePhone, OtherPhone".

When I use the above api to fetch a contact from SalesForce it works fine in Salesforce Development Edition, but it throws exception when I use the same url to fetch contact in Professional Edition. Error is as follows,

Error code: INVALID_FIELD
Error message: 
LastName, Salutation, Title, Email, HomePhone, MobilePhone, OtherPhone
                                ^

ERROR at Row:1:Column:65 No such column 'HomePhone' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

I want a url to fetch contact in all edition of SalesForce.

What is the correct way to fetch all the details of contact in all the editions of SalesForce?

1

1 Answers

1
votes

There are controls that the admin can use to say which fields are available and which aren't (for EE and up, field level security, for PE, the page layout controls API access) so there is no one list of fields that works everywhere, however in the REST API you don't need to specify the fields, if you do https://eu1.salesforce.com/services/data/v20.0/sobjects/Contact/{contactId}.xml you'll get back all the available fields on the contact.