Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Protocol Relation

Rick Mak edited this page Apr 7, 2017 · 1 revision

Overview

This is proposed to replace Follow and Friend.

This is the end point for user-user relation. User-user relation is closely related Access Control at Ourd.

The relation here can be unary or binary. For example, follower is unary relation; while friend is binary relation. For binary relation, confirm_request action is needed to establish

relation:save

TBD; default provide follow and friend

relation:fetch

Overview

Returns the list of user mainatined a relation to current user.

Parameters

  • access_token (string, required)

  • user_id (string, optional)

    • Auto derived from access_token. Required for querying others' relations.
  • type (string, required)

    Type of the relation. e.g. following

  • direction (string, optional)

    No effect for binary relation. One of the following:

    • active(default): like following in normal relation
    • passive: like follower in normal follow relation
    • mutual: like mutual follow in normal follow relation

Returns

  • result (array of user objects)

    The user records who meet the specified follow criteria.

relation:add

Request to add another user to the follow list of the current user.

Parameters

  • access_token (string, required)

  • type (string, required)

    Type of the relation.

  • targets (array of string, required)

    The identifier of the user to follow.

relation:delete

Remove another user from the follow list of the current user.

Parameters

  • access_token (string, required)

  • type (string, required)

    Type of the relation.

  • targets (array of string, required)

    The identifier of the user to unfollow.

relation:make_request

(TBD) Request to be a friend.

relation:fetch_request

(TBD) Fetch a list of pending friend request.

relation:confirm_request

(TBD) Confirm a friend request.

relation:ignore_request

(TBD) Ignore a friend request.