Asana::createTag PHP Method

createTag() public method

This method creates a new tag and returns its full record.
public createTag ( string $name, array $data, array $opts = [] ) : string
$name string Tag name
$data array An array containing either workspace or organization and the id. Example: array("workspace" => "3242349871");
$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 createTag($name, $data, array $opts = array())
    {
        $data = array('data' => $data);
        $data['data']['name'] = $name;
        $data = json_encode($data);
        $options = http_build_query($opts);
        return $this->askAsana($this->tagsUrl . '?' . $options, $data, ASANA_METHOD_POST);
    }