send_rocket_attachment: Sends an attachment to a rocket user/channel

Description Usage Arguments Details Value Examples

View source: R/send_rocket_attachment.R

Description

send_rocket_attachment Sends an attachment to a user or channel or group

Usage

1
send_rocket_attachment(url, user_id, auth_token, receiver, filename)

Arguments

url

The url of the rocket.chat server (has to be complete, with http or https).

user_id

The users ID retrieved from 'get_rocket_credentials'.

auth_token

The users authentication Token retrieved from 'get_rocket_credentials'.

receiver

The id of the user/channel/group that will receive the attachment (with '@' for users and '#' for channels and users)

filename

The path of the file to be uploaded.

Details

This function only returns the status code of the POST request to upload an attachment for any user or channel or group in a Rocket.chat server.

Value

This function only returns the answer of the POST request

Examples

1
2
3
4
5
6
7
8
## Not run: 
send_rocket_attachment(url        = 'http://localhost:8000/',
                       user_id    = '<ROCKET_USER_ID>',
                       auth_token = '<ROCKET_USER_AUTH_TOKEN>',
                       receiver   = '#general',
                       filename   = 'path_to_file')

## End(Not run)

paeselhz/rocketeer documentation built on Nov. 11, 2019, 1:23 a.m.