π Reference#
- class meapi.Me(phone_number: Optional[Union[int, str]] = None, access_token: Optional[str] = None, activation_code: Optional[str] = None, credentials_manager: Optional[CredentialsManager] = None, new_account_details: Optional[NewAccountDetails] = None, interactive_mode: bool = False, session: Optional[Session] = None)#
- The
Me
Client. Used to interact with MeAPI.
Examples to setting up the client:
>>> from meapi import Me >>> me = Me(phone_number=972123456789, activation_code='123456') # Unofficial method with pre-provided activation code. >>> me = Me(interactive_mode=True) # With interactive mode (prompt for missing data instead of raising exceptions). >>> me = Me(access_token='xxxxxxxxxxxx') # Official method, access token is required (saved in memory). >>> me = Me(phone_number=972123456789, credentials_manager=RedisCredentialsManager(redis_con)) # With custom credentials manager. >>> me = Me(phone_number=972123456789, activation_code='123456', new_account_details=NewAccountDetails(first_name='Chandler', last_name='Bing')) # New account registration.
- Parameters:
interactive_mode (
bool
) β IfTrue
, the client will prompt for missing data instead of raising exceptions (See Interactive mode). Default:False
.phone_number (
str
|int
|None
) β International phone number format (Required on the Unofficial method). Default:None
.access_token (
str
|None
) β Official access token (Required on the Official method). Default:None
activation_code (
str
|None
) β Activation code (NeedActivationCode
exception will be raised if not provided andinteractive_mode
isFalse
). Default:None
credentials_manager (
CredentialsManager
|None
) β Credentials manager to use in order to store and manage the credentials (See Credentials Manager). Default:JsonCredentialsManager
.new_account_details (
NewAccountDetails
|None
) β Account details for new account registration without the need for a prompt (even ifinteractive_mode
isTrue
). Default:None
.session (
requests.Session
|None
) β requests Session object. Default:None
.
- Raises:
NotValidPhoneNumber β If
phone_number
is not valid.NotValidAccessToken β If
access_token
is not valid.NeedActivationCode β If the account is not activated and
activation_code
is not provided andinteractive_mode
isFalse
.IncorrectActivationCode β If the
activation_code
is incorrect andinteractive_mode
isFalse
.ActivationCodeExpired β If the
activation_code
is correct but expired (Request a new one) andinteractive_mode
isFalse
.MaxValidateReached β If the
activation_code
is not correct and the max number of tries reached (Request a new one).ValueError β If both
phone_number
andaccess_token
are provided.NewAccountException β If this is new account and
new_account_details
is not provided andinteractive_mode
isFalse
.TypeError β If
credentials_manager
is not an instance ofCredentialsManager
.BlockedAccount β If the account is blocked (You need to contact Me support).
IncorrectPwdToken β If the
pwd_token
provided by the credentials manager is broken (You need to re-login).PhoneNumberDoesntExists β If the
phone_number
never request an activation code.BrokenCredentialsManager β If the
credentials_manager
not providing the expected data.ForbiddenRequest β In the official method, if the
access_token
is not valid.FrozenInstance β If you try to change the value of an attribute.
- The
- βοΈ Client
- π Search
- π Profile
- π Social
- π₯ Group names
- π¬ Comments
- π€ Account
Me.get_uuid()
Me.get_saved_contacts()
Me.get_unsaved_contacts()
Me.block_profile()
Me.unblock_profile()
Me.block_numbers()
Me.unblock_numbers()
Me.get_blocked_numbers()
Me.upload_random_data()
Me.suspend_account()
Me.delete_account()
Me.add_contacts()
Me.remove_contacts()
Me.add_calls_to_log()
Me.remove_calls_from_log()
- π Location
- π Notifications
- βοΈSettings
- π© Advanced
- β Raw
- π Auth
- π€ Account
add_calls_raw()
add_contacts_raw()
block_numbers_raw()
block_profile_raw()
delete_account_raw()
get_blocked_numbers_raw()
get_my_profile_raw()
get_profile_raw()
phone_search_raw()
remove_calls_raw()
remove_contacts_raw()
suspend_account_raw()
unblock_numbers_raw()
unblock_profile_raw()
update_fcm_token_raw()
update_profile_details_raw()
upload_image_raw()
- π Social
add_social_token_raw()
add_social_url_raw()
approve_comment_raw()
ask_group_rename_raw()
block_comments_raw()
delete_comment_raw()
delete_group_raw()
friendship_raw()
get_comment_raw()
get_comments_raw()
get_deleted_groups_raw()
get_groups_raw()
get_my_social_raw()
get_news_raw()
ignore_comment_raw()
like_comment_raw()
locations_shared_by_me_raw()
locations_shared_with_me_raw()
numbers_count_raw()
publish_comment_raw()
remove_social_raw()
report_spam_raw()
restore_group_raw()
share_location_raw()
stop_shared_locations_raw()
stop_sharing_location_raw()
suggest_turn_on_comments_raw()
suggest_turn_on_location_raw()
suggest_turn_on_mutual_raw()
switch_social_status_raw()
unlike_comment_raw()
update_location_raw()
who_deleted_raw()
who_watched_raw()
- βοΈSettings
- π Notifications
- π Models
- πΉ Base model
- π Profile model
- π§ User model
- π€ Contact model
- π€² Common model
_CommonMethodsForUserContactProfile
_CommonMethodsForUserContactProfile.as_vcard()
_CommonMethodsForUserContactProfile.block()
_CommonMethodsForUserContactProfile.friendship()
_CommonMethodsForUserContactProfile.get_comments()
_CommonMethodsForUserContactProfile.get_profile()
_CommonMethodsForUserContactProfile.report_spam()
_CommonMethodsForUserContactProfile.unblock()
- π₯ Group model
- π± Social model
- π¬ Comment model
- π Watcher model
- β Deleter model
- π€ Friendship model
- π Notification model
- βοΈ Settings model
- π« BlockedNumber model
- π MutualContact model
- π Others
- π Credentials Manager
- β Exceptions
MeApiException
IncorrectPwdToken
NewAccountException
UnfinishedRegistration
PhoneNumberDoesntExists
IncorrectActivationCode
MaxValidateReached
BlockedMaxVerifyReached
ActivationCodeExpired
SearchPassedLimit
ProfileViewPassedLimit
UserCommentsDisabled
UserCommentsPostingIsNotAllowed
CommentAlreadyApproved
CommentAlreadyIgnored
BlockedAccount
ForbiddenRequest
MeException
NotValidPhoneNumber
NotValidAccessToken
NotLoggedIn
NeedActivationCode
ContactHasNoUser
FrozenInstance
BrokenCredentialsManager