Skip to content

How do I create an annotation using the h API? #9572

Answered by seanh
seanh asked this question in Q&A
Discussion options

You must be logged in to vote

You can do this in your local development, on staging or on production.

  1. Go to http://localhost:5000/account/developer and create a developer token to authenticate API requests

  2. Make an API request fro the command line. In this example I'm using Using HTTPie:

    $ http POST 'http://localhost:5000/api/annotations' uri=foo Authorization:'Bearer 6879-lzF***uw4'
    

    See the docs for the annotation API. uri is the only required field.

    If you want to create an annotation in a group just add the group's pubid:

    $ http POST 'http://localhost:5000/api/annotations' uri=foo group=bLw***2dL Authorization:'Bearer 6879-lzF***uw4'
    

    You could easily script this. For example to create 10,000 annotations (using f…

Replies: 1 comment

Comment options

seanh
May 15, 2025
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by seanh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant