0

I am leading lead to salesforce using below Rest API

Creating Leads in SalesForce using REST API in PHP

It was working fine for over 6 months but few days ago it started to give below error message and lead is not getting added in Salesforce.

I search a lot but didn't find solution. What could be the reason of this error:

[{"message":"The requested resource no longer exists.","errorCode":"GONE"}]

Errorcode: 410

farazch
  • 21
  • 3
  • Could you please edit the question adding the relevant code? Which endpoint are you calling? – RubenDG Aug 01 '22 at 13:55
  • I think the API version you're using was deprecated and removed, try updating the code to a current API version. – superfell Aug 01 '22 at 18:04

2 Answers2

0

(not really an answer but too long for a comment)

Ask your Salesforce admin / inspect the setup audit trail and setup -> release updates manually. Check if recently something like "stabilise domain names" was enabled. Or in setup -> my domain maybe somebody clicked "prevent logins from test.salesforce.com, login.salesforce.com". Another interesting thing - was the org instance migrated maybe or login IP ranges started to be enforced for some profiles? Any chance integration user's password expired?

What do you get if you try to manually go through "the ritual" in Postman, soapui or whatever http client you use? Where does your initial login call go, to generic test.salesforce.com or something org-specific? mycompany--mysandbox.my.salesforce.com? And once you log in successfully - do you use both pieces of info for subsequent calls? You're supposed to use not only access token (session I'd) but also instance URL it returned. Do not hardcore the base URL in your app, read it from login results.

Post some (pseudo) code or raw http stuff, anonymised?

eyescream
  • 18,088
  • 2
  • 34
  • 46
0

If the same request worked at one point but is no longer working, the problem is most likely due to a change to the api or the object you are trying to retrieve.

You can use this curl request to make sure you are using an available API version, just make sure to change MyDomainName you the subdomain for your organization.

curl https://MyDomainName.my.salesforce.com/services/data/ -H "Authorization: Bearer token".```

If the API version is available, check on the sobject you are looking for with the following curl request. Again, MyDomainName should match the subdomain of your organization, the version should match the version you are trying to use, and you will need to authenticate this time.

curl https://MyDomainName.my.salesforce.com/services/data/v56.0/sobjects/ -H "Authorization: Bearer token"

If the object you are trying to write to is not in the returned list of sobjects, check the settings in the Salesforce UI to make sure it exists and that your api token has access to it.

Source:

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_versions.htm

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_describeGlobal.htm

Brett
  • 74
  • 4