Properties

$uuid

$uuid : array

UUID holds the File UUID

Type

array

$timeout

$timeout : integer

Timeout represents the HTTP timeout when HTTP requests to the SinusBot API are performed

Type

integer

$token

$token : string

Token is the SinusBot auth token which will be there temporary stored.

Type

string

$url

$url : string

URL is the SinusBot URL with the port and the HTTP protocol

Type

string

$headers

$headers : array

headers are http headers which will be added on every request

Type

array

$file

$file : array

File stores the initial received file data

Type

array

Methods

__construct()

__construct(\SinusBot\API  $api, array  $file) 

__construct

Parameters

\SinusBot\API $api

SinusBot API

array $file

SiusBot File array

addHeader()

addHeader(string  $key, string  $value) 

addHeader adds a header to every http request

Parameters

string $key

http header key

string $value

http header value

setAuthToken()

setAuthToken(string  $token) 

setAuthToken overrides the auth token

Parameters

string $token

Auth-Token, when you want to override

getTitle()

getTitle() : string

getTitle returns the title

Returns

string —

filename

getUUID()

getUUID() : string

getUUID returns the uuid

Returns

string —

file UUID

getType()

getType() : string

getType returns the file type

Returns

string —

type: url, folder

getArtist()

getArtist() : string

getArtist returns the artist

Returns

string —

file UUID

getParent()

getParent() : string

getUUID returns the uuid

Returns

string —

file UUID

delete()

delete() : array

delete

Returns

array —

status

getThumbnail()

getThumbnail() : string

getThumbnail

Returns

string —

url

edit()

edit(Array  $options) : array

edit

Parameters

Array $options
  • keys: displayTitle, title, artist, album...

Returns

array —

status

move()

move(string  $parent = "") : array

move

Parameters

string $parent

subfolder UUID, empty value means root folder

Returns

array —

status

request()

request(string  $path, string  $method = "GET", string  $payload = null, boolean  $encoded = false) : array

request executes a request to the SinusBot API

Parameters

string $path

/api/v1/

string $method

http method

string $payload

http POST payload

boolean $encoded

when not encoded it will be JSON marshalled

Returns

array —

decoded JSON response

getError()

getError(integer  $code) : string

getError returns the string representive to the given http status code

Parameters

integer $code

http status code

Returns

string —

http status code string representive