adsabs / adsabs-dev-api

Developer API service description and example client code
162 stars 58 forks source link

Recent update? #74

Closed Sbozzolo closed 3 years ago

Sbozzolo commented 3 years ago

Recently, bibslurp stopped working (https://github.com/mkmcc/bibslurp/issues/12#issuecomment-833763778). I suspect that something changed in the APIs. I think that the following used to work:

curl -d "bibcode=2010PhRvD..82j4014W" -H 'Authorization: Bearer MY_TOKEN' 'https://api.adsabs.harvard.edu/v1/export/bibtex'

but now it doesn't anymore and I need to send the data as '-d {"bibcode":"2010PhRvD..82j4014W"}.

I cannot find any announcement about any change. Has there been any change on the server side?

csgrant00 commented 3 years ago

Hi.

Curl works with export service. bibcode is actually a list, even if you are requesting one bibcode only. So this works

curl -d '{"bibcode":["2010PhRvD..82j4014W"]}' -H 'Authorization: Bearer token' 'https://api.adsabs.harvard.edu/v1/export/bibtex'

{"msg": "Retrieved 1 abstracts, starting with number 1.", "export": "@ARTICLE{2010PhRvD..82j4014W,\n author = {{Witek}, Helvi and {Zilh{\~a}o}, Miguel and {Gualtieri}, Leonardo and {Cardoso}, Vitor and {Herdeiro}, Carlos and {Nerozzi}, Andrea and {Sperhake}, Ulrich},\n title = \"{Numerical relativity for D dimensional space-times: Head-on collisions of black holes and gravitational wave extraction}\",\n journal = {\prd},\n keywords = {04.25.dg, 04.50.Gh, Numerical studies of black holes and black-hole binaries, Higher-dimensional black holes black strings and related objects, General Relativity and Quantum Cosmology, Astrophysics

golnaz

On Thu, May 6, 2021 at 3:59 PM Gabriele Bozzola @.***> wrote:

Recently, bibslurp stopped working (mkmcc/bibslurp#12 (comment) https://github.com/mkmcc/bibslurp/issues/12#issuecomment-833763778). I suspect that something changed in the APIs. I think that the following used to work:

curl -d "bibcode=2010PhRvD..82j4014W" -H 'Authorization: Bearer MY_TOKEN' 'https://api.adsabs.harvard.edu/v1/export/bibtex'

but now it doesn't anymore and I need to send the data as '-d {"bibcode":"2010PhRvD..82j4014W"}.

I cannot find any announcement about any change. Has there been any change on the server side?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adsabs/adsabs-dev-api/issues/74, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKDRFLMOOMRD7SGNN43AHLTMLYKZANCNFSM44HZ2CZQ .

Sbozzolo commented 3 years ago

I would like to understand why bibslurp stopped working and I can prevent it from breaking again in the future. What we are doing in bibslurp is what I reported in the first message. I suspect that there has been a recent server-side change and now what we are doing in bibslurp is not allowed anymore. Is this the case?

golnazads commented 3 years ago

export service has not changed, still support both POST and GET. For POST it expects a list of bibcodes, for GET the bibcode is inserted at the end of url. So this works curl -H 'Authorization: Bearer token' 'https://api.adsabs.harvard.edu/v1/export/bibtex/2010PhRvD..82j4014W' sorry I have no explanation how the command you are specifying worked.

Sbozzolo commented 3 years ago

Thanks, with your comments I updated bibslurp so that it works again. I realized that we were using the APIs incorrectly and bibslurp should not have worked in the first place (but it has been working fine for two years!). I cannot think of any other explanation for why it stopped working except that something changed server-side. (I cannot say how recently the package stopped working, it could have been in the past 2/3 months maybe?).

I guess this issue is solved. Thanks!

golnazads commented 3 years ago

Well maybe one explanation. We recently have switched to python 3. Maybe it was working under python 2, even if the signature was not correct. The Python 3 version was released last month.

On Thu, May 6, 2021 at 5:43 PM Gabriele Bozzola @.***> wrote:

Thanks, with your comments I updated bibslurp so that it works again. I realized that we were using the APIs incorrectly and bibslurp should not have worked in the first place (but it has been working fine for two years!). I cannot think of any other explanation for why it stopped working except that something changed server-side. (I cannot say how recently the package stopped working, it could have been in the past 2/3 months maybe?).

I guess this issue is solved. Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/adsabs/adsabs-dev-api/issues/74#issuecomment-833888594, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3M4CCHVTLJVAVDIWFRHPTTMMERXANCNFSM44HZ2CZQ .

Knusper commented 3 years ago

@golnazads that is consistent with when bibslurp stopped working... mystery solved