lib/TasksService.php
public function create(array $task, array $options = array())
  {
    $attributes = array_intersect_key($task, array_flip(self::$keysToPersist));

    list($code, $createdTask) = $this->httpClient->post("/tasks", $attributes, $options);
    return $createdTask;
  }
public function create(array $task, array $options = array())
  {
    $attributes = array_intersect_key($task, array_flip(self::$keysToPersist));

    list($code, $createdTask) = $this->httpClient->post("/tasks", $attributes, $options);
    return $createdTask;
  }
public function create ( array $ task , array $ options = array ( ) ) { $ attributes = array_intersect_key ( $ task , array_flip ( self :: $ keysToPersist ) ) ; list ( $ code , $ createdTask ) = $ this -> httpClient -> post ( "/tasks" , $ attributes , $ options ) ; return $ createdTask ; }
Create a task

post '/tasks'

Creates a new task
You can create either a **floating** task or create a **related** task and associate it with one of the resource types below:
* [Leads](/docs/rest/reference/leads)
* [Contacts](/docs/rest/reference/contacts)
* [Deals](/docs/rest/reference/deals)

@param array $task This array's attributes describe the object to be created.
@param array $options Additional request's options.

@return array The resulting object representing created resource.
Create a task