GET/api/v4/locations/{locationId}/photos

Recupera le foto di una sede

Restituisce tutti i file multimediali associati a una singola sede, incluse le foto contrassegnate con una stella e quelle senza stella.

Richiede una chiave API. Consulta Autenticazione per il formato dell’header e la rotazione delle chiavi.

Parametri

Percorso

NomeTipoObbligatorioDescrizione
locationIdstringobbligatorioThe location's Base64-encoded Relay ID (for example `TG9jYXRpb246MTgwMDI4OQ==`). The raw numeric database ID (`1800289`) is also accepted, and so is a percent-encoded value such as `...%3D%3D`.

Risposte

200Array of media files for the location. Returns an empty array when the location has no photos.
Response
{  "data": {    "mediaFilesOfLocation": [      {        "id": "TWVkaWFGaWxlOjU4Nzg5MzE=",        "url": "https://sy-media-store.s3-us-west-2.amazonaws.com/f868bb3f/59c670a3/f47d62a6.jpg",        "thumbnailUrl": "https://sy-media-store.s3-us-west-2.amazonaws.com/f868bb3f/59c670a3/thumbnail_f47d62a6.jpg",        "categoryName": "Logo",        "categoryId": "4",        "fileType": "image",        "starred": false,        "viewsCount": 0      },      {        "id": "TWVkaWFGaWxlOjU4Nzg5MzI=",        "url": "https://sy-media-store.s3-us-west-2.amazonaws.com/f868bb3f/59c670a3/ef4ffb12.jpg",        "thumbnailUrl": "https://sy-media-store.s3-us-west-2.amazonaws.com/f868bb3f/59c670a3/thumbnail_ef4ffb12.jpg",        "categoryName": "Additional",        "categoryId": "12",        "fileType": "image",        "starred": true,        "viewsCount": 143      }    ]  }}
401Unauthenticated, missing or invalid API key.
429Rate limit exceeded. Retry after the `Retry-After` header value.

Restituisce ogni file multimediale associato a una sede: logo, copertina e immagini aggiuntive, con, per ciascun file, url pubblico, thumbnailUrl, categoria, l'indicazione se è starred e un viewsCount relativo all'intero periodo di esistenza.

Caso d'uso: mostrare la galleria fotografica di una sede. Recupera l'elenco dei file multimediali per mostrare le immagini che un'attività ha già pubblicato, usando thumbnailUrl per la griglia e url per la visualizzazione a dimensioni originali. starred indica quali foto aggiuntive sono fissate per essere mostrate con priorità sulle piattaforme di pubblicazione supportate.

Caso d'uso: verificare la copertura multimediale prima di un caricamento. Chiama prima questo endpoint per verificare se a una sede manca un'immagine di categoria Logo o Cover, poi carica solo ciò che manca. I valori id restituiti sono esattamente quelli da passare agli endpoint star e remove.

Aspetti a cui prestare attenzione.

  • Puoi usare qualsiasi forma di id nel percorso: 1800289, TG9jYXRpb246MTgwMDI4OQ== e TG9jYXRpb246MTgwMDI4OQ%3D%3D identificano tutti la stessa sede. Se il valore non corrisponde a nessuna di queste forme, l'endpoint restituisce HTTP 200 con un array errors contenente SY90002: Invalid Id e un payload null.
  • Per una sede senza file multimediali viene restituito { "data": { "mediaFilesOfLocation": [] } }: questa è la risposta effettiva per una sede appena creata come "Jenny Home", non un errore.
Request
curl -X GET 'https://listingsapi.com/api/v4/locations/<locationId>/photos' \  -H "Authorization: API $LISTINGSAPI_KEY"