RelationshipsApi
Import
Import
Constructors
Constructor
-
Parameters
-
Optional configuration: Configuration
-
basePath: string = ...
-
axios: AxiosInstance = ...
Returns RelationshipsApi
-
Methods
Create Relationship
-
Parameters
-
Optional withPresence: boolean
-
Optional withProfile: boolean
-
Optional addRelationshipRequest: AddRelationshipRequest
-
Optional options: AxiosRequestConfig<any>
Returns Promise<AxiosResponse<Relationship, any>>
-
Delete Relationship
-
Deletes a relationship with the given
relationshipId
.Parameters
-
relationshipId: string
The relationship ID.
-
Optional options: AxiosRequestConfig<any>
Returns Promise<AxiosResponse<void, any>>
-
Get Relationships
-
Retrieves a list of all relationships a given user is involved in. Relationships of all types are returned in a single array. It's up to the caller to use the
type
of the relationship object to determine the appropriate way to handle that relationship. For relationship types that allow it, additional presence and profile data will be provided for each member of the relationship (unless excluded using thewithPresence
andwithProfile
parameters). By default, we limit the number of relationships that can be returned in a single request. You can make subsequent requests to this API using theoffset
parameter to paginate through the remaining relationships.Parameters
-
Optional limit: number
-
Optional offset: number
-
Optional withPresence: boolean
-
Optional withProfile: boolean
-
Optional type: RelationshipType[]
-
Optional options: AxiosRequestConfig<any>
Returns Promise<AxiosResponse<Relationships, any>>
-
Creates a relationship with one or more members. A relationship has a
type
and a list ofmembers
who are the users involved in the relationship. The requirements for creating a relationship are different depending on thetype
of the relationship. Each member of the relationship can also be given an optionalrole
which may indicate some semantic of the the relationship. A member can be identified by their user id or profile name. For most relationships, if the caller is a user and is not included in themembers
list, that user's membership is inferred to exist using the appropriate role. For example, if you create aFRIEND_REQUEST
relationship with one member, the caller is inferred to be the source of the relationship. ## Relationship Types ###FRIEND_REQUEST
Relationship AFRIEND_REQUEST
relationship indicates that a user would like to create a friendship with another user. If noFRIEND
relationship (i.e. friendship) exists between the two users then the receiving game client will be notified that aFRIEND_REQUEST
relationship has been created, and the game can choose to notify the user and provide a mechanism for them to accept the friend request. A friend request is accepted by creating a reciprocalFRIEND_REQUEST
relationship targeting the originating user. AFRIEND_REQUEST
relationship can ONLY have two members. The members have a role of eitherSOURCE
orTARGET
to indicate the sender and the receiver of the request. If not provided the caller of the API will be inferred to be theSOURCE
and the other member will be theTARGET
. A user cannot create a relationship with themselves as theTARGET
. ###FRIEND
Relationship AFRIEND
relationship cannot be directly created by a user, but is implicitly created when both users have createdFRIEND_REQUEST
relationships with each other (i.e. sent and accepted a friend request). A service account or admin user can directly create aFRIEND
relationship between specific users. AFRIEND
relationship is not directed, so themembers
of the relationships do not have an assignedrole
. ### BLOCK Relationship ABLOCK
relationship is a one-way relationship that enables a user to indicate that another user should be prevented from interacting with themselves for certain features and functionality (e.g. hiding presence, preventing the user from sending messages to them, etc.). Presence blocking will be handled by the service to ensure that blocked users are unable to view the presence details of the blocker. For other functionality it is up to the developer to consume theBLOCK
relationships data and provide additional functionality. For example, a game client could filter out lobbies created by users that have been blocked, or a game server could prevent a blocked user from joining a game instance.Create a new relationship.
{RequiredError}
RelationshipsApi