Entry type exported in CSL format from API differs from the same export with the application

Hi,

I am facing a blocking issue that affects our integration of Zotero into our publication workflow. The tip of the iceberg was that our custom style (''united-nations-conference-on-trade-and-development'') wasn't applied properly for some entries when using https://api.zotero.org, and was working properly with the Zotero application. Digging further, I found out that the entries that were wrong are the blog post ones. Checking the export of such entries in CSL format had finally revealed the bottom line of this issue.

When I export in CSL-JSON format from the Zotero application, I get the following output for a blog post:
[
{
"id": "http://zotero.org/groups/2308099/items/QKMU3DP6",
"type": "post-weblog",
"container-title": "Research-based policy analysis and commentary from leading economists",
"language": "English",
"title": "The Greater Trade Collapse of 2020: Learnings from the 2008-09 Great Trade Collapse",
"URL": "https://voxeu.org/article/greater-trade-collapse-2020",
"author": [
{
"family": "Baldwin",
"given": "Richard"
}
],
"accessed": {
"date-parts": [
[
"2020",
6,
10
]
]
},
"issued": {
"date-parts": [
[
"2020"
]
]
}
}
]


When exporting the same entry from https://api.zotero.org/groups/2308099/items?key=[apikey]&style=united-nations-conference-on-trade-and-development&format=csljson&itemKey=QKMU3DP6, here is what I get:

{
"items": [
{
"id": "6791898/QKMU3DP6",
"type": "webpage",
"title": "The Greater Trade Collapse of 2020: Learnings from the 2008-09 Great Trade Collapse",
"container-title": "Research-based policy analysis and commentary from leading economists",
"URL": "https://voxeu.org/article/greater-trade-collapse-2020",
"language": "English",
"author": [
{
"family": "Baldwin",
"given": "Richard"
}
],
"issued": {
"date-parts": [
[
2020
]
]
},
"accessed": {
"date-parts": [
[
2020,
6,
10
]
]
}
}
]
}


As you can quickly noticed, the ''post-weblog'' is now a ''webpage''. Since our style definition is made to treat ''webpage'' in a different way than ''post-weblog'', we are getting a wrong formatting from the API. Here is an excerpt of what I get from a https://api.zotero.org/groups/2308099/items?key=[apikey]&style=united-nations-conference-on-trade-and-development&format=json&itemKey=QKMU3DP6&include=bib,data:

"bib": "<div class=\"csl-bib-body\" style=\"line-height: 1.35; padding-left: 1em; text-indent:-1em;\">\n <div class=\"csl-entry\">The Greater Trade Collapse of 2020: Learnings from the 2008-09 Great Trade Collapse (2020). Research-based policy analysis and commentary from leading economists. Available at https://voxeu.org/article/greater-trade-collapse-2020 (accessed 10 June 2020).</div>\n</div>",
"data": {
"key": "QKMU3DP6",
"version": 4116,
"itemType": "blogPost",
"title": "The Greater Trade Collapse of 2020: Learnings from the 2008-09 Great Trade Collapse",
"creators": [
{
"creatorType": "author",
"firstName": "Richard",
"lastName": "Baldwin"
}
],
"abstractNote": "",
"blogTitle": "Research-based policy analysis and commentary from leading economists",
"websiteType": "",
"date": "2020",
"url": "https://voxeu.org/article/greater-trade-collapse-2020",
"accessDate": "2020-06-10",
"language": "English",
"shortTitle": "",
"rights": "",
"extra": "",
"tags": [
{
"tag": "T.1.a"
}
],
"collections": [],
"relations": {},
"dateAdded": "2020-06-10T15:26:07Z",
"dateModified": "2020-10-20T13:32:31Z"
}


This confirms that the entry is really a blog post, but the formatting of the bibliography had followed the ''webpage'' case of the CSL style. The expected bibliography, as produced by the application, is:


Baldwin R (2020). Research-based policy analysis and commentary from leading economists. Available at https://voxeu.org/article/greater-trade-collapse-2020 (accessed 10 June 2020).


So, I would be very pleased if the API could be fixed in this regards, and I would provide any help to the extent of my knowledge to achieve such an improvement.
Thanks for your attention.
Sign In or Register to comment.