[annotator-dev] ID generation

Randall Leeds randall at bleeds.info
Fri Jul 17 19:55:28 UTC 2015


That is up to you.

Annotator is written so that if there is no ID, it will perform a POST. You
must add an "id" field on the server in this case and return the annotation
to the client.

If you add an "id" field before you save the annotation, it will be a PUT
request.

Either way is fine. With a PUT you will ensure that you do not create
duplicate annotations when the network is bad and requests are repeated.
With POST your server may generate ids that are more efficient for storage,
or otherwise serve as better primary keys in your database.

On Fri, Jul 17, 2015, 01:44 PRATHIKSHA S R <prathikshasr004 at gmail.com>
wrote:

> I am building a restful api in php to implement annotator js to store
> annotations in a database on my own server. For each annotation, the js
> generates id or my php code should generate id and append it to the json?
>
> Thank you!
> _______________________________________________
> annotator-dev mailing list
> annotator-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/annotator-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150717/865b07b2/attachment-0004.html>


More information about the annotator-dev mailing list