// Retrieves all attributesContact res = index.GetObject<Contact>("myId");// AsynchronousContact res = await index.GetObjectAsync<Contact>("myId");// Retrieves firstname and lastname attributesContact res = index.GetObject<Contact>("myId", attributesToRetrieve: new List<string> { "firstname", "lastname" });// AsynchronousContact res = await index.GetObjectAsync<Contact>("myId", attributesToRetrieve: new List<string> { "firstname", "lastname" });// Retrieves only the firstname attributeContact res = index.GetObject<Contact>("myId", attributesToRetrieve: new List<string> { "firstname" });// AsynchronousContact res = await index.GetObjectAsync<Contact>("myId", attributesToRetrieve: new List<string> { "firstname" });
If the object ID doesn’t exist in your index,
this method returns an error.
This section shows the JSON response returned by the API.
Each API client wraps this response in language-specific objects, so the structure may vary.
To view the response, use the getLogs method.
Don’t rely on the order of properties—JSON objects don’t preserve key order.