Skip to content

Latest commit

 

History

History
153 lines (103 loc) · 4.76 KB

PagesApi.md

File metadata and controls

153 lines (103 loc) · 4.76 KB

CodaJsClient.PagesApi

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

getPage

Page getPage(docId, pageIdOrName)

Get a page

Returns details about a page.

Example

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);
});

Parameters

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.

Return type

Page

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listPages

PageList listPages(docId, opts)

List pages

Returns a list of pages in a Coda doc.

Example

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);
});

Parameters

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]

Return type

PageList

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updatePage

PageUpdateResult updatePage(bodydocIdpageIdOrName)

Update a page

Update properties for a page.

Example

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);
});

Parameters

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.

Return type

PageUpdateResult

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json