/api/v4/locations/{locationId}/reviewsBir konumun etkileşimlerini listeleme
Tek bir konumun yorumlarını ve sosyal etkileşimlerini filtrelerle, imleç tabanlı sayfalama kullanarak listeler.
Parametreler
Yol
| Ad | Tür | Zorunlu | Açıklama |
|---|---|---|---|
| locationId | string | zorunlu | Location ID, a raw numeric database ID (e.g. `1800289`) or its Base64-encoded Relay ID (e.g. `TG9jYXRpb246MTgwMDI4OQ==`). |
Sorgu
| Ad | Tür | Zorunlu | Açıklama | Varsayılan |
|---|---|---|---|---|
| siteUrls | string | isteğe bağlı | JSON-encoded array of publisher hostnames to include, e.g. `["maps.google.com","yelp.com"]`. | — |
| startDate | string | isteğe bağlı | Start of the date-range filter (YYYY-MM-DD). | — |
| endDate | string | isteğe bağlı | End of the date-range filter (YYYY-MM-DD). | — |
| searchString | string | isteğe bağlı | Full-text search across interaction content. | — |
| category | string | isteğe bağlı | Single interaction category, e.g. `REVIEW`. | — |
| categories | string | isteğe bağlı | JSON-encoded array of interaction categories. | — |
| ratingFilters | string | isteğe bağlı | JSON-encoded array of star ratings to include, e.g. `[3,4]`. | — |
| ratingFilter | integer | isteğe bağlı | Single star rating to filter by. | — |
| responseStatus | string | isteğe bağlı | JSON-encoded response-status filter. Values: `RESPONDED`, `PENDING`. | — |
| sortOrder | string | isteğe bağlı | JSON-encoded sort order. Values: `NEWEST_FIRST`, `OLDEST_FIRST`, `LAST_RESPONDED`. | — |
| first | integer | isteğe bağlı | Number of records to return from the beginning (newest first). Defaults to 20 when omitted, the endpoint always returns a single page, never the whole history. | — |
| after | string | isteğe bağlı | Cursor to page forward from. Pass `pageInfo.endCursor`, or equivalently the `cursor` of the last edge in the previous page. | — |
| last | integer | isteğe bağlı | Number of records to return from the end. | — |
| before | string | isteğe bağlı | Cursor to page backward from, used with `last`. Pass the `cursor` of the first edge of the page you are moving back from. `pageInfo` carries no `startCursor` field, so the edge cursor is the value to use. | — |
Yanıtlar
200Paginated interactions result. `data.interactions` holds the connection.
{ "data": { "interactions": { "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "endCursor": "SW50ZXJhY3Rpb246MV8xNTU0MjQzMDczMDM2LTllMjZkMmE4LWE2ZWQtNDJlYS04NDU0LTQ3ZDFjOTJlYTg0MQ==" }, "edges": [ { "node": { "id": "9e26d2a8-a6ed-42ea-8454-47d1c92ea841", "source": "maps.google.com", "content": "nice place for family together", "authorName": "vaibhav nakate", "rating": 5, "date": "2019-04-02T22:11:13.036997+00:00", "category": "Review", "type": "Review", "responded": false, "responseCount": 0, "canRespond": true, "permalink": "https://maps.google.com/maps?cid=..." }, "cursor": "SW50ZXJhY3Rpb246MV8xNTU0MjQzMDczMDM2LTllMjZkMmE4LWE2ZWQtNDJlYS04NDU0LTQ3ZDFjOTJlYTg0MQ==" } ], "totalCount": 425 } }}401Unauthenticated, missing or invalid API key.
429Rate limit exceeded. Retry after the `Retry-After` header value.
Bir konumun yorumlarını ve sosyal etkileşimlerini imleç tabanlı sayfalama kullanarak döndürür. Sonuçlar varsayılan olarak en yeniden en eskiye doğru sıralanır. Bağlantı data.interactions konumundadır ve edges[].node (bkz. etkileşim öznitelikleri referansı), pageInfo içinde bir endCursor ve bir totalCount içerir.
totalCount, bu sayfada döndürülen etkileşim sayısı değil, sonuç kümesinin tamamında filtrelerinizle eşleşen etkileşim sayısıdır. Geçmiş veri aktarımının boyutunu belirlemek veya kendi sayımınızı kontrol etmek için bunu kullanın: totalCount: 450 içeren bir konum first=50 ile okunduğunda 9 istek gerekir ve sona ulaştığınızda sayıların toplamı 450 olmalıdır. first belirtilmediğinde 20 kayıt döndürülür; dolayısıyla tek bir çağrı hiçbir zaman geçmişin tamamını getirmez.
Kullanım örneği: mağaza başına yorum gelen kutusu
Bir konum için yorum gelen kutusu oluşturmak üzere first ve after ile sayfaları ileri doğru gezin: first=25 isteğinde bulunun, ardından yanıttaki pageInfo.endCursor değerini bir sonraki çağrıda after olarak iletin. Her edge kendi cursor değerini de taşır ve son edge üzerindeki cursor değeri, o sayfanın endCursor değeridir; dolayısıyla her iki değer de after olarak kullanılabilir. hasNextPage değeri false olduğunda veya bir sayfa boş bir edges dizisiyle döndüğünde durun; her iki koşulu da kontrol edin, çünkü tam olarak en eski yoruma denk gelen bir sayfa sınırının ardından son bir boş sayfa gelir. Yalnızca hâlâ işletme sahibinin yanıtını bekleyen yorumları göstermek için responseStatus=["PENDING"] filtresini veya olumsuz yorumları önce değerlendirmek için ratingFilters=[1,2] filtresini ekleyin. Her node içindeki id değerini Bir etkileşime yanıt verme işlemine iletirsiniz; canRespond ise ilgili kaynağın işletme sahibi yanıtlarını kabul edip etmediğini belirtir.
Kullanım örneği: artımlı senkronizasyon
Yerel bir kopyayı senkronize tutmak için startDate/endDate ile filtreleyin ve sortOrder=["NEWEST_FIRST"] ile sıralayın; gördüğünüz en yüksek date değerini kalıcı olarak saklayın. Bunun sayfalama kullanan ve istek hızı sınırı olan bir uç nokta olduğunu unutmayın; 429 durumunda Retry-After başlığına uyun ve her çalıştırmada geçmişin tamamını yeniden almaktan kaçının.
Google Maps ve Facebook tüm planlarda kullanılabilir. Yelp, Growth ve Enterprise planlarında kullanılabilir. JSON biçiminde kodlanmış filtreler (siteUrls, categories, ratingFilters, responseStatus, sortOrder), URL kodlaması uygulanmış JSON dizeleri olarak iletilir.
curl -X GET 'https://listingsapi.com/api/v4/locations/<locationId>/reviews' \ -H "Authorization: API $LISTINGSAPI_KEY"