How to add datapoint permissions to a guest

// POST /account/guests/{id}/datapoint/permissions/patch

var model = {

   action: "add", // actions: add, remove

   id: 274955, // datapoint id

   verb: "rw" // permissions: read: 'r', write: 'rw'

};

$.ajax({

   type: "POST",

   url: 'http://apiv2.clickmeter.com/account/guests/{id}/datapoint/permissions/patch',

   dataType: 'json',

   data: JSON.stringify(model),

   headers: { "X-Clickmeter-AuthKey": 'API-KEY', "Content-type": "application/json" }

})

.successs(function (data) {

   // data: { id: 274955, uri: '/datapoint/274955' }

})

.error(function (jqXhr, textStatus, errorThrown) {

   //jqXhr.responseText - { errors: {errorMessage: 'some message', errorValue: 'property name'}}

});

Have more questions? Submit a request

0 Comments

Article is closed for comments.