پرش به مطلب اصلی

Reseller Logout Device API

POST /resellerLogoutDevice

Description

This API endpoint allows a reseller to log out a specific device for a user based on both the user ID and device ID. It terminates the device session and provides information about the session post-logout.

Request Body

The request utilizes GraphQL to perform the resellerLogoutDevice mutation.

Mutation:

mutation resellerLogoutDevice ($userId: Int!, $deviceId: String!) {
resellerLogoutDevice (userId: $userId, deviceId: $deviceId) {
id
userId
os
deviceId
loginDate
logoutDate
appVersion
deviceModel
deviceName
fcmToken
isActive
isBlocked
}
}

Variables:

{
"userId": <User_ID>,
"deviceId": "<Device_ID>"
}
  • userId (Integer): The unique identifier of the user whose device is to be logged out.
  • deviceId (String): The unique identifier for the device to be logged out.

Response:

  • Success (200 OK):

    • The response includes details about the device session after the logout operation, including the session ID, user ID, device details, and logout date.
    {
    "data": {
    "resellerLogoutDevice": {
    "id": <Session_ID>,
    "userId": <User_ID>,
    "os": "<Operating_System>",
    "deviceId": "<Device_ID>",
    "loginDate": "<Login_Date>",
    "logoutDate": "<Logout_Date>",
    "appVersion": "<App_Version>",
    "deviceModel": "<Device_Model>",
    "deviceName": "<Device_Name>",
    "fcmToken": "<FCM_Token>",
    "isActive": <Is_Active>,
    "isBlocked": <Is_Blocked>
    }
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with logging out the device, such as an invalid user ID or device ID or insufficient permissions, the response will include an appropriate error message and status code.

Note:

Ensure that both userId and deviceId are correct and correspond to an active session to successfully log out the device. The response will reflect the session status after the logout operation.