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 <[email protected]>
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
> [email protected]
> https://lists.okfn.org/mailman/listinfo/annotator-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev
>
_______________________________________________
annotator-dev mailing list
[email protected]
https://lists.okfn.org/mailman/listinfo/annotator-dev
Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev

Reply via email to