Step 3: Using the Field Parameter
If you would only like to retrieve certain fields for every entity, you can use the fields
parameter. Only those fields will be returned, along with the meta object for each entity. For instance, if you only wanted the name
and keywords
fields returned, the request URL and response would be as follows:
GET | https://cdn.yextapis.com/v2/accounts/me/entities?api_key=[API_KEY]&v=YYYYMMDD&fields=name,keywords |
Response Body:
],
"meta": {
"accountId": "3036160",
"uid": "jbJ2l5",
"id": "captnicks",
"timestamp": "2021-06-22T03:05:51",
"labels": [
"106367"
],
"folderId": "350960",
"schemaTypes": [
"Restaurant"
],
"language": "en",
"countryCode": "US",
"entityType": "restaurant"
}
},
{
"name": "Captain Nick's Diner",
"keywords": [
"keyword1",
"keyword2"
],
"meta": {
"accountId": "3036160",
"uid": "zkVr4O",
"id": "7166667681115808630",
"timestamp": "2021-06-22T03:05:51",
"labels": [
"106367"
],
"folderId": "350960",
"schemaTypes": [
"Restaurant"
],
"language": "en",
"countryCode": "US",
"entityType": "restaurant"
}
}
],
"count": 3
}
}
<% elem.innerText %>