All URIs are relative to https://coda.io/apis/v1
Method | HTTP request | Description |
---|---|---|
getPage | GET /docs/{docId}/pages/{pageIdOrName} | Get a page |
listPages | GET /docs/{docId}/pages | List pages |
updatePage | PUT /docs/{docId}/pages/{pageIdOrName} | Update a page |
Page getPage(docId, pageIdOrName)
Get a page
Returns details about a page.
import CodaJsClient from 'coda-js-client';
let defaultClient = CodaJsClient.ApiClient.instance;
let apiInstance = new CodaJsClient.PagesApi();
let docId = "docId_example"; // String | ID of the doc.
let pageIdOrName = "pageIdOrName_example"; // String | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected.
apiInstance.getPage(docId, pageIdOrName).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
docId | String | ID of the doc. | |
pageIdOrName | String | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected. |
- Content-Type: Not defined
- Accept: application/json
PageList listPages(docId, opts)
List pages
Returns a list of pages in a Coda doc.
import CodaJsClient from 'coda-js-client';
let defaultClient = CodaJsClient.ApiClient.instance;
let apiInstance = new CodaJsClient.PagesApi();
let docId = "docId_example"; // String | ID of the doc.
let opts = {
'limit': 56, // Number | Maximum number of results to return in this query.
'pageToken': "pageToken_example" // String | An opaque token used to fetch the next page of results.
};
apiInstance.listPages(docId, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
docId | String | ID of the doc. | |
limit | Number | Maximum number of results to return in this query. | [optional] |
pageToken | String | An opaque token used to fetch the next page of results. | [optional] |
- Content-Type: Not defined
- Accept: application/json
PageUpdateResult updatePage(bodydocIdpageIdOrName)
Update a page
Update properties for a page.
import CodaJsClient from 'coda-js-client';
let defaultClient = CodaJsClient.ApiClient.instance;
let apiInstance = new CodaJsClient.PagesApi();
let body = new CodaJsClient.PageUpdate(); // PageUpdate | Parameters for updating a page.
let docId = "docId_example"; // String | ID of the doc.
let pageIdOrName = "pageIdOrName_example"; // String | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected.
apiInstance.updatePage(bodydocIdpageIdOrName).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | PageUpdate | Parameters for updating a page. | |
docId | String | ID of the doc. | |
pageIdOrName | String | ID or name of the page. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If you provide a name and there are multiple pages with the same name, an arbitrary one will be selected. |
- Content-Type: application/json
- Accept: application/json