Logout Device API
POST /logoutDeviceByUserDeviceId
Description
This API endpoint allows users to log out a device by its user device ID. It terminates the device session and returns information about the session after logout.
Request Body
The request utilizes GraphQL to perform the logoutDeviceByUserDeviceId
mutation.
Mutation:
mutation logoutDeviceByUserDeviceId ($userDeviceId: Int!) {
logoutDeviceByUserDeviceId (userDeviceId: $userDeviceId) {
id
userId
os
deviceId
loginDate
logoutDate
appVersion
deviceModel
deviceName
fcmToken
isActive
isBlocked
}
}
Variables:
{
"userDeviceId": <User_Device_ID>
}
- userDeviceId (Int): The unique identifier for the device session 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": {
"logoutDeviceByUserDeviceId": {
"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 device ID or other errors, the response will include an appropriate error message and status code.
Note:
Ensure that the userDeviceId
provided corresponds to an active device session to successfully log out the device. The response will reflect the session status after the logout operation.