I'm doing API requests via the PHP library (https://github.com/phpforce/soap-client), and I'm using the enterprise WSDL.

Everything is working fine, but with one exception - some of the fields are not being returned via the API. Its not like they are null; instead they have been completely omitted. These are all new fields that have been added in Salesforce recently. Older fields (that have been there for a while) all return correctly.

The fields have definitely been spelled correctly, because if I make an intentional typo, then the API throws an error. So the fields definitely exist in Salesforce, but they just are not returned at all in the API.

Is there some kind of permissions that need to be set up in Salesforce, or something else that we are missing?

I've made sure to run the following script

ini_set("soap.wsdl_cache_enabled", "0");

Thanks for the help!

Edit I've just tried returning all fields for the object:

$objects = $client->describeSObjects(['Account']);

foreach ($objects as $object)
    foreach($object->getFields() as $key => $field)
        print_r($field->getName() . PHP_EOL);

And I can clearly see the new fields ARE there. I confirm that the WSDL was definitely created after the new fields were created, and if I examine that WSDL, the new fields are indeed listed.

Unfortunately I can't use the Partner WSDL, because the library doesn't support it :(


2 Answers 2


It is either a permissions issue or the WSDL was generated before the fields were present in the org.

Try using the partner wsdl and do a describe on the object and see if the fields come back

Also, are the fields populated with values on the record you are querying?

If the field is not populated it will not be returned

If they are not populated, then populate them and retry the query to see if they are now returned

  • This is the right answer! If the API returns data, and there is no data in the relevant fields, then those fields will not be returned via the API. How stupidly frustrating!
    – JonoB
    Sep 7, 2017 at 9:42

In Salesforce you need to check that your API User has Read Access permission to the fields you are requesting.

Setup -> Profiles -> API User -> Field-Level Security

  • Yes, the api user has read only access to all fields in the relevant objects
    – JonoB
    Sep 6, 2017 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .