Webhook
Use CloudCode's Webhook to deliver data to a web service server.
This can be utilized to integrate data using PlayNANOO on a server that is already set up.
Source Code
// GET Sample
var url = "https://api.playnanoo.com/cloudcode/request/get";
var headers = {
'content-type' : 'application/x-www-form-urlencoded'
};
var contents = {
q1 : "QueryString1",
q2 : "QueryString2"
};
var result = http.request('GET', url, headers, contents);
log.debug(result);
// POST Sample
url = "https://api.playnanoo.com/cloudcode/request/post";
headers = {
'content-type' : 'application/x-www-form-urlencoded'
};
contents = {
formData1 : "Data1",
formData2 : "Data2"
};
var result = http.request('POST', url, headers, contents);
log.debug(result);
// PUT Sample
url = "https://api.playnanoo.com/cloudcode/request/put";
headers = {
'content-type' : 'application/json'
};
contents = {
data1 : "DATA1",
data2 : "DATA2"
};
var result = http.request('PUT', url, headers, contents);
log.debug(result);
Information Details
Data Key | Description | Type |
---|---|---|
method | HTTP method (GET, POST, PUT, DELETE) | string |
url | Web service URL | string |
headers | HTTP request headers | object |
contents | HTTP request data | object |