Update Asset by API - Link the Asset to a Grant
- Product: Esploro
Description
I want to link my existing Asset to an existing Grant. Is there a way to do this by API?
Resolution
There is a Post Asset API that can be used to add or replace individual fields in an asset record. One of the fields that can be added or updated is the link to grant (fundingreference).
This field can occur multiple times. Use the add action to add or append a link and use the replace action to swap links already in the record with new links from the input.
POST /esploro/v1/assets/{assetId}?op=patch&action=add
URL parameters
assetId
op The operation to be performed on the asset. Currently op=patch is supported, it is also the default value.
action Allowed values are: add, replace.
add is for simple fields will only update the value if empty, for list fields will append value to list
replace for simple fields will replace value, for list fields will swap all
Body parameters
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns3:records total_record_count="1" xmlns:ns2="http://esploro_record" xmlns:ns3="http://rest_esploro">
<record>
<fundingreferenceList>
<fundingreference>
<fundername>Universitat de València (Spain, Valencia) - UV</fundername>
<awardnumber>fundrefGrantForDoiTest</awardnumber>
<awardtitle>fundrefGrantForDoiTest</awardtitle>
<grantURL></grantURL>
</fundingreference>
<fundingreference>
<fundername>Technion – Israel Institute of Technology (Israel, Haifa)</fundername>
<awardnumber>existingGrantID31101044960</awardnumber>
<awardtitle>existingGrantName31101044960</awardtitle>
<grantURL></grantURL>
</fundingreference>
<fundingreference>
<fundername>Centre Hospitalier Régional Universitaire de Brest (France, Brest)</fundername>
<awardnumber>newGrant10112024</awardnumber>
<awardtitle>newGrant10112024</awardtitle>
<grantURL>testGrantURL.com</grantURL>
</fundingreference>
</fundingreferenceList>
</record>
</ns3:records>
JSON
"records": [
{
"fundingreferenceList": [
{
"fundername": "National Institutes of Health (United States, Bethesda) - NIH",
"awardnumber": "3U01DK057182-21S1"
}
]
}
]
}
{
"record": {
"fundingreferenceList": [
{
"fundername": "Universitat de València (Spain, Valencia) - UV",
"awardnumber": "fundrefGrantForDoiTest",
"awardtitle": "fundrefGrantForDoiTest",
"grantURL": ""
},
{
"fundername": "Technion – Israel Institute of Technology (Israel, Haifa)",
"awardnumber": "existingGrantID31101044960",
"awardtitle": "existingGrantName31101044960",
"grantURL": ""
},
{
"fundername": "Centre Hospitalier Régional Universitaire de Brest (France, Brest)",
"awardnumber": "newGrant10112024",
"awardtitle": "newGrant10112024",
"grantURL": "testGrantURL.com"
}
}
Additional Information
- Article last edited: 26-July-2021

