Closed andycasey closed 8 years ago
I'll take a look. Most likely related to our internal scopes (permissions) that have 'user' scope. The ones that don't have this scope (I think libraries/library_id is the only one) should work for the time being.
Thanks @jonnybazookatone.
The library_id
seems to be only available through the API (I cannot find it on the BBB UI). For that reason I can't seem to confirm on my side whether libraries/library_id
works for me or not because I can't create a new library via the API or get the IDs of existing ones created via the UI.
Let me know if there's anything I can do to help debug.
(a slightly hackish way) You can get the ID by going to 'Manage Permissions' via the button on your libraries page and press 'make public', and the URL it gives you has an ID at the end, e.g.,
ui.adsabs.harvard.edu/#/public-libraries/PMOjzfbbTZKShRWvIZF6cg
the library id here is PMOjzfbbTZKShRWvIZF6cg
. I tested and this works. Don't worry about any debugging, I'll let you know once I've put a fix in place.
Sorry it didn't work straight off the bat.
Thanks for the library ID tip. No need to apologise!
On Wed, Nov 18, 2015 at 4:38 PM Jonny Elliott notifications@github.com wrote:
(a slightly hackish way) You can get the ID by going to 'Manage Permissions' via the button on your libraries page and press 'make public', and the URL it gives you has an ID at the end, e.g.,
ui.adsabs.harvard.edu/#/public-libraries/PMOjzfbbTZKShRWvIZF6cg
the library id here is PMOjzfbbTZKShRWvIZF6cg. I tested and this works. Don't worry about any debugging, I'll let you know once I've put a fix in place.
Sorry it didn't work straight off the bat.
— Reply to this email directly or view it on GitHub https://github.com/adsabs/adsabs-dev-api/issues/23#issuecomment-157769251 .
Should be working now. JSON variable defined with '' instead of "" can cause a little bit of havoc :-).
Hmm, I'm still having troubles on my end:
arc$ curl -H 'Authorization: Bearer <API_TOKEN>' 'https://api.adsabs.harvard.edu/v1/biblib/libraries'
{
"error": "Unauthorized"
}
arc$ curl -H 'Authorization: Bearer <API_TOKEN>' 'https://api.adsabs.harvard.edu/v1/biblib/libraries/'
{
"error": "Unauthorized"
}
My ADS username is arc, should I email you my API token to see if you get the same behaviour using my token on your end?
Don't worry, I had your token, I just tried the wrong one. It should work now - let me know if it doesn't
curl -H "Authorization: Bearer <TOKEN>" https://api.adsabs.harvard.edu/v1/biblib/libraries
{"libraries": [{"num_documents": 0, "date_last_modified": "2015-11-04T21:03:58.873838",
......
}]}
Woohoo! It works. Thanks @jonnybazookatone!
Hola compadres,
I've branched the ADS client with the aim to make use of the libraries API, but I am encountering some rudimentary troubles. In short, I am getting 404's or unauthorized responses to a simple get method to list all my private libraries:
(Obviously,
<TOKEN>
has been replaced here with my real token)I have one library in BBB, which is public but has no documents. Where have I screwed up here?
Thanks!