Davincible / goinsta

Unofficial Instagram API written in Golang (v2022)
MIT License
182 stars 56 forks source link

Accept pending friendships #19

Closed dnsbty closed 2 years ago

dnsbty commented 2 years ago

I want to be able to accept and ignore pending friendships, and I can't find a function to be able to do that anywhere in the documentation. I would be happy to contribute this in a PR, but I don't really know how to look at the requests the Android app makes. On the web though, it's with this endpoint:

POST https://www.instagram.com/web/friendships/{user_pk}/approve/
POST https://www.instagram.com/web/friendships/{user_pk}/ignore/

If trying to replicate in the app, you would have to have two accounts. One of them would need to be set to private, then the second would need to request to follow the private account. Then from the private account you would have a notification in your feed about the new request, and you could then accept or reject it there.

Davincible commented 2 years ago

You're right, this hasn't been implemented yet. Thanks for the request. I will look at it this week!

Davincible commented 2 years ago

Sorry for the delay, but this has now been implemented!

Check account_test.go for an example.

Currently, pagination has not been implemented as my test accounts don't have enough follow requests. But you can always fetch the pending friendships again after processing the previous ones, to get new ones.

dnsbty commented 2 years ago

Thanks for taking this on! I really appreciate it.