Error with reading researcher information

177 views
Skip to first unread message

Reem Kurdi

unread,
Sep 24, 2020, 5:38:53 AM9/24/20
to ORCID API Users
Hello, 

I hope whoever is reading this is doing well. 

I am writing this as I am facing an issue when retrieving researcher information. 

I have followed all the steps in the link below and they worked just fine: https://orcid.github.io/orcid-api-tutorial/read/.

However, when I come to input an ORCID ID in my link to allow for HTTP request, such as: 
https://pub.sandbox.orcid.org/v2.1/0000-0003-2135-787X/works

I receive this error message: 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error xmlns="http://www.orcid.org/ns/error">
    <response-code>404</response-code>
    <developer-message>404 Not Found: The resource was not found. Full validation error: ORCID iD 0000-0003-2135-787X not found</developer-message>
    <user-message>The resource was not found.</user-message>
    <error-code>9016</error-code>
    <more-info>https://members.orcid.org/api/resources/troubleshooting</more-info>
</error> 

I have tried changing the ORCID ID multiple times and to different researcher IDs, but I got no luck. 

Can anyone please tell me if they have any idea how to fix this issue or if you have experienced 404 Error before and what you did about it? 

I highly appreciate your time and effort. Thank you. 

Best regards, 

Reem Kurdi
 

Pedro Costa

unread,
Sep 24, 2020, 6:28:01 AM9/24/20
to ORCID API Users
Hi Reem,

The ORCID iD in your call doesn't exist in the Sandbox environment. It exists in the Production environment though.

You can register a test account in Sandbox at https://sandbox.orcid.org/register or you could try reading an existing record like 0000-0002-9227-8514. You can see this record exists here:


I hope this helps.

Kind regards,

Pedro Costa
QA & Support Specialist

Reem Kurdi

unread,
Sep 27, 2020, 9:45:31 AM9/27/20
to ORCID API Users
Hello, 

I hope you are doing well. 

Awesome. I have got it working!

My question is now is it possible to have one Access token that I can use with no expiration? I want to be able to use one accesstoken without having to go through the developer steps everytime.

Thank you so much.

Best, 

Reem Kurdi

Pedro Costa

unread,
Sep 28, 2020, 5:25:06 AM9/28/20
to ORCID API Users
Hi Reem,

Access tokens only expire approximately 20 years after being issued (unless it's revoked) so you can continue using the access token you already have.

Pedro Costa
QA & Support Specialist


Reem Kurdi

unread,
Sep 28, 2020, 5:45:39 AM9/28/20
to ORCID API Users
Hello, 

Many thanks for your reply. Always very helpful.

Yes, that is exactly what I have read on the ORCID website. However, if you kindly see the image attached you will see that there is some sort of expiration for using the access token.

Best wishes, 

Reem

access.PNG

Pedro Costa

unread,
Sep 29, 2020, 5:06:43 AM9/29/20
to ORCID API Users
Hi Reem,

I believe that might be some kind of default value shown by Google OAuth 2.0 Playground. When you exchange an authorization code for an access token, you get a response from the ORCID API similar to the below:

{
  "name": "Michael Scott", 
  "access_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
  "expires_in": 631138518, 
  "token_type": "bearer", 
  "orcid": "0000-0002-0819-3674", 
  "scope": "/read-limited /activities/update /person/update", 
  "refresh_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

The value for "expires_in" is in seconds and it equates to approximately 20 years.

Kind regards,

Pedro Costa
QA & Support Specialist


Reem Kurdi

unread,
Sep 29, 2020, 5:28:28 AM9/29/20
to ORCID API Users
Thank you so much for your reply Mr. Pedro.

Yes, exactly. I do obtain the above, but it equates to 24 hours rather than 20 years. 

If you may please check out this link it even says that the access token expires within 24 hours (step 4): https://members.orcid.org/api/oauth/generate-accesstoken

Am I supposed to follow these steps instead https://members.orcid.org/api/post-oauthtoken-reading-public-data and register my account as an Institutional account? (In order to be able to use grant_type = client_credentials, then in turn receive an access token of 20 years)

Best, 

Reem

Pedro Costa

unread,
Sep 29, 2020, 11:42:16 AM9/29/20
to ORCID API Users
Hi Reem,

Note that the article in https://members.orcid.org/api/oauth/generate-accesstoken mentions "the auth code will expire within 24 hours", not that the access token will expire within 24 hours. 

This tutorial explains in detail all the steps you need to complete in order to read public information from researchers' ORCID records:


The tutorial uses the Sandbox environment. If you want to do this on Production instead, just take out "sandbox" from the URLs. So, for example, instead of "https://api.sandbox.orcid.org/[version]/[ORCID iD]/[endpoint]", you would need to use "https://api.orcid.org/[version]/[ORCID iD]/[endpoint]". You would also need to use a client _id and client_secret for Production as opposed to Sandbox.

I would recommend that you complete the tutorial and let us know if you have any questions. As a quick overview, this is what you need to do:

1 - generate a two step access token with the /read-public scope (e.g. curl -i -d 'client_id=APP-674MCQQR985VZZQ2' -d 'client_secret=d08b711e-9411-788d-a474-46efd3956652' -d 'scope=/read-public' -d 'grant_type=client_credentials' 'https://sandbox.orcid.org/oauth/token')

2 - the API will respond with an access token (e.g. "access_token": "1cecf036-5ced-4d04-8eeb-61fa6e3b32ee")

3 - use the access token in calls to read public information from ORCID record (e.g. curl -H 'Content-Type: application/orcid+xml' -H 'Authorization: Bearer 89f0181c-168b-4d7d-831c-1fdda2d7bbbb' 'https://pub.sandbox.orcid.org/v2.1/0000-0001-2345-6789/personal-details')

The above examples use Curl calls. If you want to use Google OAuth 2.0 Playground instead of Curl calls, please also check this tutorial:

Reply all
Reply to author
Forward
Message has been deleted
0 new messages