METHOD_AcceptFileXfer

This method allows the recipient in the one-to-one chat to accept the file transfer from the sender.

The following table lists the parameters that you can include in this method.

Parameter

Type

Required

Description

contactid

String

√

This parameter specifies the ID of the contact that sends the file.

fileId

String

√

This parameter specifies the file ID created by the BlackBerry Connect client for the file

BEMS response and notification

The following table describes the parameters that BEMS returns and the notification sent to the BlackBerry Connect app when the recipient accepts the file invitation and the file is sent.

Parameter

Type

Description

chatId

String

This parameter specifies the ID of the chat that the file transfer invite is sent to.

method

String

This parameter specifies the invoked method (for example, AcceptFileXfer).

state

String

This parameter specifies the state of the request to BEMS (for example, Processing or Completed).

Code example

The following example sends a request to BEMS to accept the file transfer from "user1" in the chat.

{
 "method":"AcceptFileXfer",
 "params":
  {
    "contactId":"sip:user1@example.com",
    "fileId":"dbc2e7b6-25e8-450e-9670-c9e4f32341bb"
  },
 "id":"c55",
 "jsonrpc":"2.0"
}

If the request is successful, BEMS sends the following response to the BlackBerry Connect app and processes the request.

{
  "id":"c55",
  "error": null,
  "result": 
     {
       "data": 
         {
          "method": "AcceptFileXfer",
          "state": "PROCESSING"
         }
     },
  "jsonrpc": "2.0"
}

If there are no errors, BEMS sends the following notification to the BlackBerry Connect app and sends the file to the recipient.

{
  "id":"c55",
  "error": null,
  "result": 
     {
       "data": 
         {
          "method": "AcceptFileXfer",
          "state": "COMPLETED"
         }
     },
  "jsonrpc": "2.0"
}