Closed alordiel closed 5 years ago
The annotation needs to have a ranges
property for it to be highlighted under the default ui
plugin. You'll have to return the full annotation from the response. What does the request look like?
I'm returning what is written in the documentation so basically It is only the id
, uri
, and user
. I will give a try with returning the ranges as well. And will let you know if it is working.
Thanks @tilgovi That was it. So now my php code is returning something like this as API response:
$json = $request->get_json_params();
// some other code
return ['id'=> $my_id, 'uri'=>site_url(), 'ranges'=> $json['ranges'], 'text'=> $json['text']];
And it works just at it should.
Hello, I'm trying to create a WordPress plugin using annotator v.2 and the store module with targeting the site's custom API for storing the annotations. I have so far created the API and had worked out to get at least to receive the "POST" method on creating annotation.
The problem I got is that whenever the user adds an annotation it get's stored, the API returns the ID and status 200 but on the front end the annotation disappeared and it seems that is not created at all.
My JS is follow:
Request header
Response
Response payload
Am I missing something?