Archive Unarchive

Use this API to archive or unarchive particular user or group chat.

info

{api-base-url} can be obtained from the MirrorFly console.

HTTP request#

curl -X POST "https://{api-base-url}/api/v1/chat/archive?userId=91xxxxx89&chatType=singleChat&action=1"
-H "accept: */*"
-H "Authorization: AuthToken"

Request Params#

ParamDataTypeRequiredDescription
userIdStringYesThe username or group ID of the chat that requires archive or unarchiving
chatTypeStringYesType of chat to be archived or unarchived
actionIntegerYESaction type: 1 for Archive and 0 for Unarchive

Responses#

If successful, this action returns the response body.

{
"status": 200,
"message": "Chat Archived" // or UnArchived
}

Error#

In the case of an error, an error object like below is returned.

When the token passed in Headers is not given or expired

{
"status": 401,
"message": "Token Expired"
}

When try to Archive or Unarchive same current user

{
"status": 400,
"message": "User cannot archive/unarchive oneself"
}

When try to Archive or Unarchive already processed chat

{
"status": 400,
"message": "Chat already archived" // or UnArchived
}

In the case of a Bad Request, an error message is returned

{
"status": 500,
"message": "Chat Archive Failed"
}