Pregunta

I'm testing the REST API,

I successfully called to https://naxx.salesforce.com/services/data/v29.0/sobjects/ It returns the expected result.

When I call to https://naxx.salesforce.com/services/data/v29.0/sobjects/Account/ It returns a (404) Not Found response.

I have replaced the "Account" placeholder with the logged user's email, nickname, email , also I have tried with access_token.id value but nothing works. The answer is always 404.

What should I use as "Account" value, and where can I get that information?

I'm following this documentation:

http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#CSHID=quickstart_oauth.htm|StartTopic=Content%2Fquickstart_oauth.htm|SkinName=webhelp

Specifically the subtitle called "Get Basic Object Information".

I have the same problem with:

https://naxx.salesforce.com/services/data/v29.0/sobjects/Account/describe/
https://naxx.salesforce.com/services/data/v29.0/query?q=SELECT+name+from+Account

I have not the problem with:

https://naxx.salesforce.com/services/data/
https://naxx.salesforce.com/services/data/v29.0/
https://naxx.salesforce.com/services/data/v29.0/sobjects/

Thank you in advance.

¿Fue útil?

Solución

Account is not placeholder text it is the actual name of an SObject type. That it returns a 404 response means your user account does not have access to Account records. You should check your users profile & license settings. The services/data/v29.0/sobjects/ request will return details of all the SObject types your user has access to. (so you'll find that Account is not in this list in your case)

Otros consejos

I had a similar issue. I was able to access the object Account in the list of objects but was not able to retrieve the metadata. Seems that the documentation misses the parameter "sobjects" in the path. The correct URL is:

https://na1.salesforce.com/services/data/v20.0/sobjects/Account/describe/ -H "Authorization: Bearer token"

This can be confirmed through by trying the url:

https://na1.salesforce.com/services/data/v20.0/sobjects/Account

which lists the uses such as records, describe, listviews, etc. It may vary based on organization and if the user has permission, it is ideal that the developer hit the second URL and then obtain the correct base url to retrieve the metadata.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top