1 follower Follow

changeState API endpoint - sending multiple Ids


I'm trying to send multiple Timesheet IDs to the "data/changeState" endpoint but I keep getting back internal error references.

A single reference works using the following POST data:


Multiple like this however fails:


Example references: 3lI3Cqa1zoDydJDS2JjmjO

Is it possible to send multiple Ids in one call? Or would I need to make multiple calls, specifying one Timesheet Id per call?

Jamie Lowe Answered

Please sign in to leave a comment.

1 comment


I have now resolved this issue using the bulk/execute endpoint as follows with the following request in case anybody else stumbles across the same issue as it took me a few hours to figure this out...

foreach($data as $ts) {
$id = $ts['external_id'] //The External Reference from Clarizen TS
$params['requests'][] = [
'url' => "/data/changeState",
'method' => 'POST',
'body' => [
'Ids' => ["/Timesheet/{$id}"],
'state' => '{YOUR_REQUIRED_STATE}'
$this->clarizen = $this->curl_request('/bulk/execute', $params, 'post', $session, $server_details['serverLocation']);
$this->clarizen = json_decode($this->clarizen, true);
foreach($this->clarizen['responses'] as $message) {
if($message['statusCode'] != 200) {
$errors[] = $message['body']['message'];

if(!empty($errors)) {
var_dump($errors); //There will be multiple requests with potentially different errors, log them all.
Jamie Lowe 1 vote
Comment actions Permalink