Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dev:client_coding:http_integration_protocol [2019/02/08 06:13] – created adomasven | dev:client_coding:http_integration_protocol [2022/07/20 09:39] (current) – Update for Zotero 6.0 adomasven | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== HTTP Citing Protocol ====== | ====== HTTP Citing Protocol ====== | ||
- | The Google Docs plugin uses a simple HTTP protocol to communicate with Zotero. The below documentation applies to Zotero | + | The Google Docs plugin uses a simple HTTP protocol to communicate with Zotero. The below documentation applies to Zotero |
===== Basics ===== | ===== Basics ===== | ||
Line 53: | Line 53: | ||
^ Command ^ Description ^ | ^ Command ^ Description ^ | ||
- | | "addCitation" | Add a new citation | | + | | "addEditCitation" | Add a new or edit an existing citation | |
- | | " | + | | "addEditBibliography" | Add a new or edit an existing bibliography | |
- | | "addEditCitation" | Add a new citation | + | | "addNote" | Insert |
- | | " | + | |
- | | " | + | |
- | | "addEditBibliography" | Add a new bibliography or edit the already inserted one | | + | |
| " | | " | ||
| " | | " | ||
- | | " | + | | " |
+ | | " | ||
+ | |||
+ | An up-to-date command list is always available by looking at the methods of [[https:// | ||
+ | |||
+ | If Zotero responds with a 503 HTTP response, it means that another integration transaction is already in progress. If your integration client initiates an integration transaction and fails to complete it by either returning an error or responding to requests until ''# | ||
===== Word Processor Commands ==== | ===== Word Processor Commands ==== | ||
Line 87: | Line 89: | ||
Zotero will cancel the current operation, log this error, and present it to the user using the [[# | Zotero will cancel the current operation, log this error, and present it to the user using the [[# | ||
+ | |||
+ | A full and up-to-date API of commands is available as part of [[https:// | ||
==== Application.getActiveDocument ==== | ==== Application.getActiveDocument ==== | ||
Line 216: | Line 220: | ||
| 1 | fieldCode | %%Integer|String%% | The code stored within this field. Since no data has been set, this should be empty. | | | 1 | fieldCode | %%Integer|String%% | The code stored within this field. Since no data has been set, this should be empty. | | ||
| 2 | noteIndex | %%Integer%% | The number of the footnote in which this field resides, or 0 if the field is not in a footnote. | | | 2 | noteIndex | %%Integer%% | The number of the footnote in which this field resides, or 0 if the field is not in a footnote. | | ||
+ | |||
+ | ==== Document.insertText ==== | ||
+ | |||
+ | Inserts rich text (HTML) at cursor position. The rich text may contain citation placeholder hyperlinks (to https:// | ||
+ | |||
+ | === Parameters === | ||
+ | |||
+ | | text | %%String%% | The text | | ||
+ | |||
+ | |||
+ | === Returns === | ||
+ | |||
+ | null | ||
==== Document.getFields ==== | ==== Document.getFields ==== | ||
Line 245: | Line 262: | ||
NOTE_FOOTNOTE = 1 | NOTE_FOOTNOTE = 1 | ||
NOTE_ENDNOTE = 2 | NOTE_ENDNOTE = 2 | ||
- | </ | + | </ |
| count | %%Number%% | Size of the above arrays | | | count | %%Number%% | Size of the above arrays | | ||
Line 251: | Line 268: | ||
null | null | ||
+ | |||
+ | ==== Document.convertPlaceholdersToFields ==== | ||
+ | |||
+ | Converts placeholders (which are text with links to https:// | ||
+ | |||
+ | === Parameters === | ||
+ | |||
+ | | 0 | placeholderIDs | %%Array(String)%% | An array of placeholderID strings which are to be converted to citation fields in the document. | | ||
+ | | 1 | noteType | Number | Note type to convert citation placeholders to. Is one of< | ||
+ | NOTE_IN_TEXT = 0 | ||
+ | NOTE_FOOTNOTE = 1 | ||
+ | NOTE_ENDNOTE = 2 | ||
+ | </ | ||
+ | | 2 | fieldType | Number | To be ignored | | ||
+ | |||
+ | === Returns === | ||
+ | |||
+ | Array of fields after conversion | ||
+ | |||
+ | (Array) | ||
+ | |||
+ | | 0 | fieldID | %%Array(Integer|String)%% | Unique identifiers for each field | | ||
+ | | 1 | fieldCode | %%Array(Integer|String)%% | The code stored in each field | | ||
+ | | 2 | noteIndex | %%Array(Integer)%% | The number of the footnote in which each field resides, or 0 if the field is not in a footnote | | ||
==== Document.setBibliographyStyle ==== | ==== Document.setBibliographyStyle ==== |