title: PHP Curl / Todoist / Adding Item
body: <p>I am trying to add an item with the todoist API using PHP Curl according to this:</p>
  
  <blockquote>
    <p><a href="https://developer.todoist.com/?shell#add-an-item" rel="nofollow">https://developer.todoist.com/?shell#add-an-item</a></p>
  </blockquote>
  
  <p>It quotes this code:</p>
  
  <pre class="lang-bash prettyprint-override"><code>$ curl https://todoist.com/API/v6/sync -X POST \
      -d token=0123456789abcdef0123456789abcdef01234567 \
      -d commands='[{"type": "item_add", "temp_id": "43f7ed23-a038-46b5-b2c9-4abda9097ffa", "uuid": "997d4b43-55f1-48a9-9e66-de5785dfd69b", "args": {"content": "Task1", "project_id": 128501470}}]'
  </code></pre>
  
  <p>I am trying this in PHP:</p>
  
  <pre class="lang-php prettyprint-override"><code>$args = '{"content": "Task1", "project_id":'.$project_id.'}';
      $url = "https://todoist.com/API/v6/sync";
      $post_data = array (
          "token" =&gt; $token,
          "type" =&gt; "item_add",
          "args" =&gt; $args,
      );
  
      $ch = curl_init();
  
      curl_setopt($ch, CURLOPT_URL, $url);
  
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  
      curl_setopt($ch, CURLOPT_POST, 1);
  
      curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
  
      $output = curl_exec($ch);
  
      curl_close($ch);
  </code></pre>
  
  <p>So I have the token, the args, the type but I can't seem to get it to work. </p>
  
  <p>What would the PHP equivalent of that call be?</p>