test/post-test.php
author durandn
Fri, 03 Jul 2015 16:48:41 +0200
changeset 1035 c1bc8a2b1468
parent 931 0fdce6e14748
permissions -rw-r--r--
Allow the annotation serializer to extract project_id for use in some widget when it is provided in the data

<?php

$data = json_decode(file_get_contents("php://input"));

if (!isset($data->annotations[0]->id)) {
    $data->annotations[0]->id = uniqid("annotation_");
}

if (!isset($data->annotations[0]->type)) {
    $data->annotations[0]->type = uniqid("annotationType_");
}

print_r(json_encode($data));

?>