2015-07-26 4 views

ответ

0

Вы можете использовать Cumulocity REST API в Node.js сценарии, как в следующем примере:

var request = require('request'), 
    host = 'http://developer.cumulocity.com/', 
    auth = { 
    user: 'tenant/user', 
    pass: 'password', 
    sendImmediately: true 
    }; 

request({ 
    url: host + 'inventory/managedObjects', 
    auth: auth, 
    method: 'POST', 
    headers: { 
    'Content-Type': 'application/json' 
    }, 
    body: { 
    name: 'My new device', 
    type: 'My device type', 
    c8y_IsDevice: {} 
    }, 
    json: true 
}); 

Для доступных конечных точек см REST документацию здесь: http://www.cumulocity.com/guides/rest/introduction/.

 Смежные вопросы

  • Нет связанных вопросов^_^