You are here

public function MoxtraService::createWorkspace in Opigno Moxtra 3.x

Same name and namespace in other branches
  1. 8 src/MoxtraService.php \Drupal\opigno_moxtra\MoxtraService::createWorkspace()

Creates workspace (Moxtra binder).

Parameters

int $owner_id: User ID.

string $name: Workspace name.

Return value

array Response data.

Overrides MoxtraServiceInterface::createWorkspace

File

src/MoxtraService.php, line 379

Class

MoxtraService
Implements Moxtra REST API.

Namespace

Drupal\opigno_moxtra

Code

public function createWorkspace($owner_id, $name) {
  $data = [
    'name' => $name,
    'restricted' => TRUE,
    'conversation' => TRUE,
  ];
  $url = $this
    ->getCreateBinderUrl($owner_id);
  return $this->moxtraConnector
    ->request($url, $data);
}