How to use datapoints batch creation

ClickMeter’s APIs offers an endpoint to create multiple datapoints at once (maximum 25). It could be useful in case of creation of a large number of datapoints, in order to reduce the number of requests to ClickMeter, so the elaboration time of the operation.

Usage:

for ($i = 0; $i < 25; $i++) {

$datapoint = array(

 'type' => 1,

 'title' => $title . $i,

 "groupId" => $TP_campaign_id

);

$body["list"][] = $datapoint;

$output = api_request('http://apiv2.clickmeter.com/datapoints/batch', 'POST', json_encode($body) , $api_key);

}

 

Parameters:

This request needs a body to carry arguments, in JSON format. Body have to contain a “list” element that includes all datapoints to be created. The arguments of each datapoint are the same ones used for a single datapoint creation.

  • list: an array to include all datapoints to be created.


Return value:

The response body will contain an array of “results” consisting in the list of created datapoints, with related data.

Have more questions? Submit a request

0 Comments

Article is closed for comments.