Skip to content

describe_keywords

describe_keywords(
    origination_identity: PhoneOrPoolIdOrArn,
    *,
    config_overrides: Optional[PinpointSMSVoiceV2ClientConfig] = None,
    keywords: Optional[KeywordList] = None,
    filters: Optional[KeywordFilterList] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> DescribeKeywordsResult

Describes the specified keywords or all keywords on your origination phone number or pool.

A keyword is a word that you can search for on a particular phone number or pool. It is also a specific word or phrase that an end user can send to your number to elicit a response, such as an informational message or a special offer. When your number receives a message that begins with a keyword, End User Messaging SMS responds with a customizable message.

If you specify a keyword that isn't valid, an error is returned.

Parameters:

  • origination_identity (PhoneOrPoolIdOrArn) –

    The origination identity to use such as a PhoneNumberId, PhoneNumberArn, SenderId or SenderIdArn. You can use DescribePhoneNumbers to find the values for PhoneNumberId and PhoneNumberArn while DescribeSenderIds can be used to get the values for SenderId and SenderIdArn.

    If you are using a shared End User Messaging SMS resource then you must use the full Amazon Resource Name(ARN).

  • keywords (Optional[KeywordList], default: None ) –

    An array of keywords to search for.

  • filters (Optional[KeywordFilterList], default: None ) –

    An array of keyword filters to filter the results.

  • next_token (Optional[NextToken], default: None ) –

    The token to be used for the next set of paginated results. You don't need to supply a value for this field in the initial request.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return per each request.

Raises:

Source code in docs_src/capo_pinpoint_sms_voice_v2/_services/pinpoint_sms_voice_v2.py
def describe_keywords(
    self,
    origination_identity: "capo_pinpoint_sms_voice_v2.types.phone_or_pool_id_or_arn.PhoneOrPoolIdOrArn",
    *,
    config_overrides: Optional[PinpointSMSVoiceV2ClientConfig] = None,
    keywords: Optional[
        "capo_pinpoint_sms_voice_v2.types.keyword_list.KeywordList"
    ] = None,
    filters: Optional[
        "capo_pinpoint_sms_voice_v2.types.keyword_filter_list.KeywordFilterList"
    ] = None,
    next_token: Optional[
        "capo_pinpoint_sms_voice_v2.types.next_token.NextToken"
    ] = None,
    max_results: Optional[
        "capo_pinpoint_sms_voice_v2.types.max_results.MaxResults"
    ] = None,
) -> "capo_pinpoint_sms_voice_v2.types.describe_keywords_result.DescribeKeywordsResult":
    """<p>Describes the specified keywords or all keywords on your origination phone number or pool.</p> <p>A keyword is a word that you can search for on a particular phone number or pool. It is also a specific word or phrase that an end user can send to your number to elicit a response, such as an informational message or a special offer. When your number receives a message that begins with a keyword, End User Messaging SMS responds with a customizable message.</p> <p>If you specify a keyword that isn't valid, an error is returned.</p>

    Args:
        origination_identity: <p>The origination identity to use such as a PhoneNumberId, PhoneNumberArn, SenderId or SenderIdArn. You can use <a>DescribePhoneNumbers</a> to find the values for PhoneNumberId and PhoneNumberArn while <a>DescribeSenderIds</a> can be used to get the values for SenderId and SenderIdArn.</p> <important> <p>If you are using a shared End User Messaging SMS resource then you must use the full Amazon Resource Name(ARN).</p> </important>
        keywords: <p>An array of keywords to search for.</p>
        filters: <p>An array of keyword filters to filter the results.</p>
        next_token: <p>The token to be used for the next set of paginated results. You don't need to supply a value for this field in the initial request.</p>
        max_results: <p>The maximum number of results to return per each request.</p>

    Raises:
        capo_pinpoint_sms_voice_v2.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient permissions to access the resource.</p>
        capo_pinpoint_sms_voice_v2.errors.internal_server_exception.InternalServerException: <p>The API encountered an unexpected error and couldn't complete the request. You might be able to successfully issue the request again in the future.</p>
        capo_pinpoint_sms_voice_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>A requested resource couldn't be found.</p>
        capo_pinpoint_sms_voice_v2.errors.throttling_exception.ThrottlingException: <p>An error that occurred because too many requests were sent during a certain amount of time.</p>
        capo_pinpoint_sms_voice_v2.errors.validation_exception.ValidationException: <p>A validation exception for a field.</p>
        capo_pinpoint_sms_voice_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_pinpoint_sms_voice_v2.types.describe_keywords_request.DescribeKeywordsRequest]",
    ) -> OperationResponse[
        "capo_pinpoint_sms_voice_v2.types.describe_keywords_result.DescribeKeywordsResult"
    ]:
        import capo_pinpoint_sms_voice_v2._operations.pinpoint_sms_voice_v2.describe_keywords

        output, http_response = (
            capo_pinpoint_sms_voice_v2._operations.pinpoint_sms_voice_v2.describe_keywords.describe_keywords(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeKeywords")
    )
    input_: capo_pinpoint_sms_voice_v2.types.describe_keywords_request.DescribeKeywordsRequest = {
        "origination_identity": origination_identity
    }
    if keywords is not None:
        input_["keywords"] = keywords
    if filters is not None:
        input_["filters"] = filters
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output