188BET靠谱吗Changes in Zotero Web API v3

Version 3 of the188BET靠谱吗Zotero Web APIintroduces a new all-JSON response format and various other changes.While API v3 is mostly backwards compatible, existing clients may need to makea few small adjustmentsfor full compatibility, depending on usage.

  • New default all-JSON response format, format=json
    • Contains a single JSON object for single-object requests and an array of objects for multi-object requests
    • All individual objects contain top-level keyand versionproperties and top-level library, links, and metaobjects.
    • metacontains non-editable system-generated properties like createdByUser/ lastModifiedByUser(for group items), creatorSummary, and numChildren.
    • Other Atom-specific feed properties ( title, author, published, updated) have been removed.
    • Clients sending application/atom+xmlin the Acceptheader will continue to receive Atom responses if no other format is requested
  • For format=json, include=datahas replaced Atom's content=jsonand is now the default mode, with a top-level dataobject containing the editable fields.As with content, additional comma-separated types can be requested (e.g., include=data,bib).The requested types are provided as top-level properties. content=htmlremains the default in Atom.
  • Multi-object writes now take an array of JSON objects directly, rather than an object with an items/ collections/ searchesproperty containing an array.
  • For write requests, the API now accepts either the editable JSON ( data) or the full parent JSON object, with the server extracting the dataobject automatically.The latter allows for some editing tasks to be performed without any programming.
  • The parsedDateproperty in the format=json meta188BET靠谱吗object gives the full parsed date in YYYY-MM-DD form, so that clients don't need to replicate Zotero's date-parsing logic to get exact dates.In v3 Atom, zapi:parsedDatereplaces zapi:year.
  • zapi:numTagsis removed in v3 Atom, since it's unnecessary with the tagsarray in the editable json.
  • The API now returns 25 results per request instead of 50 if limitisn't provided.
  • The total result count for multi-object responses is available in a new custom HTTP header, Total-Results. zapi:totalResultsis removed in v3 Atom.
  • rel=first/ prev/ next/ last/ alternatelinks for multi-object responses are now provided in the LinkHTTP header.
  • The API key can be provided in the Authorizationrequest header instead of the keyquery parameter.Since API keys have never been included in the URLs provided in responses, previously all provided URLs had to be modified for key-based access.
  • The API version can be provided as a query parameter ( v=3) instead of the 188BET靠谱吗Zotero-API-Versionheader for easier debugging and sharing of requests, though both will remain supported.
  • For formats other than Atom, dateModifieddescending is the default sort instead of dateAddeddescending.
  • itemKey/ itemVersion(and similar properties on collections and searches) in the editable JSON are now just keyand versionfor easier handling by clients.Clients that simply pass back the edited JSON without touching those properties shouldn't be affected.Clients that store the JSON will need to modify it before sending in v3.
  • The versionmetadata field in the computerProgramitem type is now versionNumberto avoid a conflict with the renamed object version property.
  • dateAdded/dateModified are included in the 'data' object in ISO 8601 form.Previously these timestamps were provided only in the Atom published/ updatedelements, though in v2 they can be sent back in the JSON as dateAdded/ dateModifiedin YYYY-MM-DD hh-mm-dd format, interpreted as UTC.In v3 write requests, either is accepted, though the previous form is deprecated.
  • The accessDatefield, which was also previously YYYY-MM-DD[ hh-mm-dd], is ISO 8601 in v3 (including in Atom) for both reading and writing.The previous form is accepted but deprecated.
  • The pagination links ( rel=self/ first/ prev/ next/ last) on multi-object responses can be used without modification by clients using the Authorizationheader.The rel=selflinks in individual objects are meant as base URIs and do not include any query parameters (e.g., include=data,bib).This is a change from the previous behavior, where the Atom entry rel="self"links include all non-default provided parameters.But with the Authorizationheader and include=dataas the new default, the base URI may be sufficient for most individual-object requests.
  • The newerparameter is now sincefor clarity. neweris deprecated.
  • The orderparameter is now sortand sortis now direction. order= and sort= are deprecated.
  • Requests for updated group metadata can now use format=versionsinstead of format=etags. format=etagsis deprecated.
  • pprint=1has been removed, and all responses are now pretty-printed.
  • '<', '>', and '&' are no longer unnecessarily escaped to \u….in returned JSON data.In Atom, these characters are instead turned into XML numeric character references.Proper XML and JSON parsers shouldn't be affected by these changes.
  • The HTTP Warning header may be used to send clients non-fatal warnings — such as deprecation warnings — that can be logged.

tl;dr for existing Atom consumers

  • Request format=atomexplicitly, or send application/atom+xmlin the Acceptheader
  • Use zapi:parsedDateinstead of zapi:year
  • Use Total-ResultsHTTP header instead of zapi:totalResults
  • Count the tagsarray in editable JSON instead of using zapi:numTags
  • Use key/ versioninstead of itemKey/ itemVersion(and collection*/ search*) in editable JSON
  • Use versionNumberinstead of versionmetadata field in computerProgramitem type
  • Use ISO 8601 dates for accessDate, dateAdded, and dateModified
  • Use sinceparameter instead of newer
  • Use sortparameter instead of orderand directioninstead of sort
  • For writes, upload an array of JSON objects directly instead of an object containing an items/ collections/ searchesarray
  • Optionally, use Authorization: Bearer instead of keyparameter
  • Optionally, use vparameter instead of 188BET靠谱吗Zotero-API-Versionfor debugging
dev/web_api/v3/changes_from_v2.txt· Last modified: 2022/06/23 15:54 by dstillman
Baidu
map