Basecamp API Guzzle 6 Json Create Todo Request

public function createBasecampTodo($bucketId, $bcTodoListId, $todoData, $userAgentEmail)
{
    $options = [];
    $options['json'] = $todoData;

    $this->uri = 'https://3.basecampapi.com/3140673/buckets/' . $bucketId . '/todolists/' . $bcTodoListId . '/todos.json';

    $this->_client = new Client([
        'base_uri' => $this->baseUri
    ]);

    $options['headers'] = [
        'User-Agent' => $userAgentEmail,
        "Authorization" => "Bearer " . $this->getAccessToken(),
    ];

    try {
        $this->response = $this->_client->post(
            $this->uri,
            $options
        );

    } catch (ClientException $e) {
        dd($e);
    }

Published by

Joel Gross

Joel Gross is the CEO of Coalition Technologies.