# Bilateral Relationship

**URL:** <https://forum.social.plus/t/bilateral-relationship/900>\
**Category:** General\
**Created:** [August 30, 2023, 7:48am UTC](https://forum.social.plus/t/bilateral-relationship/900 "2023-08-30T07:48:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![openyard](https://avatars.discourse-cdn.com/v4/letter/o/a87d85/32.png) [@openyard](https://forum.social.plus/u/openyard)\
**Post date:** [August 30, 2023, 7:48am UTC](https://forum.social.plus/t/bilateral-relationship/900/1 "2023-08-30T07:48:50Z")

</div>

We’re trying to implement a Bilateral relationship feature in our app using Amity, but we cannot figure out to made it.  
To be clearer, what we wanna achieve is a friendship system like Facebook:  
User A sends a friend request to User B, if B accepts, A follows B and B follows A.  
Using API seems to be impossible, we figure out a dirty way to do it by frontend:  
A send friend request to B, if B accepts → A follows B and B automatically send a request to A.  
When A will login in, there will be a check: if there is a friend request in pending status of a user A already follows, then it will be accepted automatically.  
That’s not totally working, cause since A login again can pass a lot of time and in this meanwhile there won’t be a bidirectional following, this may cause unexpected bugs.  
Do we have any other options?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [August 30, 2023, 11:21am UTC](https://forum.social.plus/t/bilateral-relationship/900/3 "2023-08-30T11:21:55Z")

</div>

Hello, please see another possible solution below:

1. When user register / login =\> Create a community per user. This will serves as a place for friend requests.
2. When A add B as a friend =\> Create a custom post to B’s community.
3. If B clicks accept =\> The system should automatically extracted the postedUserId and then call follow function for B.
4. Create postedUserId’s session and use received accessToken to call follow API to simulate B follow back A.
5. Once everything’s complete. Call delete post to simulate delete friend request when done.

Please note that all these information will be available on console as well.
