title: php curl & ThingsPeak
body: <p>Can anyone help me ? - I have no idea what I'm doing wrong....
  The normal upload with only one record works fine, but I can't get the bulk_upload in the json-format to work.
  This is the code (channelID and Key changed) - but no data arrives at ThingsPeak!</p>
  <pre><code>&lt;?php
  $age = '{
      &quot;write_api_key&quot;: &quot;XJZRU8Z8FMW&quot;,
      &quot;updates&quot;: [{
              &quot;created_at&quot;: &quot;2022-01-30 10:26:2 -0500&quot;,
              &quot;field1&quot;: 100
          },
          {
              &quot;created_at&quot;: &quot;2022-01-30 10:26:23 -0500&quot;,
              &quot;field1&quot;: &quot;red&quot;,
              &quot;field2&quot;: &quot;blue&quot;,
              &quot;field3&quot;: &quot;green&quot;,
              &quot;field4&quot;: &quot;fish&quot;,
              &quot;field5&quot;: &quot;alimony&quot;,
              &quot;field6&quot;: 100,
              &quot;field7&quot;: 100,
              &quot;field8&quot;: 100,
              &quot;status&quot;: &quot;good&quot;
          },
          {
              &quot;created_at&quot;: &quot;2022-01-30 10:26:26 -0500&quot;,
              &quot;field1&quot;: 1500,
              &quot;field2&quot;: 150,
              &quot;field3&quot;: 100,
              &quot;field4&quot;: 100,
              &quot;field5&quot;: 100,
              &quot;field6&quot;: 100,
              &quot;field7&quot;: 100,
              &quot;field8&quot;: 100,
              &quot;latitude&quot;: 123,
              &quot;longitude&quot;: 23,
              &quot;elevation&quot;: 34
          }
      ]
  }';
  $content = json_encode($age);
  $url = &quot;https://api.thingspeak.com/channels/17253/bulk_update.json&quot;;    
  $curl = curl_init($url);
  curl_setopt($curl, CURLOPT_HEADER, false);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($curl, CURLOPT_HTTPHEADER,
          array(&quot;Content-type: application/json&quot;));
  curl_setopt($curl, CURLOPT_POST, true);
  curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
  $json_response = curl_exec($curl);
  $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  if ( $status != 201 ) {
      die(&quot;Error: call to URL $url failed with status $status, response $json_response, curl_error &quot; . curl_error($curl) . &quot;, curl_errno &quot; . curl_errno($curl));
  }
  curl_close($curl);
  $response = json_decode($json_response, true);
  ?&gt;
  </code></pre>