Перейти к основному содержимому

Logout Device by Device ID API

POST /logoutDeviceByDeviceId

Description

This API endpoint allows users to log out a device using its device ID. It terminates the device session and returns information about the session after logout.

Request Body

The request utilizes GraphQL to perform the logoutDeviceByDeviceId mutation.

Mutation:

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

Variables:

{
"deviceId": "<Device_ID>"
}
  • 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": {
    "logoutDeviceByDeviceId": {
    "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 device ID or other errors, the response will include an appropriate error message and status code.

Note:

Ensure that the deviceId provided corresponds to an active device session to successfully log out the device. The response will reflect the session status after the logout operation.