Problem using the DataCite REST API - JSON

Hi all,

I’m passing along a question from one of our developers who is trying to implement this API for our repository. He’s getting an error indicating that the title is blank, but it isn’t. If any of you have any experience with this, we’d love some help. We’ve sent an email to DataCite but our work cycle ends tomorrow so we are trying to wrap this up quickly.
Thanks!
Amy

I made a request like this to the JSON API:

{

“data”: {

“attributes”: {

“event”: “publish”,

“descriptions”: [{

“description”: “abs”,

“descriptionType”: “Abstract”

}],

“alternateIdentifiers”: [{

“alternateIdentifier”: “https://sul-purl-stage.stanford.edu/gy295fb4889”,

“alternateIdentifierType”: “PURL”

}],

“dates”: ,

“subjects”: [{

“subjectScheme”: “fast”,

“schemeURI”: “OCLC FAST Linked Data”,

“subject”: “Keyword searching”,

“valueURI”: “http://id.worldcat.org/fast/987037/

}],

“titles”: [{

“title”: “Test DOI #10

}],

“rightsList”: [{

“rights”: “Creative Commons Legal Code

}],

“types”: {

“resourceTypeGeneral”: “Text”,

“resourceType”: “Text”

},

“publicationYear”: “2021”,

“publisher”: “Stanford Digital Repository”,

“creators”: [{

“name”: “Coyne, Justin”,

“givenName”: “Justin”,

“familyName”: “Coyne”,

“nameType”: “Personal”

}]

}

}

}

And I got a response like this:

{“errors”:[{“source”:“url”,“uid”:“10.80343/gy295fb4889”,“title”:“Can’t be blank”}]}

This error doesn’t make sense to me since we’ve provided titles as indicated in the documentation here: Creating DOIs with the REST API

1 Like

Hi @amyhodge ,

I just sent a response to your support ticket, but responding here as well, in case anyone else runs into a similar issue.

In the error message, the field that’s causing the problem is in “source” field and the “title” field is the error message itself. So, in this case, it’s the missing url that’s causing the error.

To convert a DOI from draft state to findable with “event”: “publish”, the url that the DOI should point to needs to be included in the url field, ex:

{
“data”: {
“attributes”: {
“event”: “publish”,
“url”: “https://your-domain.edu/your-doi-landing-page”,
“descriptions”: [{
“description”: “abs”,
“descriptionType”: “Abstract”

I hope this helps!
Cheers,
Liz Krznarich (sorry, accidentally posted as DataCite admin!)

1 Like

Sorry, replied by email and then saw Liz had already said the same thing :slight_smile:

Thanks, Liz and Jez. Super helpful.