[SalesForce] How to retrieve multiple contacts with single REST call

I am getting 20 contact ID from getUpdated.Now I need information for each of these 20 contacts.It seems costly to request each contact through a REST url.Is there any way how I can query multiple contacts through 1 url?
Is the bulk api designed for this?If so,how does the url looks like?I assue it is a REST url too.

Best Answer

It sounds like you're using the the /sobjects/<type>/<id> endpoint you'll need to switch to the query endpoint (/query/?q=<query>) to make use of this.

SOQL Supports using an IN operator here. If your current query looks like, say, SELECT id, name, ownerId FROM Contact WHERE Id = 'someId' you could use IN as: SELECT id, name, ownerId FROM Contact WHERE Id IN ('firstId', 'secondId')

Having one item in the parentheses is fine, and works just like equals then. You also can use this multi-item syntax with equals (=) but using the IN operator makes your intentions more clear to future readers so I always recommend it.