Web Content Publisher API . organizations . publications . ctas

Instance Methods

close()

Close httplib2 connections.

create(parent, body=None, ctaId=None, x__xgafv=None)

Creates a CTA.

get(name, x__xgafv=None)

Gets a CTA.

list(parent, pageSize=None, pageToken=None, x__xgafv=None)

Lists CTAs.

list_next(previous_request, previous_response)

Retrieves the next page of results.

patch(name, body=None, updateMask=None, x__xgafv=None)

Updates a CTA.

Method Details

close()
Close httplib2 connections.
create(parent, body=None, ctaId=None, x__xgafv=None)
Creates a CTA.

Args:
  parent: string, Required. The parent publication resource where this CTA will be created. Format: `organizations/{organization}/publications/{publication}`. (required)
  body: object, The request body.
    The object takes the form of:

{ # Represents a Call-To-Action (CTA) configuration for a publication.
  "displayName": "A String", # Required. The user-visible display name of the CTA.
  "name": "A String", # Identifier. The resource name of the Cta. Format: organizations/{organization}/publications/{publication}/ctas/{cta}
  "newsletterConfig": { # Configuration for newsletter signup calls-to-action (CTAs). # Optional. Configuration specific to newsletter signup CTAs. Only populated if type is `NEWSLETTER_SIGNUP`.
    "customConsentText": "A String", # Optional. Custom consent or disclosure text shown to the user.
    "customMessage": "A String", # Optional. A custom message displayed to the user in the signup prompt.
    "nameRequired": True or False, # Optional. Whether the user is required to provide their name to sign up.
    "optInRequired": True or False, # Optional. Whether checking the opt-in checkbox is required.
    "title": "A String", # Required. The title of the newsletter signup prompt.
  },
  "state": "A String", # Output only. The current state of this CTA.
  "surveyConfig": { # Configuration for survey calls-to-action (CTAs). # Optional. Configuration specific to survey CTAs. Only populated if type is `SURVEY`.
    "customMessage": "A String", # Optional. Header prompt shown to readers. If omitted, the server populates the default prompt localized to the parent publication's configured primary language.
    "questions": [ # Optional. Ordered list of questions presented in the survey (1-3 items when `ACTIVE`; 0-3 when `DRAFT`).
      { # A single question within a survey, which can be either a preset question from the catalog or a custom publisher-defined question.
        "customQuestion": { # A custom question defined by the publisher. # Optional. A custom question defined by the publisher.
          "answerChoices": [ # Required. Ordered list of answer choices for the custom question (2-5 items).
            { # An answer choice for a custom survey question.
              "displayText": "A String", # Required. The display text of the answer choice shown to readers.
            },
          ],
          "categoryLabel": "A String", # Optional. Reporting category label sent to Google Analytics (up to 100 characters).
          "displayText": "A String", # Required. The question prompt displayed to readers.
          "id": "A String", # Output only. Server-assigned unique identifier for the custom question.
        },
        "presetQuestion": { # A preset question referencing a template in the survey question catalog. # Optional. A question selected from the preset question catalog.
          "answerIds": [ # Optional. Selected answer choice IDs from the question template. Required (2-5 unique IDs) when the catalog question is `CONFIGURABLE_CHOICES`, and must be omitted for `FIXED_CHOICES`.
            42,
          ],
          "questionId": 42, # Required. ID of the question template from `SurveyQuestionCatalog`.
        },
      },
    ],
  },
  "type": "A String", # Required. The type of this CTA.
}

  ctaId: string, Optional. The unique identifier of the CTA to create. If not specified, the server will generate a random CTA ID.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents a Call-To-Action (CTA) configuration for a publication.
  "displayName": "A String", # Required. The user-visible display name of the CTA.
  "name": "A String", # Identifier. The resource name of the Cta. Format: organizations/{organization}/publications/{publication}/ctas/{cta}
  "newsletterConfig": { # Configuration for newsletter signup calls-to-action (CTAs). # Optional. Configuration specific to newsletter signup CTAs. Only populated if type is `NEWSLETTER_SIGNUP`.
    "customConsentText": "A String", # Optional. Custom consent or disclosure text shown to the user.
    "customMessage": "A String", # Optional. A custom message displayed to the user in the signup prompt.
    "nameRequired": True or False, # Optional. Whether the user is required to provide their name to sign up.
    "optInRequired": True or False, # Optional. Whether checking the opt-in checkbox is required.
    "title": "A String", # Required. The title of the newsletter signup prompt.
  },
  "state": "A String", # Output only. The current state of this CTA.
  "surveyConfig": { # Configuration for survey calls-to-action (CTAs). # Optional. Configuration specific to survey CTAs. Only populated if type is `SURVEY`.
    "customMessage": "A String", # Optional. Header prompt shown to readers. If omitted, the server populates the default prompt localized to the parent publication's configured primary language.
    "questions": [ # Optional. Ordered list of questions presented in the survey (1-3 items when `ACTIVE`; 0-3 when `DRAFT`).
      { # A single question within a survey, which can be either a preset question from the catalog or a custom publisher-defined question.
        "customQuestion": { # A custom question defined by the publisher. # Optional. A custom question defined by the publisher.
          "answerChoices": [ # Required. Ordered list of answer choices for the custom question (2-5 items).
            { # An answer choice for a custom survey question.
              "displayText": "A String", # Required. The display text of the answer choice shown to readers.
            },
          ],
          "categoryLabel": "A String", # Optional. Reporting category label sent to Google Analytics (up to 100 characters).
          "displayText": "A String", # Required. The question prompt displayed to readers.
          "id": "A String", # Output only. Server-assigned unique identifier for the custom question.
        },
        "presetQuestion": { # A preset question referencing a template in the survey question catalog. # Optional. A question selected from the preset question catalog.
          "answerIds": [ # Optional. Selected answer choice IDs from the question template. Required (2-5 unique IDs) when the catalog question is `CONFIGURABLE_CHOICES`, and must be omitted for `FIXED_CHOICES`.
            42,
          ],
          "questionId": 42, # Required. ID of the question template from `SurveyQuestionCatalog`.
        },
      },
    ],
  },
  "type": "A String", # Required. The type of this CTA.
}
get(name, x__xgafv=None)
Gets a CTA.

Args:
  name: string, Required. The resource name of the CTA to retrieve. Format: `organizations/{organization}/publications/{publication}/ctas/{cta}`. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents a Call-To-Action (CTA) configuration for a publication.
  "displayName": "A String", # Required. The user-visible display name of the CTA.
  "name": "A String", # Identifier. The resource name of the Cta. Format: organizations/{organization}/publications/{publication}/ctas/{cta}
  "newsletterConfig": { # Configuration for newsletter signup calls-to-action (CTAs). # Optional. Configuration specific to newsletter signup CTAs. Only populated if type is `NEWSLETTER_SIGNUP`.
    "customConsentText": "A String", # Optional. Custom consent or disclosure text shown to the user.
    "customMessage": "A String", # Optional. A custom message displayed to the user in the signup prompt.
    "nameRequired": True or False, # Optional. Whether the user is required to provide their name to sign up.
    "optInRequired": True or False, # Optional. Whether checking the opt-in checkbox is required.
    "title": "A String", # Required. The title of the newsletter signup prompt.
  },
  "state": "A String", # Output only. The current state of this CTA.
  "surveyConfig": { # Configuration for survey calls-to-action (CTAs). # Optional. Configuration specific to survey CTAs. Only populated if type is `SURVEY`.
    "customMessage": "A String", # Optional. Header prompt shown to readers. If omitted, the server populates the default prompt localized to the parent publication's configured primary language.
    "questions": [ # Optional. Ordered list of questions presented in the survey (1-3 items when `ACTIVE`; 0-3 when `DRAFT`).
      { # A single question within a survey, which can be either a preset question from the catalog or a custom publisher-defined question.
        "customQuestion": { # A custom question defined by the publisher. # Optional. A custom question defined by the publisher.
          "answerChoices": [ # Required. Ordered list of answer choices for the custom question (2-5 items).
            { # An answer choice for a custom survey question.
              "displayText": "A String", # Required. The display text of the answer choice shown to readers.
            },
          ],
          "categoryLabel": "A String", # Optional. Reporting category label sent to Google Analytics (up to 100 characters).
          "displayText": "A String", # Required. The question prompt displayed to readers.
          "id": "A String", # Output only. Server-assigned unique identifier for the custom question.
        },
        "presetQuestion": { # A preset question referencing a template in the survey question catalog. # Optional. A question selected from the preset question catalog.
          "answerIds": [ # Optional. Selected answer choice IDs from the question template. Required (2-5 unique IDs) when the catalog question is `CONFIGURABLE_CHOICES`, and must be omitted for `FIXED_CHOICES`.
            42,
          ],
          "questionId": 42, # Required. ID of the question template from `SurveyQuestionCatalog`.
        },
      },
    ],
  },
  "type": "A String", # Required. The type of this CTA.
}
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
Lists CTAs.

Args:
  parent: string, Required. The parent publication resource whose CTAs to list. Format: `organizations/{organization}/publications/{publication}`. (required)
  pageSize: integer, Optional. The maximum number of CTAs to return. The service may return fewer than this value. If unspecified, at most 50 CTAs will be returned.
  pageToken: string, Optional. A page token, received from a previous `ListCtas` call, to retrieve the next page.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for `ListCtas`.
  "ctas": [ # Output only. The list of CTAs.
    { # Represents a Call-To-Action (CTA) configuration for a publication.
      "displayName": "A String", # Required. The user-visible display name of the CTA.
      "name": "A String", # Identifier. The resource name of the Cta. Format: organizations/{organization}/publications/{publication}/ctas/{cta}
      "newsletterConfig": { # Configuration for newsletter signup calls-to-action (CTAs). # Optional. Configuration specific to newsletter signup CTAs. Only populated if type is `NEWSLETTER_SIGNUP`.
        "customConsentText": "A String", # Optional. Custom consent or disclosure text shown to the user.
        "customMessage": "A String", # Optional. A custom message displayed to the user in the signup prompt.
        "nameRequired": True or False, # Optional. Whether the user is required to provide their name to sign up.
        "optInRequired": True or False, # Optional. Whether checking the opt-in checkbox is required.
        "title": "A String", # Required. The title of the newsletter signup prompt.
      },
      "state": "A String", # Output only. The current state of this CTA.
      "surveyConfig": { # Configuration for survey calls-to-action (CTAs). # Optional. Configuration specific to survey CTAs. Only populated if type is `SURVEY`.
        "customMessage": "A String", # Optional. Header prompt shown to readers. If omitted, the server populates the default prompt localized to the parent publication's configured primary language.
        "questions": [ # Optional. Ordered list of questions presented in the survey (1-3 items when `ACTIVE`; 0-3 when `DRAFT`).
          { # A single question within a survey, which can be either a preset question from the catalog or a custom publisher-defined question.
            "customQuestion": { # A custom question defined by the publisher. # Optional. A custom question defined by the publisher.
              "answerChoices": [ # Required. Ordered list of answer choices for the custom question (2-5 items).
                { # An answer choice for a custom survey question.
                  "displayText": "A String", # Required. The display text of the answer choice shown to readers.
                },
              ],
              "categoryLabel": "A String", # Optional. Reporting category label sent to Google Analytics (up to 100 characters).
              "displayText": "A String", # Required. The question prompt displayed to readers.
              "id": "A String", # Output only. Server-assigned unique identifier for the custom question.
            },
            "presetQuestion": { # A preset question referencing a template in the survey question catalog. # Optional. A question selected from the preset question catalog.
              "answerIds": [ # Optional. Selected answer choice IDs from the question template. Required (2-5 unique IDs) when the catalog question is `CONFIGURABLE_CHOICES`, and must be omitted for `FIXED_CHOICES`.
                42,
              ],
              "questionId": 42, # Required. ID of the question template from `SurveyQuestionCatalog`.
            },
          },
        ],
      },
      "type": "A String", # Required. The type of this CTA.
    },
  ],
  "nextPageToken": "A String", # Output only. A token to retrieve the next page of results, or empty if there are no more results.
}
list_next(previous_request, previous_response)
Retrieves the next page of results.

Args:
  previous_request: The request for the previous page. (required)
  previous_response: The response from the request for the previous page. (required)

Returns:
  A request object that you can call 'execute()' on to request the next
  page. Returns None if there are no more items in the collection.
patch(name, body=None, updateMask=None, x__xgafv=None)
Updates a CTA.

Args:
  name: string, Identifier. The resource name of the Cta. Format: organizations/{organization}/publications/{publication}/ctas/{cta} (required)
  body: object, The request body.
    The object takes the form of:

{ # Represents a Call-To-Action (CTA) configuration for a publication.
  "displayName": "A String", # Required. The user-visible display name of the CTA.
  "name": "A String", # Identifier. The resource name of the Cta. Format: organizations/{organization}/publications/{publication}/ctas/{cta}
  "newsletterConfig": { # Configuration for newsletter signup calls-to-action (CTAs). # Optional. Configuration specific to newsletter signup CTAs. Only populated if type is `NEWSLETTER_SIGNUP`.
    "customConsentText": "A String", # Optional. Custom consent or disclosure text shown to the user.
    "customMessage": "A String", # Optional. A custom message displayed to the user in the signup prompt.
    "nameRequired": True or False, # Optional. Whether the user is required to provide their name to sign up.
    "optInRequired": True or False, # Optional. Whether checking the opt-in checkbox is required.
    "title": "A String", # Required. The title of the newsletter signup prompt.
  },
  "state": "A String", # Output only. The current state of this CTA.
  "surveyConfig": { # Configuration for survey calls-to-action (CTAs). # Optional. Configuration specific to survey CTAs. Only populated if type is `SURVEY`.
    "customMessage": "A String", # Optional. Header prompt shown to readers. If omitted, the server populates the default prompt localized to the parent publication's configured primary language.
    "questions": [ # Optional. Ordered list of questions presented in the survey (1-3 items when `ACTIVE`; 0-3 when `DRAFT`).
      { # A single question within a survey, which can be either a preset question from the catalog or a custom publisher-defined question.
        "customQuestion": { # A custom question defined by the publisher. # Optional. A custom question defined by the publisher.
          "answerChoices": [ # Required. Ordered list of answer choices for the custom question (2-5 items).
            { # An answer choice for a custom survey question.
              "displayText": "A String", # Required. The display text of the answer choice shown to readers.
            },
          ],
          "categoryLabel": "A String", # Optional. Reporting category label sent to Google Analytics (up to 100 characters).
          "displayText": "A String", # Required. The question prompt displayed to readers.
          "id": "A String", # Output only. Server-assigned unique identifier for the custom question.
        },
        "presetQuestion": { # A preset question referencing a template in the survey question catalog. # Optional. A question selected from the preset question catalog.
          "answerIds": [ # Optional. Selected answer choice IDs from the question template. Required (2-5 unique IDs) when the catalog question is `CONFIGURABLE_CHOICES`, and must be omitted for `FIXED_CHOICES`.
            42,
          ],
          "questionId": 42, # Required. ID of the question template from `SurveyQuestionCatalog`.
        },
      },
    ],
  },
  "type": "A String", # Required. The type of this CTA.
}

  updateMask: string, Optional. The list of fields to update.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents a Call-To-Action (CTA) configuration for a publication.
  "displayName": "A String", # Required. The user-visible display name of the CTA.
  "name": "A String", # Identifier. The resource name of the Cta. Format: organizations/{organization}/publications/{publication}/ctas/{cta}
  "newsletterConfig": { # Configuration for newsletter signup calls-to-action (CTAs). # Optional. Configuration specific to newsletter signup CTAs. Only populated if type is `NEWSLETTER_SIGNUP`.
    "customConsentText": "A String", # Optional. Custom consent or disclosure text shown to the user.
    "customMessage": "A String", # Optional. A custom message displayed to the user in the signup prompt.
    "nameRequired": True or False, # Optional. Whether the user is required to provide their name to sign up.
    "optInRequired": True or False, # Optional. Whether checking the opt-in checkbox is required.
    "title": "A String", # Required. The title of the newsletter signup prompt.
  },
  "state": "A String", # Output only. The current state of this CTA.
  "surveyConfig": { # Configuration for survey calls-to-action (CTAs). # Optional. Configuration specific to survey CTAs. Only populated if type is `SURVEY`.
    "customMessage": "A String", # Optional. Header prompt shown to readers. If omitted, the server populates the default prompt localized to the parent publication's configured primary language.
    "questions": [ # Optional. Ordered list of questions presented in the survey (1-3 items when `ACTIVE`; 0-3 when `DRAFT`).
      { # A single question within a survey, which can be either a preset question from the catalog or a custom publisher-defined question.
        "customQuestion": { # A custom question defined by the publisher. # Optional. A custom question defined by the publisher.
          "answerChoices": [ # Required. Ordered list of answer choices for the custom question (2-5 items).
            { # An answer choice for a custom survey question.
              "displayText": "A String", # Required. The display text of the answer choice shown to readers.
            },
          ],
          "categoryLabel": "A String", # Optional. Reporting category label sent to Google Analytics (up to 100 characters).
          "displayText": "A String", # Required. The question prompt displayed to readers.
          "id": "A String", # Output only. Server-assigned unique identifier for the custom question.
        },
        "presetQuestion": { # A preset question referencing a template in the survey question catalog. # Optional. A question selected from the preset question catalog.
          "answerIds": [ # Optional. Selected answer choice IDs from the question template. Required (2-5 unique IDs) when the catalog question is `CONFIGURABLE_CHOICES`, and must be omitted for `FIXED_CHOICES`.
            42,
          ],
          "questionId": 42, # Required. ID of the question template from `SurveyQuestionCatalog`.
        },
      },
    ],
  },
  "type": "A String", # Required. The type of this CTA.
}