This is legacy documentation, and may not be complete. To see the latest documentation, if you are a marketer, refer to the Marketers site. If you are a measurement partner, refer to the Measurement Partners site.
Required. Job history will be exported for jobs started on or after startDate but before endDate. startDate cannot be more than 30 days from the current date.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eExports a customer account's job history to their chosen BigQuery dataset.\u003c/p\u003e\n"],["\u003cp\u003eUsers need to specify the project ID, dataset, start and end dates, and optionally the time zone for the export.\u003c/p\u003e\n"],["\u003cp\u003eThe API uses a POST request to \u003ccode\u003ehttps://adsdatahub.googleapis.com/v1/{customer=customers/*}:exportJobHistory\u003c/code\u003e with the customer ID as a path parameter.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses return an Operation object, indicating the status of the export job.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/adsdatahub\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],["This document details the process for exporting a customer's job history to a BigQuery dataset using an HTTP POST request. The request, sent to `https://adsdatahub.googleapis.com/v1/{customer=customers/*}:exportJobHistory`, requires a customer ID as a path parameter. The request body must include the `projectId` and `dataset` for BigQuery, as well as the `startDate` and `endDate` for the export, along with an optional `timeZone`. Successful requests return an Operation instance, and the process needs `https://www.googleapis.com/auth/adsdatahub` authorization scope.\n"],null,["# Method: customers.exportJobHistory\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nExports job history of a customer account to customer-selected BigQuery dataset.\n\n### HTTP request\n\n`POST https://adsdatahub.googleapis.com/v1/{customer=customers/*}:exportJobHistory`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------|----------------------------------------------------------------------------------------|\n| `customer` | `string` Required. ADH customer ID to fetch jobs for, with the format 'customers/123'. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"projectId\": string, \"dataset\": string, \"startDate\": { object (/ads-data-hub/reference/rest/v1/Date) }, \"endDate\": { object (/ads-data-hub/reference/rest/v1/Date) }, \"timeZone\": string } ``` |\n\n| Fields ||\n|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `projectId` | `string` Required. Customer project ID that the query audit log will be written to. |\n| `dataset` | `string` Required. Customer dataset that the query audit log will be written to. |\n| `startDate` | `object (`[Date](/ads-data-hub/reference/rest/v1/Date)`)` Required. Job history will be exported for jobs started on or after startDate but before endDate. startDate cannot be more than 30 days from the current date. |\n| `endDate` | `object (`[Date](/ads-data-hub/reference/rest/v1/Date)`)` Required. End date for date range for job history export, exclusive. Currently, only a single day's worth of query job history can be exported. |\n| `timeZone` | `string` Optional. The time zone for the start date. If not specified, defaults to 'UTC'. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/ads-data-hub/reference/rest/v1/operations#Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/adsdatahub`"]]