create_bot
¶
create_bot(
network_id: NetworkId,
username: GenericString,
group_id: GenericString,
challenge: SensitiveString,
*,
config_overrides: Optional[WickrClientConfig] = None,
display_name: Optional[GenericString] = None,
) -> CreateBotResponse
Creates a new bot in a specified Wickr network. Bots are automated accounts that can send and receive messages, enabling integration with external systems and automation of tasks.
Parameters:
-
network_id(NetworkId) –The ID of the Wickr network where the bot will be created.
-
username(GenericString) –The username for the bot. This must be unique within the network and follow the network's naming conventions.
-
display_name(Optional[GenericString], default:None) –The display name for the bot that will be visible to users in the network.
-
group_id(GenericString) –The ID of the security group to which the bot will be assigned.
-
challenge(SensitiveString) –The password for the bot account.
Raises:
-
BadRequestError–The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.
-
ForbiddenError–Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.
-
InternalServerError–An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.
-
RateLimitError–The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.
-
ResourceNotFoundError–The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.
-
UnauthorizedError–The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.
-
ValidationError–One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create bot successfully
>>> client.create_bot(network_id='12345678', username='analytics_bot', display_name='Analytics Bot', challenge='SecureP@ssw0rd123', group_id='analytics_group')
Create bot - username unavailable
>>> client.create_bot(network_id='12345678', username='support_bot', display_name='Support Bot', group_id='default_group', challenge='SecureP@ssw0rd123')
Create bot - invalid username format
>>> client.create_bot(network_id='12345678', username='bot@invalid', display_name='Test Bot', group_id='default_group', challenge='SecureP@ssw0rd123')
Source code in docs_src/capo_wickr/_services/wickr.py
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 | |