SetCampaignAdExtensions REST Template
Sets the campaign’s preference for whether to include the business’ address and phone number in its text ads.
You must be a member of the LocalAttributes pilot program in order to call this operation.
The identifier of the account that owns the campaigns.
The following specifies the HTTP method, supported content types, and base URI that you use in your request.
HTTP method: PUT
Supported content types: XML and JSON
To use JSON, your request URL must include the “format=json” query string.
The key names that you use for the JSON members are the same as the elements of the XML objects shown in the examples below.
Production base URI: https://adcenterapi.microsoft.com/Api/Advertiser/v8/CampaignManagement/CampaignManagementServiceREST.svc
Sandbox base URI: Not available.
If the web browser or firewall does not support the PUT method, use the POST method and include the X-HTTP-Method-Override header. Set the X-HTTP-Method-Override header value to PUT.
The following are the headers to include in your request.
The application access token. This header is not used.
The account identifier. For more information, see Account and Customer Identifiers.
The customer identifier. For more information, see Account and Customer Identifiers.
The developer access token.
The user’s logon password.
The user’s logon user name.
The following XML fragment shows the elements to use to set the address and phone preferences for the specified campaigns. For a description of each element and the header elements that your request must include, see the SetCampaignAdExtensionRequest message.
<SetCampaignAdExtensionsRequest xmlns="http://schemas.datacontract.org/2004/07/HostedService.CampaignManagementService.Rest" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <AdExtensions xmlns:c="https://adcenter.microsoft.com/v8"> <c:AdExtension> <c:CampaignId></c:CampaignId> <c:EnableLocationExtension></c:EnableLocationExtension> <c:PhoneExtension> <c:Country></c:Country> <c:EnableClickToCallOnly></c:EnableClickToCallOnly> <c:EnablePhoneExtension></c:EnablePhoneExtension> <c:Phone></c:Phone> </c:PhoneExtension> </c:AdExtension> </AdExtensions> </SetCampaignAdExtensionsRequest>
The response does not include a body. For a description of the TrackingId header element that the response includes, see the SetCampaignAdExtensionResponse message.
If an error occurs, the service returns one of the following HTTP error codes.
Bad request, which indicates that the request data contains an error. The response will contain either an ApiFaultDetail or AdApiFaultDetail object that identifies the error. For a list of possible error codes, see Campaign Management Error Codes and Common Error Codes.
Method not allowed, which indicates that the URI template is not correct.