Exécuter la requête

Pour exécuter une requête, envoyez une requête queries.run avec la queryId et les détails de l'exécution. Cette requête renvoie ressource Report en cours d'exécution.

Voici comment exécuter une requête et récupérer l'ID de ressource du rapport obtenu:

Java

// ID of query to run.
Long queryId = query-id;

// Run the query.
Report report = service.queries().run(queryId, null).execute();

// Print the running report ID.
System.out.printf(
    "Report %s generated and running.%n",
    report.getKey().getReportId());

Python

# The ID of the existing query.
query_id = query-id

# Run the query.
running_report = (
  service.queries().run(queryId=query_id).execute()
)

# Print running report ID.
print(f'Report {running_report["key"]["reportId"]} generated and running.')

PHP

// ID of the query to run.
$queryId = query-id;

// Run the query.
$report = $this->service->queries->run(
    $queryId,
    new Google_Service_DoubleClickBidManager_RunQueryRequest(),
    array());

// Print the running report ID
printf(
    'Report %s generated and running.<br>',
    $report->getKey()->getReportId());