L'API Looker ora utilizza i valori degli slug delle query per gli ID query
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
I seguenti metodi dell'API di applicazione Looker non utilizzano un valore query_id numerico o, nel caso delle API di query, un valore id numerico. I metodi riportati di seguito utilizzano invece il valore dello slug della query.
Il campo query_id o, nel caso delle API Query, il campo id, è un tipo di dati stringa. I campi query_id o id ora restituiscono un valore di slug della query nella risposta dell'API. Il valore dello slug della query può quindi essere utilizzato in qualsiasi richiesta API.
Ad esempio, se dovessi creare una query con l'API Create Query, id sarebbe lo slug della query nella risposta. Potresti quindi utilizzare id per effettuare una richiesta successiva.
Se hai valori ID query numerici hardcoded per uno dei metodi API elencati, devi aggiornare gli script in modo che utilizzino i valori degli slug delle query.
Come faccio a trovare il valore del slug per una query?
Puoi trovare il valore del slug per una query nei seguenti modi:
Per un'esplorazione, puoi trovare lo slug nell'URL dell'esplorazione dopo la variabile qid= nell'URL.
Puoi trovare il valore del slug associato a un ID query numerico utilizzando Attività di sistema.
Nel menu Esplorazione di Looker, seleziona l'esplorazione Attività di sistema e poi la visualizzazione Utilizzo API.
Seleziona le dimensioni Data di creazione > Data ed Endpoint e la misura Utilizzo totale.
Aggiungi un filtro alla dimensione Endpoint e, nel campo del filtro, includi gli endpoint aggiornati elencati all'inizio di questo documento che vuoi cercare.
Fai clic su Esegui. Looker mostrerà le informazioni sull'utilizzo di questi endpoint.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-08 UTC."],[],[],null,["# The Looker API now uses query slug values for query IDs\n\n| **Note:** The change described on this page will be released in phases:\n|\n| - Looker 24.20 (on December 4, 2024): Americas Early customers\n| - Looker 25.0: Americas Mid customers\n| - Looker 25.2: General Availability (GA)\n\nThe following Looker application API methods don't use a numeric `query_id` value or, in the case of the Query APIs, a numeric `id` value. The following methods use the query slug value instead.\n\n- Look APIs:\n\n - [Copy Look](/looker/docs/reference/looker-api/latest/methods/Look/copy_look)\n - [Create Look](/looker/docs/reference/looker-api/latest/methods/Look/create_look)\n - [Get Look](/looker/docs/reference/looker-api/latest/methods/Look/look)\n - [Move Look](/looker/docs/reference/looker-api/latest/methods/Look/move_look)\n - [Search Looks](/looker/docs/reference/looker-api/latest/methods/Look/search_looks)\n - [Update Look](/looker/docs/reference/looker-api/latest/methods/Look/update_look)\n - [Get All Looks](/looker/docs/reference/looker-api/latest/methods/Look/all_looks)\n- Dashboard APIs:\n\n - [Search Dashboard Elements](/looker/docs/reference/looker-api/latest/methods/Dashboard/search_dashboard_elements)\n - [Get DashboardElement](/looker/docs/reference/looker-api/latest/methods/Dashboard/dashboard_element)\n - [Update DashboardElement](/looker/docs/reference/looker-api/latest/methods/Dashboard/update_dashboard_element)\n - [Get All DashboardElements](/looker/docs/reference/looker-api/latest/methods/Dashboard/dashboard_dashboard_elements)\n - [Create DashboardElement](/looker/docs/reference/looker-api/latest/methods/Dashboard/create_dashboard_element)\n- Render Task APIs:\n\n - [Create Look Render Task](/looker/docs/reference/looker-api/latest/methods/RenderTask/create_look_render_task)\n - [Create Query Render Task](/looker/docs/reference/looker-api/latest/methods/RenderTask/create_query_render_task)\n - [Create Dashboard Render Task](/looker/docs/reference/looker-api/latest/methods/RenderTask/create_dashboard_render_task)\n - [Get Render Task](/looker/docs/reference/looker-api/latest/methods/RenderTask/render_task)\n - [Create Dashboard Element Render Task](/looker/docs/reference/looker-api/latest/methods/RenderTask/create_dashboard_element_render_task)\n- Scheduled Plan APIs:\n\n - [Scheduled Plans for Space](/looker/docs/reference/looker-api/latest/methods/ScheduledPlan/scheduled_plans_for_space)\n - [Get Scheduled Plan](/looker/docs/reference/looker-api/latest/methods/ScheduledPlan/scheduled_plan)\n - [Update Scheduled Plan](/looker/docs/reference/looker-api/latest/methods/ScheduledPlan/update_scheduled_plan)\n - [Get All Scheduled Plans](/looker/docs/reference/looker-api/latest/methods/ScheduledPlan/all_scheduled_plans)\n - [Create Scheduled Plan](/looker/docs/reference/looker-api/latest/methods/ScheduledPlan/create_scheduled_plan)\n - [Scheduled Plans for Look](/looker/docs/reference/looker-api/latest/methods/ScheduledPlan/scheduled_plans_for_look)\n - [Scheduled Plans for Dashboard](/looker/docs/reference/looker-api/latest/methods/ScheduledPlan/scheduled_plans_for_dashboard)\n - [Scheduled Plans for LookML Dashboard](/looker/docs/reference/looker-api/latest/methods/ScheduledPlan/scheduled_plans_for_lookml_dashboard)\n- Query APIs:\n\n - [Run Query Async](/looker/docs/reference/looker-api/latest/methods/Query/create_query_task)\n - [Get Query](/looker/docs/reference/looker-api/latest/methods/Query/query)\n - [Get Query for Slug](/looker/docs/reference/looker-api/latest/methods/Query/query_for_slug)\n - [Create Query](/looker/docs/reference/looker-api/latest/methods/Query/create_query)\n - [Run Query](/looker/docs/reference/looker-api/latest/methods/Query/run_query)\n - [Get Merge Query](/looker/docs/reference/looker-api/latest/methods/Query/merge_query)\n - [Create Merge Query](/looker/docs/reference/looker-api/latest/methods/Query/create_merge_query)\n - [Get All Running Queries](/looker/docs/reference/looker-api/latest/methods/Query/all_running_queries)\n\nWhat do I need to do?\n---------------------\n\nThe `query_id` field or, in the case of the Query APIs, the `id` field, is a string data type. The `query_id` or `id` fields now return a query slug value in the API response. That query slug value can then be used in any API requests.\n\nFor example, if you were to create a query with the **Create Query** API, the `id` would be the query slug in the response. You could then use that `id` to make a subsequent request.\n\nIf you have hard-coded numeric query ID values for any of the listed API methods, **you need to update your scripts to use query slug values**!\n\nHow do I find the slug value for a query?\n-----------------------------------------\n\nYou can find the slug value for a query in the following ways:\n\n- For an Explore, you can find the slug in the Explore's URL following the `qid=` variable in the URL.\n\n- You can find the slug value that is associated with a numeric query ID using [System Activity](/looker/docs/usage-reports-with-system-activity-explores).\n\n | **Note:** To view the System Activity Explores, you must have a [role](/looker/docs/admin-panel-users-roles) that includes the [`see_system_activity` permission](/looker/docs/admin-panel-users-roles#see_system_activity).\n 1. From the Looker **Explore menu** , select the [**System Activity \\\u003e History** Explore](/looker/docs/usage-reports-with-system-activity-explores#history).\n\n 2. From the **Query** view, select the **ID** and **Link** dimensions.\n\n 3. Optionally, add a filter on the **ID** dimension, and enter the query's numeric query ID in the **Query ID** filter field.\n\n 4. Click **Run**.\n\n 5. Click the `[Query]` link next to the numeric query ID in the Explore results to open an Explore based on that numeric query ID.\n\n 6. You can then use the slug in the Explore's URL, which follows the `qid=` variable in the URL.\n\nHow can I tell if we use any of the updated API endpoints?\n----------------------------------------------------------\n\nYou can view a list of the API calls that were made to your Looker instance using the [API Usage System Activity Explore](/looker/docs/usage-reports-with-system-activity-explores#api_usage).\n\n1. From the Looker **Explore** menu, select the **System Activity** Explore, and then select the **API Usage** view.\n\n2. Select the **Created Date \\\u003e Date** and **Endpoint** dimensions and the **Total Usage** measure.\n\n3. Add a filter on the **Endpoint** dimension, and, in the filter field, include any of the updated endpoints listed at the beginning of this document that you want to search for.\n\n4. Click **Run**. Looker will display usage information for those endpoints."]]