通过trello api创建团队/组织

I want to create trello teams automatically via an html form from my website.

I wrote a php script that seems to work. For example I can get list of boards or create a new board. But it does not works to create teams.

HTML CODE

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>

<form action="api_method.php" method="post">
  Project Name:<br>
  <input type="text" name="projectName" value="board_test">
  <br><br>
  <input type="submit" value="Submit">
</form> 

<p>If you click the "Submit" button, the form-data will be sent to a page called "api_method.php".</p>

</body>
</html>

I then use a php script to create the new board:

<?php
require("trello_api.php");
$key = 'mykey';
$token = 'mytoken';
$trello = new trello_api($key, $token);

$data = $trello->request('GET', ('member/me/boards'));

$obj = array('name' => $_POST['projectName']);


$trello->request('POST', ('/boards'),$obj);


echo "Board name: " . $data[0]->name . "
 
";
echo "New board: " . $_POST['projectName'];

?>

So that works perfectly but not when I try to do the same thing with "organizations" it doesn't work

$trello->request('POST', ('/organizations'),$obj);

Can you please help me.

I found the solution, I had to use the option "displayName" instead of "name"

<?php
require("trello_api.php");
$key = 'myKey';
$token = 'myToken';
$trello = new trello_api($key, $token);

$data = $trello->request('GET', ('member/me/boards'));

$obj = array('displayName' => $_POST['projectName']);


$trello->request('POST', ('/organizations'),$obj);


echo "Board name: " . $data[0]->name . "
 
";
echo "New board: " . $_POST['projectName'];

?>