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
typeof 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 thewithPresenceandwithProfileparameters). 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 theoffsetparameter 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
typeand a list ofmemberswho are the users involved in the relationship. The requirements for creating a relationship are different depending on thetypeof the relationship. Each member of the relationship can also be given an optionalrolewhich 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 thememberslist, that user's membership is inferred to exist using the appropriate role. For example, if you create aFRIEND_REQUESTrelationship with one member, the caller is inferred to be the source of the relationship. ## Relationship Types ###FRIEND_REQUESTRelationship AFRIEND_REQUESTrelationship indicates that a user would like to create a friendship with another user. If noFRIENDrelationship (i.e. friendship) exists between the two users then the receiving game client will be notified that aFRIEND_REQUESTrelationship 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_REQUESTrelationship targeting the originating user. AFRIEND_REQUESTrelationship can ONLY have two members. The members have a role of eitherSOURCEorTARGETto indicate the sender and the receiver of the request. If not provided the caller of the API will be inferred to be theSOURCEand the other member will be theTARGET. A user cannot create a relationship with themselves as theTARGET. ###FRIENDRelationship AFRIENDrelationship cannot be directly created by a user, but is implicitly created when both users have createdFRIEND_REQUESTrelationships with each other (i.e. sent and accepted a friend request). A service account or admin user can directly create aFRIENDrelationship between specific users. AFRIENDrelationship is not directed, so themembersof the relationships do not have an assignedrole. ### BLOCK Relationship ABLOCKrelationship 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 theBLOCKrelationships 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