SOAP XML Request and Response Headers

Stay organized with collections Save and categorize content based on your preferences.

This page provides information on the required SOAP XML request headers, and the headers that are returned in response.

Required Request Headers

All API SOAP calls must have a <RequestHeader> element in the header; this element is defined in all the service WSDLs. The client libraries provide methods to add this header for you, using the values that you supply. Here is a description of all the elements of <RequestHeader>:

Element Description

The network code of the network being addressed. Network codes are required when making all requests except NetworkService.getAllNetworks() and NetworkService.makeTestNetwork().

Be sure that you only use a network code available to your account login. You can find the code on the Google Ad Manager website for your account, on the Admin > Network Settings page next to "Network code".

<applicationName> An arbitrary string name identifying your application. This will be shown in Google's log files. For example: "My Inventory Application" or "App_1".

Note: Every request your application sends to the Ad Manager API must include an OAuth2 access token. Pass the token in the HTTP header as: Authorization: Bearer YOUR_ACCESS_TOKEN.

Example Request

The following code is an example of a SOAP request call to getAdUnitsByStatement() looking for the root AdUnit.

<?xml version="1.0" encoding="UTF-8"?>
    <getAdUnitsByStatement xmlns="">
        <query>WHERE parentId IS NULL LIMIT 500</query>

Note: If your SOAP request causes an Unmarshalling error, see Common Errors for troubleshooting tips.

Response Headers

All responses returned from the API include the following header elements. As a best practice, we recommend that you log these values.

Element Description
<requestId> Uniquely identifies this request. If you have any support issues, sending us this ID will enable us to find your request more easily.
<responseTime> Elapsed time between the web service receiving the request and sending the response.

Example Response

The following code shows an example of a SOAP response for the previous request.

<soap:Envelope xmlns:soap="">
    <ResponseHeader xmlns="">
    <getAdUnitsByStatementResponse xmlns="">