You need to sign in to do that
Don't have an account?

Get multiple records using EXTERNAL IDS
Hi there,
Anyone know the best way to get multiple records using the same EXTERNAL_ID?
Our case is that we have more than one Salesforce contact using the same email (external_id) and the follow request is causing 300 Multiple Choices:
```
curl https://yourInstance.salesforce.com/services/data/v20.0/sobjects/Contact/Email/foo@example.com -H "Authorization: Bearer token"
```
Thanks for your time.
Juan Ramon Cañizares Gomez.
There is no easy way to do it as the wildcard (*) is not allowed in SOQL queries and, believe me, it makes sense in terms of performance. What you can do is declare them manually or query the describe of the sObject first and get all queriable fields before making the callout to retrieve the records.
Hope to have helped!
Regards.
Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.
All Answers
Trying using a query instead, it would look like:
https://yourInstance.salesforce.com/services/data/v20.0/query/?q=SELECT+name,email,phone+from+Contact
See more at: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_query.htm
Hope to have helped!
Regards.
Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.
Hi Zuinglio,
Thanks for the quick reply, I think that can work fine. Any ideas of how to SELECT all the attributes at once?
Juan Ramon Cañizares Gomez.
There is no easy way to do it as the wildcard (*) is not allowed in SOQL queries and, believe me, it makes sense in terms of performance. What you can do is declare them manually or query the describe of the sObject first and get all queriable fields before making the callout to retrieve the records.
Hope to have helped!
Regards.
Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.
That makes sense, thanks.