Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add approve friendship API call #328

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ script:
- flake8 --max-line-length=120 --exclude=./setup.py,./instagram_private_api/compat.py,./instagram_web_api/compat.py,./instagram_private_api/endpoints/__init__.py
- pylint -E instagram_private_api instagram_web_api

branches:
only:
- master
14 changes: 14 additions & 0 deletions instagram_private_api/endpoints/friendships.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,20 @@ def ignore_user(self, user_id):
params=params)
return res

def approve_user(self, user_id):
"""
Approve a user's follow request.

:param user_id:
:return:
"""
params = {'user_id': user_id, 'radio_type': self.radio_type}
params.update(self.authenticated_params)
res = self._call_api(
'friendships/approve/{user_id!s}/'.format(**{'user_id': user_id}),
params=params)
return res

def remove_follower(self, user_id):
"""
Remove a follower.
Expand Down