algoliasearch/src/main/java/com/algolia/search/saas/Index.java
public JSONObject getObjects(@NonNull Collection<String> objectIDs, @Nullable Collection<String> attributesToRetrieve, @Nullable RequestOptions requestOptions) throws AlgoliaException {
        try {
            JSONArray requests = new JSONArray();
            for (String id : objectIDs) {
                JSONObject request = new JSONObject();
                request.put("indexName", this.rawIndexName);
                request.put("objectID", id);
                if (attributesToRetrieve != null) {
                    request.put("attributesToRetrieve", new JSONArray(attributesToRetrieve));
                }
                requests.put(request);
            }
            JSONObject body = new JSONObject();
            body.put("requests", requests);
            return client.postRequest("/1/indexes/*/objects", /* urlParameters: */ null, body.toString(), true, requestOptions);
        } catch (JSONException e) {
            throw new AlgoliaException(e.getMessage());
        }
    }
public JSONObject getObjects(@NonNull Collection<String> objectIDs, @Nullable Collection<String> attributesToRetrieve, @Nullable RequestOptions requestOptions) throws AlgoliaException {
        try {
            JSONArray requests = new JSONArray();
            for (String id : objectIDs) {
                JSONObject request = new JSONObject();
                request.put("indexName", this.rawIndexName);
                request.put("objectID", id);
                if (attributesToRetrieve != null) {
                    request.put("attributesToRetrieve", new JSONArray(attributesToRetrieve));
                }
                requests.put(request);
            }
            JSONObject body = new JSONObject();
            body.put("requests", requests);
            return client.postRequest("/1/indexes/*/objects", /* urlParameters: */ null, body.toString(), true, requestOptions);
        } catch (JSONException e) {
            throw new AlgoliaException(e.getMessage());
        }
    }
public JSONObject getObjects ( @ NonNull Collection < String > objectIDs , @ Nullable Collection < String > attributesToRetrieve , @ Nullable RequestOptions requestOptions ) throws AlgoliaException { try { JSONArray requests = new JSONArray ( ) ; for ( String id : objectIDs ) { JSONObject request = new JSONObject ( ) ; request . put ( "indexName" , this . rawIndexName ) ; request . put ( "objectID" , id ) ; if ( attributesToRetrieve != null ) { request . put ( "attributesToRetrieve" , new JSONArray ( attributesToRetrieve ) ) ; } requests . put ( request ) ; } JSONObject body = new JSONObject ( ) ; body . put ( "requests" , requests ) ; return client . postRequest ( "/1/indexes/*/objects" , /* urlParameters: */ null , body . toString ( ) , true , requestOptions ) ; } catch ( JSONException e ) { throw new AlgoliaException ( e . getMessage ( ) ) ; } }
Gets several objects from this index.

@param objectIDs            the array of unique identifier of objects to retrieve
@param attributesToRetrieve contains the list of attributes to retrieve.
@param requestOptions       Request-specific options.
@throws AlgoliaException
Gets several objects from this index .