Asana::createSubTask PHP Method

createSubTask() public method

Creates a subtask in the parent task ID
public createSubTask ( string $parentId, array $data, array $opts = [] ) : string
$parentId string The id of the parent task.
$data array Array of data for the task following the Asana API documentation. Example: array( "name" => "Hello World!", "notes" => "This is a task for testing the Asana API :)", "assignee" => "176822166183", "followers" => array( "37136", "59083" ) )
$opts array Array of options to pass (@see https://asana.com/developers/documentation/getting-started/input-output-options)
return string JSON or null
    public function createSubTask($parentId, $data, array $opts = array())
    {
        $data = array('data' => $data);
        $data = json_encode($data);
        $options = http_build_query($opts);
        return $this->askAsana($this->taskUrl . '/' . $parentId . '/subtasks?' . $options, $data, ASANA_METHOD_POST);
    }