Quip Automation API Reference
This document provides sample calls for some common use cases for the Edit
a Document API method. In the examples below, we use the HTML format for
the document content. You can mix and match the examples based on your
business needs. See the Edit a Document
reference documentation for more details including a sample response and
information about the section_id, location, data-live-app-id, and
document_range fields.
Note: If you're a Virtual Private Cloud (VPC) customer, see the Access Rules for more information about URIs to use for your API calls.
Add an Item at the End of a List
In this example, the section_id belongs to an item at the end (location
2) of a bulleted or numbered list or checklist.
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "vTYlBwL8UT85",
"format": "html",
"content": "<li>Expert recommendations</li>",
"section_id": "HcDACAX1iOK",
"location": 2
}
Here's how the list looks before and after the API call:
| Before the call | After the call |
|---|---|
|
|
Add a Paragraph before Other Content
In this example, the section_id belongs to a paragraph before (location
3) which another paragraph is added.
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "XerkArZUfekP",
"format": "html",
"content": "<p>Here's the account information for Acme Company:</p>",
"section_id": "HcDACAwByNQ",
"location": 3
}
Here's how the paragraph looks before and after the API call:
| Before the call | After the call |
|---|---|
|
This customer is on the west coast. |
Here's the account information for Acme Company: This customer is on the west coast. |
Add Multiple Paragraphs after Other Content
In this example, the section_id belongs to a paragraph after (location
2) which multiple paragraphs are added.
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "vTYlBwL8UT85",
"format": "html",
"content": "<p>Customers like Acme want more options.</p><p>They like personalized service.</p>",
"section_id": "HcDACAJZEQf",
"location": 2
}
Here's how the content looks before and after the API call:
| Before the call | After the call |
|---|---|
|
Here's the account information for Acme Company: This customer is on the west coast. |
Here's the account information for Acme Company: This customer is on the west coast. Customers like Acme want more options. They like personalized service. |
Edit a Paragraph/Replace Content
In this example, the section_id belongs to the paragraph that's
edited/replaced (location 4). You can edit/replace a document range
instead, by passing 8 into the location field. See the Edit a
Document reference documentation for more
information about the document_range field.
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "vTYlBwL8UT85",
"format": "html",
"content": "<p>Customers like Acme want more choices. They want a buffet experience.</p>",
"section_id": "HcDABAJZEQf",
"location": 4
}
Here's how the paragraph looks before and after the API call:
| Before the call | After the call |
|---|---|
|
Customers like Acme want more options. |
Customers like Acme want more choices. They want a buffet experience. |
Delete a Document Range
In this example, the document_range belongs to the content (heading title
Topic 2 - Prerequisites and content under that heading and its
subheadings) that's deleted (location 9).
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "vTYlBwL8UT85",
"location": 9,
"document_range": "Topic 2 - Prerequisites"
}
Here's how the content looks before and after the API call:
| Before the call | After the call |
|---|---|
Topic 1 - IntroductionContent under Topic 1. Topic 2 - PrerequisitesContent under Topic 2. Subtopic 2.1Content under Subtopic 2.1. Subtopic 2.1.1Content under Subtopic 2.1.1. Topic 3 - Acceptance CriteriaContent under Topic 3. |
Topic 1 - IntroductionContent under Topic 1. Topic 3 - Acceptance CriteriaContent under Topic 3. |
Add, Edit, or Replace Content in or Around a Document Range
In this example, the document_range belongs to the content (heading title
Topic 4 - Important Notes and content under that heading and its
subheadings) that's edited/replaced (location 8). You can add content
before or after a document range by passing 7 (before) or 6 (after) into
the location field. See the Edit a
Document reference documentation for
more information about the document_range field.
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "vTYlBwL8UT85",
"content": "<h2>Topic 4 - Considerations</h2><p>Our beta launch requires training users who speak multiple languages.</p>",
"location": 8,
"document_range": "Topic 4 - Important Notes"
}
Here's how the content looks before and after the API call:
| Before the call | After the call |
|---|---|
Topic 4 - Important NotesOur beta launch requires user training. |
Topic 4 - ConsiderationsOur beta launch requires training users who speak multiple languages. |
Add a Row to a Spreadsheet
In this example, the section_id belongs to the row after (location 2)
which another row is added.
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "vTYlBwL8UT85",
"format": "html",
"content": "<tr><td>7</td><td>4,581</td><td>570</td></tr>",
"section_id": "temp:C:dabc38cb2d6f789b426a14f31946",
"location": 2
}
Here's how the spreadsheet looks before and after the API call:
| Before the call | After the call | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|||||||||||||||||||||||||||
Edit a Cell in a Spreadsheet
In this example, the section_id belongs to the cell that's edited/replaced
(location 4).
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "vTYlBwL8UT85",
"format": "html",
"content": "98",
"section_id": "temp:s:HcDACAFj25V_temp:C:HcD5aa735cfd0dd58e3eee0e5ef0",
"location": 4
}
The table below shows how the spreadsheet looks before and after the API call. In this example, the first cell in the spreadsheet is edited:
| Before the call | After the call | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
||||||||||||||||||||||||||||||
Add a Live App after Other Content
The data-live-app-id mentioned in the content field applies to the type of
live app that's added. In this example, the live app is a calendar and the
section_id belongs to a paragraph after (location 2) which the calendar is
added. This scenario adds a calendar containing two events scheduled for 4
October 2021 and 18 October 2021.
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "vTYlBwL8UT85",
"format": "html",
"content": "<div data-live-app-id='AbNBjAC13no' \
data-live-app-payload='{\
\"events\":[\
{\
\"color\":\"GREEN\",\
\"dateRange\":{\"start\":\"2021-10-04\",\"end\":\"2021-10-04\"},\
\"content\":\"Kickoff Meeting\"\
},\
{\
\"color\":\"RED\",\
\"dateRange\":{\"start\":\"2021-10-18\",\"end\":\"2021-10-18\"},\
\"content\":\"Project Status\"\
}],\
\"displayMonth\":\"2021-10\"\
}'>\
</div>",
"section_id": "HcDACAxeuYo",
"location": 2
}
Here's how the content looks before and after the API call:
| Before the call | After the call |
|---|---|
|
Let's start a customer satisfaction project. |
|
Edit Content in a Live App
In this example, the section_id belongs to the cell in the live app that's
edited/replaced (location 4). This scenario replaces the name of the
calendar event "Kickoff Meeting" with "Project Kickoff".
POST https://platform.quip.com/1/threads/edit-document
Content-Type: application/json
Authorization: Bearer ABCSampleAccessToken
{
"thread_id": "vTYlBwL8UT85",
"format": "html",
"content": "Project Kickoff",
"section_id": "temp:C:HcDe5a29801dd43ce5b7d68c43f3",
"location": 4
}
Here's how the content looks before and after the API call:
| Before the call | After the call |
|---|---|
|
|
|
Summary of Additional Use Cases for Adding Live Apps
| Live App Type | Summary of Use Case | Sample HTML for Content Field |
|---|---|---|
| Salesforce Record | Add a Salesforce record |
|
| Salesforce List | Add a Salesforce record list |
|
| Salesforce List | Add a Salesforce related list |
|
| Kanban Board | Add a Kanban board with three columns:
|
|
| Project Tracker | Add a project tracker with five columns::
|
|
See also
Edit a Document reference documentation