Update Asset by API
- Product: Esploro
Description
We need to update specific fields in an Asset record, is there an API for this?
Resolution
There is a Post Asset API that can be used to add or replace individual fields in an asset record.
The following fields are supported: Date, Identifiers, Local fields, Grant note, Related grants, Links, Files
POST /esploro/v1/assets/{assetId:.+}
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
This is a sample xml with all potential fields included.
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>
<identifier.doi>10.20/30456</identifier.doi>
<identifier.pmid>123456</identifier.pmid>
<identifier.pmcid>123456789</identifier.pmcid>
<identifier.uri></identifier.uri>
<identifier.handle>someHandleType</identifier.handle>
<identifier.ismn>111222</identifier.ismn>
<identifier.isbn>12345678</identifier.isbn>
<identifier.eissn>11115555</identifier.eissn>
<identifier.issn>12345678</identifier.issn>
<identifier.other>oth</identifier.other>
<identifier.govtnum>gov</identifier.govtnum>
<identifier.wos>12345678922</identifier.wos>
<identifier.scopus>scop</identifier.scopus>
<identifier.arxiv>arx</identifier.arxiv>
<identifier.ark>ark</identifier.ark>
<identifier.sici>sic</identifier.sici>
<identifier.rno>rno</identifier.rno>
<identifier.additional01>add1</identifier.additional01>
<identifier.additional02>add2</identifier.additional02>
<identifier.additional03>add3</identifier.additional03>
<identifier.additional04>add4</identifier.additional04>
<identifier.additional05>add5</identifier.additional05>
<identifier.additional06>add6</identifier.additional06>
<identifier.additional07>add7</identifier.additional07>
<identifier.additional08>add8</identifier.additional08>
<identifier.additional09>add9</identifier.additional09>
<identifier.pqdt>pq</identifier.pqdt>
<identifier.eisbn>123345</identifier.eisbn>
<date.published>20241110</date.published>
<date.accepted>20200125</date.accepted>
<date.created>20220612–20220825</date.created>
<date.submitted>20190302</date.submitted>
<links>
<link>
<link.url>www.google.com</link.url>
<link.type>pdf</link.type>
<link.description>linkDesc</link.description>
<link.title>linkTitle</link.title>
<link.rights>open</link.rights>
<link.supplemental>true</link.supplemental>
<link.license>CCBY_V4.0</link.license>
<link.ownership>owner.institutional</link.ownership>
<link.display_in_viewer>true</link.display_in_viewer>
</link>
</links>
<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
This example includes all possible fields in a single input file.
{
"record": {
"identifier": {
"doi": "10.20/30456",
"pmid": "123456",
"pmcid": "123456789",
"uri": "",
"handle": "someHandleType",
"ismn": "111222",
"isbn": "12345678",
"eissn": "11115555",
"issn": "12345678",
"other": "oth",
"govtnum": "gov",
"wos": "12345678922",
"scopus": "scop",
"arxiv": "arx",
"ark": "ark",
"sici": "sic",
"rno": "rno",
"additional01": "add1",
"additional02": "add2",
"additional03": "add3",
"additional04": "add4",
"additional05": "add5",
"additional06": "add6",
"additional07": "add7",
"additional08": "add8",
"additional09": "add9",
"pqdt": "pq",
"eisbn": "123345"
},
"date": {
"published": "20241110",
"accepted": "20200125",
"created": "20220612–20220825",
"submitted": "20190302"
},
"links": [
{
"url": "www.google.com",
"type": "pdf",
"description": "linkDesc",
"title": "linkTitle",
"rights": "open",
"supplemental": true,
"license": "CCBY_V4.0",
"ownership": "owner.institutional",
"display_in_viewer": true
}
],
"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"
}
}
"temporary": {
"linksToExtract": [
{
"link.title": "sample mp4",
"link.url": "https://www.sample-videos.com/video3...y_720p_1mb.mp4",
"link.description": "some file description",
"link.type": "accepted",
"link.rights": "13447111320002771",
"link.rightsreason": "no reason",
"link.embargoend": "02/20/2020",
"link.license": "CC0_V1.0",
"link.supplemental": "true"
}
]
}
}
]
}
Additional Information
- Article last edited: 26-July-2021