Users Methods
| Method Name | Method Type | Description |
|---|---|---|
get_all_users() |
Getter | Retrieves all users and their details. |
get_user_info(user_id) |
Getter | Retrieves detailed information for a user. |
add_user_to_board(board_id, user_ids) |
Setter | Adds one or more users to a board. |
remove_user_from_board(board_id, user_ids) |
Deleter | Removes one or more users from a board. |
Method Details
get_all_users()
get_all_users()
Description: Retrieves all users and their details.
Returns:
A dictionary of user IDs mapped to user names. Returns None or an error message if the request fails.
Example:
users = monday.users.get_all_users()
get_user_info()
get_user_info(user_id)
Description: Retrieves detailed information for a user.
Arguments:
- user_id (int): The ID of the user to retrieve information for.
Returns:
A dictionary containing user details including name, email, phone, country code, creation date, and last activity. Returns None or an error message if the request fails.
Example:
user_info = monday.users.get_user_info(1234567)
add_user_to_board()
add_user_to_board(board_id, user_ids)
Description: Adds one or more users to a board.
Arguments:
- board_id (int): The ID of the board.
- user_ids (list of int): A list of user IDs to add to the board.
Returns:
A list containing the IDs of the newly added users. Returns None or an error message if the request fails.
Example:
added_users = monday.users.add_user_to_board(board_id=123456789,
user_ids=[123456, 987654])
remove_user_from_board()
remove_user_from_board(board_id, user_ids)
Description: Removes one or more users from a board.
Arguments:
- board_id (int): The ID of the board.
- user_ids (list of int): A list of user IDs to remove from the board.
Returns:
True if successful. Returns None or an error message if the request fails.
Example:
success = monday.users.remove_user_from_board(board_id=123456789,
user_ids=[123456, 987654])