When creating a client via the API, how do we assign the Client+ role to them and assign them to a project? I've created a script which redirects users to projects based on their email address.
The client is created, but I believe can only be assigned the role of Client (no client+ role exists). The additional client plus permissions come from custom permission: manage tasks, from what I can see in the database.
When I include this permission, the client is never created.
This is my code to create client:
$payload = [
"type" => "Client",
"first_name" => $first_name,
"last_name" => $last_name,
"email" => $email,
"password" => $this->rand_string(15),
"company_id" => $company,
];
$result = $this->client->post("/users", $payload);
$result_json = $result->getJson();
$client_id = @$result_json['single']['id'];
$payload = [
"id" => $project,
"members" => array(
$client_id
),
];
$result = $this->client->post("/projects", $payload);
The client gets created, although without the right permissions, and the client is never added to the project (which means they can't make a task against it).