Improved handling of "not found" errors in the ROR API

2 views
Skip to first unread message

Liz Krznarich

unread,
Jul 28, 2022, 6:47:58 PM7/28/22
to ROR Tech Support

Greetings ROR users and enthusiasts!

We’ve just released some improvements to status codes and messages for “not found” errors when retrieving a specific ROR record by ID from the API. Previous codes and messages were inconsistent - some cases returned a 200 status with a JSON message, while others returned a 404 status with an HTML message (even if an Accept: application/json header was sent). With the changes deployed today, all “not found” cases return a 404 status code and a JSON message. Additionally, the message is now customized for 3 cases:

Requested resource is in valid ROR ID format, but does not exist (ie, this ROR ID has not been assigned to any organization yet).

curl https://api.ror.org/organizations/05vtwzg80

Requested resource is not a valid ROR ID

curl https://api.ror.org/organizations/foo

  • Previous response: 404 status code, HTML message <h1>Not Found</h1><p>The requested resource was not found on this server.</p>
  • New response: 404 status code, JSON message {"errors":["'foo' is not a valid ROR ID"]}
Requested resource is a valid ROR ID that was removed by GRID during the time period that ROR was synced with GRID

During the time that ROR was synced with GRID (Jan 2019-Mar 2022), some GRID records with ROR IDs assigned were removed by GRID and therefore no longer resolve in ROR. This is obviously not ideal for a persistent identifier system. These records have been identified, but cannot be immediately added back to ROR. Many contain incomplete/errant data, are represented in prior versions of the GRID schema, and do not validate against ROR’s schema. Additionally, many require inactive status information in order to be included in ROR, as the organizations no longer exist/never existed, or are duplicates of existing records in the registry. These will be addressed in the next several months as part of the inactive organizations project, which we gathered community feedback on in June/July.

curl https://api.ror.org/organizations/05vtwzg82

  • Previous response: 200 status code, JSON message {"errors":["ROR ID 'https://ror.org/05vtwzg82' does not exist"]}
  • New response: 404 status code, JSON message {"errors":["ROR ID 'https://ror.org/05vtwzg82' was removed by GRID during the time period (Jan 2019-Mar 2022) that ROR was synced with GRID. We are currently working with the ROR Curation Advisory Board to restore these records and expect to complete this work in 2022"]}

For the most part, these changes are also reflected in the ROR record UI  (ex, https://ror.org/05vtwzg80 or https://ror.org/05vtwzg82), which previously returned a blank page for most not found errors. An exception is that some patterns which return “...is not a valid ROR ID” in the API result in a generic 404 page not found message in the UI (ex, https://ror.org/foo). This is a consequence of the ROR search app and the ROR info site sharing the same domain.

We hope you find this improved error handling helpful! As always, please feel free to post questions here, check out our docs at https://ror.readme.io or contact us at in...@ror.org.

Cheers,

Liz

___

Liz Krznarich, DataCite | ROR Technical Lead
l...@ror.org | ror.org | @ResearchOrgs | ROR docs

Arthur Smith

unread,
Jul 29, 2022, 9:02:04 AM7/29/22
to Liz Krznarich, ROR Tech Support
This is excellent news, I'm very glad something is being done about the ROR ID's that disappeared due to GRID changes.

  Arthur
--
You received this message because you are subscribed to the Google Groups "ROR Tech Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ror-api-user...@ror.org.
To view this discussion on the web visit https://groups.google.com/a/ror.org/d/msgid/ror-api-users/69e37d68-52fe-4d35-b9c0-7f170595513fn%40ror.org.


Amanda French

unread,
Aug 2, 2022, 3:04:43 PM8/2/22
to Arthur Smith, Liz Krznarich, ROR Tech Support
Yes, indeed! And frankly I think all the new error messages are a big improvement, not just the ones explaining the temporarily “disappeared” records. Kudos to Liz. 

Amanda French
Technical Community Manager, ROR

On Jul 29, 2022, at 9:02 AM, Arthur Smith <aps...@aps.org> wrote:


Reply all
Reply to author
Forward
0 new messages