Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSONP to the API #2189

Closed
wagoodman opened this Issue Apr 24, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@wagoodman
Copy link

wagoodman commented Apr 24, 2015

Currently the hypothesis API returns JSON, however without a CORS header in the HTTP response then you cannot use the API in a different domain (I see #2186 will take care of that). It may be useful to add a &callback=callbackfunction to a search request to allow JSONP responses (wrap the JSON return with a callback function):
callbackfunction({ "total": 16, "rows": ... });
instead of:
{ "total": 16, "rows": ... }

@tilgovi

This comment has been minimized.

Copy link
Contributor

tilgovi commented Apr 24, 2015

Should be simple. We should upgrade our Pyramid dependency if we need to, though: http://docs.pylonsproject.org/docs/pyramid/en/latest/changes.html#changes-1-5-5

@akuckartz

This comment has been minimized.

Copy link

akuckartz commented Apr 24, 2015

Better CORS than JSONP.

@akuckartz

This comment has been minimized.

Copy link

akuckartz commented Dec 31, 2015

According to #2303 CORS is implemented.

@robertknight

This comment has been minimized.

Copy link
Member

robertknight commented Dec 31, 2015

Yes, CORS has been implemented for the API endpoints at https://hypothes.is/api for all HTTP methods.

For fetching public annotations this is fine. Our authentication process if you want to implement a client that can fetch private annotations or create/update annotations still sucks though. We're going to fix that in the new year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.