toggle

Enables or disables a set of adjustments.

  1. Request
  2. Response
  3. Examples

Request

Request structure in JSON format:

{
  "method": "toggle",
  "params": { /* params */
    "BidModifierToggleItems": [{  /* BidModifierToggleItem */
      "CampaignId": (long),
      "AdGroupId": (long),
      "Type": ( "DEMOGRAPHICS_ADJUSTMENT" | "RETARGETING_ADJUSTMENT" | "REGIONAL_ADJUSTMENT" ), /* required */
      "Enabled": ( "YES" | "NO" ) /* required */
    }, ... ] /* required */
  }
}
ParameterTypeDescriptionRequired
Params structure (for JSON) / ToggleRequest structure (for SOAP)
BidModifierToggleItemsarray of BidModifierToggleItemSets of adjustments to enable or disable. Maximum of 1000 items in the array.Yes
BidModifierToggleItem structure
CampaignIdlongThe campaign ID. Specified when enabling or disabling adjustments at the campaign level.Either CampaignId or AdGroupId
AdGroupIdlongID of the ad group. Specified when enabling or disabling adjustments at the group level.
TypeBidModifierTypeEnumThe type of adjustments to enable or disable: DEMOGRAPHICS_ADJUSTMENT, RETARGETING_ADJUSTMENT, or REGIONAL ADJUSTMENT.Yes
EnabledYesNoEnumYES — enable the set of adjustments; NO — disable the set of adjustments.Yes

Response

Response structure in JSON format:

{
  "result": { /* result */
    "ToggleResults": [{  /* ToggleResult */
      "CampaignId": (long),
      "AdGroupId": (long),
      "Type": ( "DEMOGRAPHICS_ADJUSTMENT" | "RETARGETING_ADJUSTMENT" | "REGIONAL_ADJUSTMENT" ), /* required */
      "Warnings": [{  /* ExceptionNotification */
         "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ]
    }, ... ]
  }
}
ParameterTypeDescription
Result structure (for JSON) / ToggleResponse structure (for SOAP)
ToggleResultsarray of ToggleResultResults of enabling or disabling adjustments.
ToggleResult structure
CampaignIdlongThe campaign ID. Returned when the operation was completed successfully (if it was specified in the request).
AdGroupIdlongID of the ad group. Returned when the operation was completed successfully (if it was specified in the request).
TypeBidModifierTypeEnumType of adjustments that were enabled or disabled.
Warningsarray of ExceptionNotification

Warnings that occurred during the operation.

Errorsarray of ExceptionNotification

Errors that occurred during the operation.

Examples

Example of disabling gender and age adjustments on the campaign level
{
  "method": "toggle",
  "params": {
    "BidModifierToggleItems": [ 
      {
        "CampaignId": 10001,
        "Type": "DEMOGRAPHICS_ADJUSTMENT",
        "Enabled": "NO"
      }
    ]
  }
}