Updating Data
Updating Data
Updates records that match key/value pairs provided
GET
https://example.mydomain.com/api/update-records-by-matching-values
Request Body
{
"updated_record_ids": [
1223259
]
}
{
"error": "You are not authorized to access this bloc"
}
{
"error": [ERROR MESSAGE HERE]
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://example.mydomain.com/api/update-records-by-matching-values',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"blocId": "1234",
"fieldsToUpdate" : {
"employee_name" : "Jane Doe",
"more_infor" : "More Info"
},
"searchItems": {
"employee_id": "12345"
}
}',
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/update-records-by-matching-values",
"method": "POST",
"timeout": 0,
"headers": {
"Authorization": "Bearer [AUTHTOKEN]",
"Content-Type": "application/json"
},
"data": JSON.stringify({
"blocId": "1234",
"fieldsToUpdate": {
"employee_name": "Jane Doe",
"more_infor": "More Info"
},
"searchItems": {
"employee_id": "12345"
}
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://example.mydomain.com/api/update-records-by-matching-values',
'headers': {
'Authorization': 'Bearer [AUTHTOKEN]',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"blocId": "1234",
"fieldsToUpdate": {
"employee_name": "Jane Doe",
"more_infor": "More Info"
},
"searchItems": {
"employee_id": "12345"
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import http.client
import json
conn = http.client.HTTPSConnection("example.mydomain.com")
payload = json.dumps({
"blocId": "1234",
"fieldsToUpdate": {
"employee_name": "Jane Doe",
"more_infor": "More Info"
},
"searchItems": {
"employee_id": "12345"
}
})
headers = {
'Authorization': 'Bearer [AUTHTOKEN]',
'Content-Type': 'application/json'
}
conn.request("POST", "/api/update-records-by-matching-values", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Last updated