Create bridge login session
client.Bridges.LoginSessions.New(ctx, bridgeID, body) (*LoginSession, error)
POST/v1/bridges/{bridgeID}/login-sessions
Start a temporary bridge login session to connect a new chat account or reconnect an existing bridge login. Omit loginID and accountID to connect a new account.
Create bridge login session
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"),
)
loginSession, err := client.Bridges.LoginSessions.New(
context.TODO(),
"local-whatsapp",
beeperdesktopapi.BridgeLoginSessionNewParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", loginSession.BridgeID)
}
{
"bridgeID": "bridgeID",
"loginSessionID": "loginSessionID",
"status": "waiting_for_input",
"account": {
"accountID": "accountID",
"bridge": {
"id": "id",
"provider": "cloud",
"type": "type"
},
"status": "connected",
"user": {
"id": "id",
"cannotMessage": true,
"email": "email",
"fullName": "fullName",
"imgURL": "imgURL",
"isSelf": true,
"phoneNumber": "phoneNumber",
"username": "username"
},
"capabilities": {
"allowed_reactions": [
"string"
],
"archive": true,
"custom_emoji_reactions": true,
"delete": -2,
"delete_chat": true,
"delete_chat_for_everyone": true,
"delete_for_me": true,
"delete_max_age": 0,
"disappearing_timer": {
"omit_empty_timer": true,
"timers": [
0
],
"types": [
"after_read"
]
},
"edit": -2,
"edit_max_age": 0,
"edit_max_count": 0,
"file": {
"foo": {
"mime_types": {
"foo": -2
},
"caption": -2,
"max_caption_length": 0,
"max_duration": 0,
"max_height": 0,
"max_size": 0,
"max_width": 0,
"view_once": true
}
},
"formatting": {
"foo": -2
},
"location_message": -2,
"mark_as_unread": true,
"max_text_length": 0,
"member_actions": {
"ban": -2,
"invite": -2,
"kick": -2,
"leave": -2,
"revoke_invite": -2
},
"message_request": {
"accept_with_button": -2,
"accept_with_message": -2
},
"poll": -2,
"reaction": -2,
"reaction_count": 0,
"read_receipts": true,
"reply": -2,
"state": {
"com.beeper.disappearing_timer": {
"level": -2
},
"m.room.avatar": {
"level": -2
},
"m.room.name": {
"level": -2
},
"m.room.topic": {
"level": -2
}
},
"thread": -2,
"typing_notifications": true
},
"loginID": "loginID",
"network": "network",
"statusText": "statusText"
},
"accountID": "accountID",
"currentStep": {
"fields": [
{
"id": "id",
"initialValue": "initialValue",
"label": "label",
"optional": true,
"placeholder": "placeholder",
"type": "type"
}
],
"stepID": "stepID",
"type": "user_input",
"attachments": [
{}
],
"instructions": "instructions"
},
"error": {
"code": "code",
"message": "message",
"details": {
"foo": "bar"
}
},
"login": {
"bridgeID": "bridgeID",
"loginID": "loginID",
"removeScopes": [
"current-device"
],
"status": "connected",
"accountIDs": [
"string"
],
"statusText": "statusText",
"user": {
"id": "id",
"cannotMessage": true,
"email": "email",
"fullName": "fullName",
"imgURL": "imgURL",
"isSelf": true,
"phoneNumber": "phoneNumber",
"username": "username"
}
},
"loginID": "loginID"
}Returns Examples
{
"bridgeID": "bridgeID",
"loginSessionID": "loginSessionID",
"status": "waiting_for_input",
"account": {
"accountID": "accountID",
"bridge": {
"id": "id",
"provider": "cloud",
"type": "type"
},
"status": "connected",
"user": {
"id": "id",
"cannotMessage": true,
"email": "email",
"fullName": "fullName",
"imgURL": "imgURL",
"isSelf": true,
"phoneNumber": "phoneNumber",
"username": "username"
},
"capabilities": {
"allowed_reactions": [
"string"
],
"archive": true,
"custom_emoji_reactions": true,
"delete": -2,
"delete_chat": true,
"delete_chat_for_everyone": true,
"delete_for_me": true,
"delete_max_age": 0,
"disappearing_timer": {
"omit_empty_timer": true,
"timers": [
0
],
"types": [
"after_read"
]
},
"edit": -2,
"edit_max_age": 0,
"edit_max_count": 0,
"file": {
"foo": {
"mime_types": {
"foo": -2
},
"caption": -2,
"max_caption_length": 0,
"max_duration": 0,
"max_height": 0,
"max_size": 0,
"max_width": 0,
"view_once": true
}
},
"formatting": {
"foo": -2
},
"location_message": -2,
"mark_as_unread": true,
"max_text_length": 0,
"member_actions": {
"ban": -2,
"invite": -2,
"kick": -2,
"leave": -2,
"revoke_invite": -2
},
"message_request": {
"accept_with_button": -2,
"accept_with_message": -2
},
"poll": -2,
"reaction": -2,
"reaction_count": 0,
"read_receipts": true,
"reply": -2,
"state": {
"com.beeper.disappearing_timer": {
"level": -2
},
"m.room.avatar": {
"level": -2
},
"m.room.name": {
"level": -2
},
"m.room.topic": {
"level": -2
}
},
"thread": -2,
"typing_notifications": true
},
"loginID": "loginID",
"network": "network",
"statusText": "statusText"
},
"accountID": "accountID",
"currentStep": {
"fields": [
{
"id": "id",
"initialValue": "initialValue",
"label": "label",
"optional": true,
"placeholder": "placeholder",
"type": "type"
}
],
"stepID": "stepID",
"type": "user_input",
"attachments": [
{}
],
"instructions": "instructions"
},
"error": {
"code": "code",
"message": "message",
"details": {
"foo": "bar"
}
},
"login": {
"bridgeID": "bridgeID",
"loginID": "loginID",
"removeScopes": [
"current-device"
],
"status": "connected",
"accountIDs": [
"string"
],
"statusText": "statusText",
"user": {
"id": "id",
"cannotMessage": true,
"email": "email",
"fullName": "fullName",
"imgURL": "imgURL",
"isSelf": true,
"phoneNumber": "phoneNumber",
"username": "username"
}
},
"loginID": "loginID"
}