Adding Data
Adding Data
Adds Data to Blocworx
Request Body
Name
Type
Description
{"returnedStationID":123456}{
"error": "You are not authorized to access this bloc"
}{
"error": [ERROR MESSAGE HERE]
}<?php
$url = "https://subdomain.blocworx.com/api/add-data";
$token = "[AUTHTOKEN]";
$postFields = [
'scanStationID' => '7603',
'jobID' => '1304',
'dataToAdd' => '{"field_1":"Test","another_one":"test","last_one":"testing 12"}',
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: multipart/form-data",
"Authorization: Bearer {$token}"
]);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error: ' . curl_error($ch);
} else {
echo 'Response: ' . $response;
}
curl_close($ch);
Last updated