Skip to content
  • Auto
  • Light
  • Dark
Download Beeper

Archive

Archive or unarchive a chat
client.Chats.Archive(ctx, chatID, body) (*BaseResponse, error)
post/v1/chats/{chatID}/archive

Archive or unarchive a chat. Set archived=true to move to archive, archived=false to move back to inbox

ParametersExpand Collapse
chatID string

Unique identifier of the chat.

body ChatArchiveParams
Archived param.Field[bool]optional

True to archive, false to unarchive

ReturnsExpand Collapse
type BaseResponse struct{…}
Success bool
Error stringoptional
Archive or unarchive a chat
package main

import (
  "context"
  "fmt"

  "github.com/beeper/desktop-api-go"
  "github.com/beeper/desktop-api-go/option"
)

func main() {
  client := beeperdesktopapi.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  baseResponse, err := client.Chats.Archive(
    context.TODO(),
    "!NCdzlIaMjZUmvmvyHU:beeper.com",
    beeperdesktopapi.ChatArchiveParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", baseResponse.Success)
}
{
  "success": true,
  "error": "error"
}
Returns Examples
{
  "success": true,
  "error": "error"
}