Time
S
Nick
Message
07:24
Virgile joined #dataverse
07:40
dataverse-user joined #dataverse
09:31
PatrickV joined #dataverse
11:39
donsizemore joined #dataverse
12:42
juancorr joined #dataverse
14:13
pdurbin joined #dataverse
14:15
pdurbin
I sent the Hacktoberfest announcement: https://groups.google.com/g/dataverse-community/c/P8A_32yfpvE/m/r0EMCJGRAQAJ
15:00
pdurbin
time for the community call: https://dataverse.org/community-calls
15:01
pdurbin
there's a password now
15:04
pdurbin
poikilotherm: there's a pic of your shirt in the docs, I think. :)
15:04
pdurbin
the notes
18:00
ashaw joined #dataverse
18:04
ashaw
hi all - my org is running dataverse 4.8.5. I am trying to make a put request to add a new entry for a custom metadata field. I am getting back a 500 error. The request I am making is PUT http://$SERVER/api/datasets/{entity_id}/versions/:draft?key={key}
18:04
ashaw
Does this API endpoint look correct?
18:05
ashaw
The dataverse is still in DRAFT status, FYI
18:06
pdurbin
The custom metadata fields are already in your system? You can see them when you edit metadata on a dataset from the web interface?
18:08
ashaw
Yes, in this case, I have added a new metadata field. I can go through the UI, edit the metadata, choose a value for my new field, and then update the dataset.
18:10
pdurbin
Ok. And now you're trying to add or update that custom field via API . Are you trying to create a dataset or edit an existing one?
18:11
ashaw
Correct - trying to update via API . I am trying to insert this new field with a value into an existing dataset and update.
18:12
pdurbin
Ok. It should work. Editing via API got easier once we added an API to edit one field at a time. Let me check if it's in 4.8.5.
18:14
ashaw
For reference, we've done this before, but in that case we were changing the value of an existing field.
18:14
pdurbin
This is the new way I was thinking of $SERVER_URL/api/datasets/:persistentId/editMetadata... http://guides.dataverse.org/en/5.0/api/native-api.html#edit-dataset-metadata
18:15
pdurbin
... but it isn't in 4.8.5. So you have to use the old way.
18:16
pdurbin
I'd suggest looking at these docs for the old way (full replace). The API hasn't changed but the docs have been improved: http://guides.dataverse.org/en/5.0/api/native-api.html#update-metadata-for-a-dataset
18:17
pdurbin
Basically, you download the dataset as JSON , update that JSON somehow, and then overwrite the dataset with it.
18:19
pdurbin
You mentioned a 500 error. If you email your server.log file to support dataverse.org we can try to make sense of it.
18:26
ashaw
Yes - we are using the old method of download as json, update json, and overwrite. Let me take another look. I'll email logs if problem persists. Thanks for your help.
18:27
pdurbin
Sure! Good luck.
18:27
pdurbin
oh, you might want to try pyDataverse
18:27
pdurbin
I haven't used it for editing datasets but it might be supported.
18:27
ashaw
yes - will check that out! thank again!
18:28
pdurbin
sure