Comment on page
Quick Start
To continue with our quick start, you will have to have a Blocworx instance made available to you and a user with an authorization token created. Please contact us for assistance on getting this set up.
We assume in this documentation that you are a Blocworx user. We will be making reference to terms that are used in Blocworx only. If you are still unsure how to do no-code development in Blocworx why not check out our manual instead.
In the below examples we will use example.mydomain.com as the domain your Blocworx instance is hosted on, and [AUTHTOKEN] will represent the token that will be provided to you. The Bloc ID in this example will be 1234.
In this request we will be simply getting data from a bloc without filters or any more criteria. For more advanced Get Data API endpoints check out our Get Data API Reference.
PHP
jQuery
Node JS
Python
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://example.mydomain.com/api/get-data',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'{
"blocId": 1234
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer [AUTHTOKEN]',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var settings = {
"url": "https://example.mydomain.com/api/get-data",
"method": "GET",
"timeout": 0,
"headers": {
"Authorization": "Bearer [AUTHTOKEN]",
"Content-Type": "application/json"
},
"data": JSON.stringify({
"blocId": 1234
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'example.mydomain.com',
'path': '/api/get-data',
'headers': {
'Authorization': 'Bearer [AUTHTOKEN]',
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"blocId": 1234
});
req.write(postData);