Asana::getTaskStories PHP Method

getTaskStories() public method

As usual with queries, stories are returned in compact form. However, the compact form for stories contains more information by default than just the ID. There is presently no way to get a filtered set of stories.
public getTaskStories ( string $taskId, array $opts = [] ) : string
$taskId string
$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 getTaskStories($taskId, array $opts = array())
    {
        $options = http_build_query($opts);
        return $this->askAsana($this->taskUrl . '/' . $taskId . '/stories?' . $options);
    }

Usage Example

コード例 #1
0
<?php

require_once '../asana.php';
// See class comments and Asana API for full info
$asana = new Asana(array('apiKey' => 'XXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXX'));
// Your API Key, you can get it in Asana
$taskId = 10924433056204.0;
$resultJson = $asana->getTask($taskId);
// As Asana API documentation says, when response is successful, we receive a 200 in response so...
if ($asana->responseCode != '200' || is_null($resultJson)) {
    echo 'Error while trying to connect to Asana, response code: ' . $asana->responseCode;
    return;
}
$task = json_decode($resultJson);
echo "Task details:" . PHP_EOL;
var_dump($task);
$resultJson = $asana->getTaskStories($taskId);
// As Asana API documentation says, when response is successful, we receive a 200 in response so...
if ($asana->responseCode != '200' || is_null($resultJson)) {
    echo 'Error while trying to connect to Asana, response code: ' . $asana->responseCode;
    return;
}
$stories = json_decode($resultJson);
echo "Task stories(comments):" . PHP_EOL;
var_dump($stories);
All Usage Examples Of Asana::getTaskStories