I am trying to create an contact through REST API and gave PhotoURL with value as twitter photo url. Now, I got the below response. I am unable to find settings to enable this option. Can anyone please help me on this or how to add Photo to lead/contact through REST API ?

[{"message":"Unable to create/update fields: PhotoUrl. Please check the security settings of this field and verify that it is read/write for your profile or permission set.","errorCode":"INVALID_FIELD_FOR_INSERT_UPDATE","fields":["PhotoUrl"]}]


The error message is self explanatory. The user you are trying to make the create call using REST API is not having the required permission on the PhotoURL field in contact.

So just login to Salesforce as System Administrator and provide the field level security for the PhotoURL field for the requesting user.

One more possibility is that the Social Accounts and Contacts hasn't been activated in your organization(Reference).

Path to be combined with the URL of a Salesforce instance (for example, https://na1.salesforce.com/) to generate a URL to request the social network profile image associated with the contact. Generated URL returns an HTTP redirect (code 302) to the social network profile image for the contact.

Blank if Social Accounts and Contacts isn't enabled for the organization or if Social Accounts and Contacts is disabled for the requesting user.

  • Where it can be enabled field level security for PhotoURL field as System Administrator? actually, i am searching this for long time. Thanks for your help – Tamilselvan Sep 7 '15 at 10:48
  • What is the API version you are using for Rest(/services/data/v34.0)? If its less than 30, this field will not be available. – Vigneshwaran G Sep 7 '15 at 11:03
  • Enabling field level security in web interface in totally different than API version that using, right ? I need to upload profile image for contact/lead. Can you suggest me a best way to upload profile image through rest API? – Tamilselvan Sep 7 '15 at 12:06
  • one more quss. Do I need to need use instance_url which we get in refresh_code generation or I can directly use ap2.salesforce.com ? – Tamilselvan Sep 7 '15 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.