Test for ORCID id existance?

119 views
Skip to first unread message

Andrew Gilmartin

unread,
Jul 12, 2017, 8:48:04 AM7/12/17
to ORCID API Users
We often receive bibliographic metadata with ORCID ids that are syntactically invalid or simply don't exist. Checking the syntax of an ORCID id is simple and can be done locally. Checking on the existence of an ORCID id needs to be done via ORCID.org. My experience with the API, admittedly limited, is that a non-existent ORCID does not generate the same error and so I am looking for a very simple means of checking the existence of an ORCID id.  Is there an API or REST call that I can make where I only give the ORCID id and can expect a 200/202 HTTP status when the ORCID id exists and a 404 HTTP status when it does not?

-- Andrew


Peters, Robert

unread,
Jul 12, 2017, 10:28:23 AM7/12/17
to Andrew Gilmartin, ORCID API Users
Hi Andrew,
Just to cover multiple clients types. I've covered the identifier itself, Public API and Member API.

200 with valid identifier:
curl -vs -H'Accept: application/json' http://orcid.org/0000-0002-0036-9460 > /dev/null
*   Trying 66.216.68.112...
* TCP_NODELAY set
* Connected to orcid.org (66.216.68.112) port 80 (#0)
> GET /0000-0002-0036-9460 HTTP/1.1
> Host: orcid.org
> User-Agent: curl/7.51.0
> Accept: application/json
< HTTP/1.1 200 OK
< Server: nginx/1.4.6 (Ubuntu)
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Content-Type: application/json;charset=UTF-8
< Date: Wed, 12 Jul 2017 13:26:56 GMT
< Expires: 0
< Pragma: no-cache
< X-XSS-Protection: 1; mode=block
< Transfer-Encoding: chunked
< Access-Control-Allow-Origin: *
< X-Content-Type-Options: nosniff
< Connection: keep-alive
< Set-Cookie: X-Mapping-fjhppofk=CD88EE96E62E8319DEAF9876AD33C1B5; path=/
< X-Frame-Options: DENY
{ [977 bytes data]
* Curl_http_done: called premature == 0
* Connection #0 to host orcid.org left intact


404 with invalid identifier:
 curl -vs -H'Accept: application/json' http://orcid.org/0000-0002-0036-0000 > /dev/null
*   Trying 66.216.68.112...
* TCP_NODELAY set
* Connected to orcid.org (66.216.68.112) port 80 (#0)
> GET /0000-0002-0036-0000 HTTP/1.1
> Host: orcid.org
> User-Agent: curl/7.51.0
> Accept: application/json
< HTTP/1.1 404 Not Found
< Server: nginx/1.4.6 (Ubuntu)
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Content-Type: application/json;charset=UTF-8
< Date: Wed, 12 Jul 2017 13:26:44 GMT
< Expires: 0
< Pragma: no-cache
< X-XSS-Protection: 1; mode=block
< Transfer-Encoding: chunked
< Access-Control-Allow-Origin: *
< X-Content-Type-Options: nosniff
< Connection: keep-alive
< Set-Cookie: X-Mapping-fjhppofk=CD88EE96E62E8319DEAF9876AD33C1B5; path=/
< X-Frame-Options: DENY
{ [148 bytes data]
* Curl_http_done: called premature == 0
* Connection #0 to host orcid.org left intact

200 with valid identifier using 2.0 Public API:
 curl -vs -H'Accept: application/json' https://pub.orcid.org/v2.0/0000-0002-0036-9460  > /dev/null
*   Trying 174.143.185.159...
* TCP_NODELAY set
* Connected to pub.orcid.org (174.143.185.159) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: *.orcid.org
* Server certificate: Go Daddy Secure Certificate Authority - G2
* Server certificate: Go Daddy Root Certificate Authority - G2
> GET /v2.0/0000-0002-0036-9460 HTTP/1.1
> User-Agent: curl/7.51.0
> Accept: application/json
< HTTP/1.1 200 OK
< Server: nginx/1.4.6 (Ubuntu)
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Content-Type: application/json;charset=UTF-8
< Date: Wed, 12 Jul 2017 13:34:49 GMT
< Expires: 0
< Pragma: no-cache
< X-XSS-Protection: 1; mode=block
< Transfer-Encoding: chunked
< Access-Control-Allow-Origin: *
< X-Content-Type-Options: nosniff
< Connection: keep-alive
< Set-Cookie: X-Mapping-fjhppofk=BB32ADE26669E4E542AAA075A6CC205A; path=/
< X-Frame-Options: DENY
{ [15888 bytes data]
* Curl_http_done: called premature == 0
* Connection #0 to host pub.orcid.org left intact

404 with invalid identifier using 2.0 Public API:
curl -vs -H'Accept: application/json' https://pub.orcid.org/v2.0/0000-0002-0036-0000  > /dev/null
*   Trying 174.143.185.159...
* TCP_NODELAY set
* Connected to pub.orcid.org (174.143.185.159) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: *.orcid.org
* Server certificate: Go Daddy Secure Certificate Authority - G2
* Server certificate: Go Daddy Root Certificate Authority - G2
> GET /v2.0/0000-0002-0036-0000 HTTP/1.1
> User-Agent: curl/7.51.0
> Accept: application/json
< HTTP/1.1 404 Not Found
< Server: nginx/1.4.6 (Ubuntu)
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Content-Type: application/json;charset=UTF-8
< Date: Wed, 12 Jul 2017 13:36:47 GMT
< Expires: 0
< Pragma: no-cache
< X-XSS-Protection: 1; mode=block
< Access-Control-Allow-Origin: *
< X-Content-Type-Options: nosniff
< Connection: keep-alive
< Set-Cookie: X-Mapping-fjhppofk=BB32ADE26669E4E542AAA075A6CC205A; path=/
< X-Frame-Options: DENY
< Content-Length: 219
{ [219 bytes data]
* Curl_http_done: called premature == 0
* Connection #0 to host pub.orcid.org left intact

200 with valid identifier using 2.0 Member API:
curl -vs -H'Accept: application/json' -H'Authorization: XXXXXXXXXXXXXX' https://api.orcid.org/v2.0/0000-0002-0036-9460  > /dev/null
*   Trying 174.143.185.162...
* TCP_NODELAY set
* Connected to api.orcid.org (174.143.185.162) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: *.orcid.org
* Server certificate: Go Daddy Secure Certificate Authority - G2
* Server certificate: Go Daddy Root Certificate Authority - G2
> GET /v2.0/0000-0002-0036-9460 HTTP/1.1
> User-Agent: curl/7.51.0
> Accept: application/json
> Authorization: Bearer XXXXXXXXXXXXXXX
< HTTP/1.1 200 OK
< Server: nginx/1.4.6 (Ubuntu)
< Date: Wed, 12 Jul 2017 14:20:08 GMT
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
{ [15986 bytes data]
* Curl_http_done: called premature == 0
* Connection #0 to host api.orcid.org left intact

404 with invalid identifier using 2.0 Member API:
curl -vs -H'Accept: application/json' -H'Authorization: Bearer XXXXXXXXXXX' https://api.orcid.org/v2.0/0000-0002-0036-000  > /dev/null
*   Trying 174.143.185.162...
* TCP_NODELAY set
* Connected to api.orcid.org (174.143.185.162) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: *.orcid.org
* Server certificate: Go Daddy Secure Certificate Authority - G2
* Server certificate: Go Daddy Root Certificate Authority - G2
> GET /v2.0/0000-0002-0036-000 HTTP/1.1
> User-Agent: curl/7.51.0
> Accept: application/json
> Authorization: Bearer XXXXXXXXXXXXX
< HTTP/1.1 404 Not Found
< Server: nginx/1.4.6 (Ubuntu)
< Date: Wed, 12 Jul 2017 14:20:40 GMT
< Content-Type: application/json;charset=UTF-8
< Content-Length: 219
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
{ [219 bytes data]
* Curl_http_done: called premature == 0
* Connection #0 to host api.orcid.org left intact

We should chat about the sources sending invalid IDs, that is a bit worrisome and not cool for any of us :-)

Cheers,
Rob


Robert Peters
Technology Director at ORCID.org

Cellphone: +1.805.440.9056
Skype: rcpeters
Timezone: PST
Key for OpenPGP email communication:  
https://keys.mailvelope.com/pks/lookup?op=get&search=0x1519F37D99E18378

On Wed, Jul 12, 2017 at 5:48 AM, Andrew Gilmartin <agilm...@crossref.org> wrote:
We often receive bibliographic metadata with ORCID ids that are syntactically invalid or simply don't exist. Checking the syntax of an ORCID id is simple and can be done locally. Checking on the existence of an ORCID id needs to be done via ORCID.org. My experience with the API, admittedly limited, is that a non-existent ORCID does not generate the same error and so I am looking for a very simple means of checking the existence of an ORCID id.  Is there an API or REST call that I can make where I only give the ORCID id and can expect a 200/202 HTTP status when the ORCID id exists and a 404 HTTP status when it does not?

-- Andrew


--
You received this message because you are subscribed to the Google Groups "ORCID API Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orcid-api-users+unsubscribe@googlegroups.com.
To post to this group, send email to orcid-api-users@googlegroups.com.
Visit this group at https://groups.google.com/group/orcid-api-users.
For more options, visit https://groups.google.com/d/optout.

Andrew Gilmartin

unread,
Jul 12, 2017, 2:09:39 PM7/12/17
to ORCID API Users, agilm...@crossref.org
That is an awesome response! My mistake when looking for a simple mechanism was forgetting to include the 'Accept: application/json' header. Doh! 

I am happy to talk about invalid metadata whenever you want.

-- Andrew

Peters, Robert

unread,
Jul 12, 2017, 4:06:06 PM7/12/17
to Andrew Gilmartin, ORCID API Users
Glade I could help. But it should return 404 regardless of headers :-/ Thanks for pointing out an issue with our HTML view. Expect the fix to be live the next week or so https://github.com/ORCID/ORCID-Source/pull/3867/files.

Cheers,
Rob

Robert Peters
Technology Director at ORCID.org

Cellphone: +1.805.440.9056
Skype: rcpeters
Timezone: PST
Key for OpenPGP email communication:  
https://keys.mailvelope.com/pks/lookup?op=get&search=0x1519F37D99E18378

--
Reply all
Reply to author
Forward
0 new messages