Has the process to list trusted domains for CORS changed?

  • 1
  • Question
  • Updated 3 months ago
  • (Edited)
I have previously been successful using the process described on the API FAQ page to add trusted domains via the following API call:

PATCH https://account.sf-api.com/sf/v3/Accounts/Preferences?$select=TrustedDomains
{
   "TrustedDomains": "myexampledomain.com,myotherexampledomain.com"
}

However, I'm trying to do that again and the API returns the error:

Forbidden - The client does not have the requested scopes the endpoint requires: v3-internal

Even just calling a GET https://[myaccount].sf-api.com/sf/v3/Accounts/Preferences?$select=TrustedDomains does not return anything, whereas I believe it used to return the property name with an empty value. That makes me think "TrustedDomains" is not a property of the Accounts/Preferences endpoint anymore.
Has this process changed? How can I go about adding trusted domains so I can avoid CORS issues from client side API calls?
Photo of Joe Boettcher

Joe Boettcher

  • 3 Posts
  • 1 Reply Like

Posted 5 months ago

  • 1
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Joe,

Thanks for bringing this issue to our attention. TrustedDomains is still a property in Accounts/Preferences so it should be returned via the GET operation, so we'll investigate why it's not returning. Regarding the update, it was blocked due to a security update, and it looks like we missed this important use case. We will make an update to either make sure this endpoint works again, or provide a new documented way of updating trusted domains.

In the meantime, if you have an immediate need for adding a new domain, could you create a text file with your account subdomain, and the new domain(s) you'd like to add to your account? Send the file to me through this link: https://eliezeren.sharefile.com/r-rbc075f6a0bc4a498

Until we resolve this issue, if you need to make any updates to trusted domains feel free to continue sending the info to that link, and we'll make the update internally. Apologies for the inconvenience.

Thanks,
Eli
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Hi Joe,

Just wanted to let you know that the Accounts/Preferences endpoint will be fully accessible again and can continue to be used for Trusted Domain changes. We expect this change to be applied again within the next 2 weeks.

Thank you,
Eli
Photo of Daniel Almond

Daniel Almond

  • 2 Posts
  • 1 Reply Like
Has the Accounts/Preferences endpoint been restored yet? Still don't seem to be able to add a trusted domain.
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Daniel,

The change  has been live since August 12th. What error are you seeing when running the request?

Thanks,
Eli
Photo of Daniel Almond

Daniel Almond

  • 2 Posts
  • 1 Reply Like
Hi Eli,

I can confirm it is now working!

Thanks