[annotator-dev] Store endpoint to use when using annotatorit as the backend store

Randall Leeds tilgovi at hypothes.is
Thu Mar 26 02:57:01 UTC 2015


You will have to add the Auth plugin to use your annotateit credentials.

http://annotator.readthedocs.org/en/v1.2.x/plugins/auth.html

I believe the token url for annotateit is http://annotateit.org/api/token

On Fri, Mar 20, 2015 at 11:56 PM, Apurva Jalit <apurva.jalit at gmail.com>
wrote:

> An update to above. I just changed the store endpoint to '
> http://annotateit.org/api' due to which the annotator successful loads
> for a page and the default search query that is made during load '
> http://annotateit.org/api/search' returns success. But when I try to
> create an annotation, I get the error 'Sorry you are not allowed to create
> this annoation' (post request gets 401 in response).
>
> Thanks,
> Apurva Jalit
>
> On Sat, Mar 21, 2015 at 11:27 AM, Apurva Jalit <apurva.jalit at gmail.com>
> wrote:
>
>> Hey,
>> I've gone through the documentation available on the site but some how
>> not able to figure out what end to be given in the store plugin when I want
>> to use annotateit as the backend. Following are some relevant code snippets
>> I am using:
>>
>>         var content = $('p');
>> //content.annotator();
>> var url= document.URL;
>> content.annotator('addPlugin', 'Auth', {
>> tokenUrl: 'http://127.0.0.1:5000/genToken',
>> token: //Using a default token
>> 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0dGwiOjg2NDAwLCJpc3N1ZWRBdCI6IjIwMTUtMDMtMjBUMDY6NDc6MzVaIiwiY29uc3VtZXJLZXkiOiI2MzE0ZjhmZjk0OTY0MGQ0ODAwYjdhNDFlMWZlNjg5NSIsInVzZXJJZCI6IjIifQ.7TUW4rW1XkFrDrGaffOEGu6nVjm-sp5QqapDWKZ9COg'
>> });
>>  content.annotator('addPlugin', 'Store', {
>> // The endpoint of the store on your server.
>> prefix: 'http://annotateit.org/user/abc', //What to use here?
>>
>> //Attach the uri of the current page to all annotations to allow search.
>> annotationData: {
>> 'uri': url
>> },
>>
>> // This will perform a "search" action when the plugin loads. Will
>> // request the last 20 annotations for the current url.
>> // eg. /store/endpoint/search?limit=20&uri=http://this/document/only
>> loadFromSearch: {
>> 'limit': 20,
>> 'uri': url
>> }
>> });
>> });
>>
>> Thanks,
>> Apurva Jalit
>>
>
>
> _______________________________________________
> 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/20150325/856d031e/attachment-0003.html>


More information about the annotator-dev mailing list