Google Docs API
POST
docs.documents.batchUpdate
{{baseUrl}}/v1/documents/:documentId:batchUpdate
QUERY PARAMS
documentId
BODY json
{
"requests": [
{
"createFooter": {
"sectionBreakLocation": {
"index": 0,
"segmentId": ""
},
"type": ""
},
"createFootnote": {
"endOfSegmentLocation": {
"segmentId": ""
},
"location": {}
},
"createHeader": {
"sectionBreakLocation": {},
"type": ""
},
"createNamedRange": {
"name": "",
"range": {
"endIndex": 0,
"segmentId": "",
"startIndex": 0
}
},
"createParagraphBullets": {
"bulletPreset": "",
"range": {}
},
"deleteContentRange": {
"range": {}
},
"deleteFooter": {
"footerId": ""
},
"deleteHeader": {
"headerId": ""
},
"deleteNamedRange": {
"name": "",
"namedRangeId": ""
},
"deleteParagraphBullets": {
"range": {}
},
"deletePositionedObject": {
"objectId": ""
},
"deleteTableColumn": {
"tableCellLocation": {
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": {}
}
},
"deleteTableRow": {
"tableCellLocation": {}
},
"insertInlineImage": {
"endOfSegmentLocation": {},
"location": {},
"objectSize": {
"height": {
"magnitude": "",
"unit": ""
},
"width": {}
},
"uri": ""
},
"insertPageBreak": {
"endOfSegmentLocation": {},
"location": {}
},
"insertSectionBreak": {
"endOfSegmentLocation": {},
"location": {},
"sectionType": ""
},
"insertTable": {
"columns": 0,
"endOfSegmentLocation": {},
"location": {},
"rows": 0
},
"insertTableColumn": {
"insertRight": false,
"tableCellLocation": {}
},
"insertTableRow": {
"insertBelow": false,
"tableCellLocation": {}
},
"insertText": {
"endOfSegmentLocation": {},
"location": {},
"text": ""
},
"mergeTableCells": {
"tableRange": {
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": {}
}
},
"pinTableHeaderRows": {
"pinnedHeaderRowsCount": 0,
"tableStartLocation": {}
},
"replaceAllText": {
"containsText": {
"matchCase": false,
"text": ""
},
"replaceText": ""
},
"replaceImage": {
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
},
"replaceNamedRangeContent": {
"namedRangeId": "",
"namedRangeName": "",
"text": ""
},
"unmergeTableCells": {
"tableRange": {}
},
"updateDocumentStyle": {
"documentStyle": {
"background": {
"color": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"fields": ""
},
"updateParagraphStyle": {
"fields": "",
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"range": {}
},
"updateSectionStyle": {
"fields": "",
"range": {},
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
}
},
"updateTableCellStyle": {
"fields": "",
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
},
"tableRange": {},
"tableStartLocation": {}
},
"updateTableColumnProperties": {
"columnIndices": [],
"fields": "",
"tableColumnProperties": {
"width": {},
"widthType": ""
},
"tableStartLocation": {}
},
"updateTableRowStyle": {
"fields": "",
"rowIndices": [],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
},
"tableStartLocation": {}
},
"updateTextStyle": {
"fields": "",
"range": {},
"textStyle": {
"backgroundColor": {},
"baselineOffset": "",
"bold": false,
"fontSize": {},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
}
}
],
"writeControl": {
"requiredRevisionId": "",
"targetRevisionId": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/documents/:documentId:batchUpdate");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/documents/:documentId:batchUpdate" {:content-type :json
:form-params {:requests [{:createFooter {:sectionBreakLocation {:index 0
:segmentId ""}
:type ""}
:createFootnote {:endOfSegmentLocation {:segmentId ""}
:location {}}
:createHeader {:sectionBreakLocation {}
:type ""}
:createNamedRange {:name ""
:range {:endIndex 0
:segmentId ""
:startIndex 0}}
:createParagraphBullets {:bulletPreset ""
:range {}}
:deleteContentRange {:range {}}
:deleteFooter {:footerId ""}
:deleteHeader {:headerId ""}
:deleteNamedRange {:name ""
:namedRangeId ""}
:deleteParagraphBullets {:range {}}
:deletePositionedObject {:objectId ""}
:deleteTableColumn {:tableCellLocation {:columnIndex 0
:rowIndex 0
:tableStartLocation {}}}
:deleteTableRow {:tableCellLocation {}}
:insertInlineImage {:endOfSegmentLocation {}
:location {}
:objectSize {:height {:magnitude ""
:unit ""}
:width {}}
:uri ""}
:insertPageBreak {:endOfSegmentLocation {}
:location {}}
:insertSectionBreak {:endOfSegmentLocation {}
:location {}
:sectionType ""}
:insertTable {:columns 0
:endOfSegmentLocation {}
:location {}
:rows 0}
:insertTableColumn {:insertRight false
:tableCellLocation {}}
:insertTableRow {:insertBelow false
:tableCellLocation {}}
:insertText {:endOfSegmentLocation {}
:location {}
:text ""}
:mergeTableCells {:tableRange {:columnSpan 0
:rowSpan 0
:tableCellLocation {}}}
:pinTableHeaderRows {:pinnedHeaderRowsCount 0
:tableStartLocation {}}
:replaceAllText {:containsText {:matchCase false
:text ""}
:replaceText ""}
:replaceImage {:imageObjectId ""
:imageReplaceMethod ""
:uri ""}
:replaceNamedRangeContent {:namedRangeId ""
:namedRangeName ""
:text ""}
:unmergeTableCells {:tableRange {}}
:updateDocumentStyle {:documentStyle {:background {:color {:color {:rgbColor {:blue ""
:green ""
:red ""}}}}
:defaultFooterId ""
:defaultHeaderId ""
:evenPageFooterId ""
:evenPageHeaderId ""
:firstPageFooterId ""
:firstPageHeaderId ""
:marginBottom {}
:marginFooter {}
:marginHeader {}
:marginLeft {}
:marginRight {}
:marginTop {}
:pageNumberStart 0
:pageSize {}
:useCustomHeaderFooterMargins false
:useEvenPageHeaderFooter false
:useFirstPageHeaderFooter false}
:fields ""}
:updateParagraphStyle {:fields ""
:paragraphStyle {:alignment ""
:avoidWidowAndOrphan false
:borderBetween {:color {}
:dashStyle ""
:padding {}
:width {}}
:borderBottom {}
:borderLeft {}
:borderRight {}
:borderTop {}
:direction ""
:headingId ""
:indentEnd {}
:indentFirstLine {}
:indentStart {}
:keepLinesTogether false
:keepWithNext false
:lineSpacing ""
:namedStyleType ""
:pageBreakBefore false
:shading {:backgroundColor {}}
:spaceAbove {}
:spaceBelow {}
:spacingMode ""
:tabStops [{:alignment ""
:offset {}}]}
:range {}}
:updateSectionStyle {:fields ""
:range {}
:sectionStyle {:columnProperties [{:paddingEnd {}
:width {}}]
:columnSeparatorStyle ""
:contentDirection ""
:defaultFooterId ""
:defaultHeaderId ""
:evenPageFooterId ""
:evenPageHeaderId ""
:firstPageFooterId ""
:firstPageHeaderId ""
:marginBottom {}
:marginFooter {}
:marginHeader {}
:marginLeft {}
:marginRight {}
:marginTop {}
:pageNumberStart 0
:sectionType ""
:useFirstPageHeaderFooter false}}
:updateTableCellStyle {:fields ""
:tableCellStyle {:backgroundColor {}
:borderBottom {:color {}
:dashStyle ""
:width {}}
:borderLeft {}
:borderRight {}
:borderTop {}
:columnSpan 0
:contentAlignment ""
:paddingBottom {}
:paddingLeft {}
:paddingRight {}
:paddingTop {}
:rowSpan 0}
:tableRange {}
:tableStartLocation {}}
:updateTableColumnProperties {:columnIndices []
:fields ""
:tableColumnProperties {:width {}
:widthType ""}
:tableStartLocation {}}
:updateTableRowStyle {:fields ""
:rowIndices []
:tableRowStyle {:minRowHeight {}
:preventOverflow false
:tableHeader false}
:tableStartLocation {}}
:updateTextStyle {:fields ""
:range {}
:textStyle {:backgroundColor {}
:baselineOffset ""
:bold false
:fontSize {}
:foregroundColor {}
:italic false
:link {:bookmarkId ""
:headingId ""
:url ""}
:smallCaps false
:strikethrough false
:underline false
:weightedFontFamily {:fontFamily ""
:weight 0}}}}]
:writeControl {:requiredRevisionId ""
:targetRevisionId ""}}})
require "http/client"
url = "{{baseUrl}}/v1/documents/:documentId:batchUpdate"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/documents/:documentId:batchUpdate"),
Content = new StringContent("{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/documents/:documentId:batchUpdate");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/documents/:documentId:batchUpdate"
payload := strings.NewReader("{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/documents/:documentId:batchUpdate HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 7427
{
"requests": [
{
"createFooter": {
"sectionBreakLocation": {
"index": 0,
"segmentId": ""
},
"type": ""
},
"createFootnote": {
"endOfSegmentLocation": {
"segmentId": ""
},
"location": {}
},
"createHeader": {
"sectionBreakLocation": {},
"type": ""
},
"createNamedRange": {
"name": "",
"range": {
"endIndex": 0,
"segmentId": "",
"startIndex": 0
}
},
"createParagraphBullets": {
"bulletPreset": "",
"range": {}
},
"deleteContentRange": {
"range": {}
},
"deleteFooter": {
"footerId": ""
},
"deleteHeader": {
"headerId": ""
},
"deleteNamedRange": {
"name": "",
"namedRangeId": ""
},
"deleteParagraphBullets": {
"range": {}
},
"deletePositionedObject": {
"objectId": ""
},
"deleteTableColumn": {
"tableCellLocation": {
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": {}
}
},
"deleteTableRow": {
"tableCellLocation": {}
},
"insertInlineImage": {
"endOfSegmentLocation": {},
"location": {},
"objectSize": {
"height": {
"magnitude": "",
"unit": ""
},
"width": {}
},
"uri": ""
},
"insertPageBreak": {
"endOfSegmentLocation": {},
"location": {}
},
"insertSectionBreak": {
"endOfSegmentLocation": {},
"location": {},
"sectionType": ""
},
"insertTable": {
"columns": 0,
"endOfSegmentLocation": {},
"location": {},
"rows": 0
},
"insertTableColumn": {
"insertRight": false,
"tableCellLocation": {}
},
"insertTableRow": {
"insertBelow": false,
"tableCellLocation": {}
},
"insertText": {
"endOfSegmentLocation": {},
"location": {},
"text": ""
},
"mergeTableCells": {
"tableRange": {
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": {}
}
},
"pinTableHeaderRows": {
"pinnedHeaderRowsCount": 0,
"tableStartLocation": {}
},
"replaceAllText": {
"containsText": {
"matchCase": false,
"text": ""
},
"replaceText": ""
},
"replaceImage": {
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
},
"replaceNamedRangeContent": {
"namedRangeId": "",
"namedRangeName": "",
"text": ""
},
"unmergeTableCells": {
"tableRange": {}
},
"updateDocumentStyle": {
"documentStyle": {
"background": {
"color": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"fields": ""
},
"updateParagraphStyle": {
"fields": "",
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"range": {}
},
"updateSectionStyle": {
"fields": "",
"range": {},
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
}
},
"updateTableCellStyle": {
"fields": "",
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
},
"tableRange": {},
"tableStartLocation": {}
},
"updateTableColumnProperties": {
"columnIndices": [],
"fields": "",
"tableColumnProperties": {
"width": {},
"widthType": ""
},
"tableStartLocation": {}
},
"updateTableRowStyle": {
"fields": "",
"rowIndices": [],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
},
"tableStartLocation": {}
},
"updateTextStyle": {
"fields": "",
"range": {},
"textStyle": {
"backgroundColor": {},
"baselineOffset": "",
"bold": false,
"fontSize": {},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
}
}
],
"writeControl": {
"requiredRevisionId": "",
"targetRevisionId": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/documents/:documentId:batchUpdate")
.setHeader("content-type", "application/json")
.setBody("{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/documents/:documentId:batchUpdate"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/documents/:documentId:batchUpdate")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/documents/:documentId:batchUpdate")
.header("content-type", "application/json")
.body("{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
requests: [
{
createFooter: {
sectionBreakLocation: {
index: 0,
segmentId: ''
},
type: ''
},
createFootnote: {
endOfSegmentLocation: {
segmentId: ''
},
location: {}
},
createHeader: {
sectionBreakLocation: {},
type: ''
},
createNamedRange: {
name: '',
range: {
endIndex: 0,
segmentId: '',
startIndex: 0
}
},
createParagraphBullets: {
bulletPreset: '',
range: {}
},
deleteContentRange: {
range: {}
},
deleteFooter: {
footerId: ''
},
deleteHeader: {
headerId: ''
},
deleteNamedRange: {
name: '',
namedRangeId: ''
},
deleteParagraphBullets: {
range: {}
},
deletePositionedObject: {
objectId: ''
},
deleteTableColumn: {
tableCellLocation: {
columnIndex: 0,
rowIndex: 0,
tableStartLocation: {}
}
},
deleteTableRow: {
tableCellLocation: {}
},
insertInlineImage: {
endOfSegmentLocation: {},
location: {},
objectSize: {
height: {
magnitude: '',
unit: ''
},
width: {}
},
uri: ''
},
insertPageBreak: {
endOfSegmentLocation: {},
location: {}
},
insertSectionBreak: {
endOfSegmentLocation: {},
location: {},
sectionType: ''
},
insertTable: {
columns: 0,
endOfSegmentLocation: {},
location: {},
rows: 0
},
insertTableColumn: {
insertRight: false,
tableCellLocation: {}
},
insertTableRow: {
insertBelow: false,
tableCellLocation: {}
},
insertText: {
endOfSegmentLocation: {},
location: {},
text: ''
},
mergeTableCells: {
tableRange: {
columnSpan: 0,
rowSpan: 0,
tableCellLocation: {}
}
},
pinTableHeaderRows: {
pinnedHeaderRowsCount: 0,
tableStartLocation: {}
},
replaceAllText: {
containsText: {
matchCase: false,
text: ''
},
replaceText: ''
},
replaceImage: {
imageObjectId: '',
imageReplaceMethod: '',
uri: ''
},
replaceNamedRangeContent: {
namedRangeId: '',
namedRangeName: '',
text: ''
},
unmergeTableCells: {
tableRange: {}
},
updateDocumentStyle: {
documentStyle: {
background: {
color: {
color: {
rgbColor: {
blue: '',
green: '',
red: ''
}
}
}
},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
fields: ''
},
updateParagraphStyle: {
fields: '',
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {
color: {},
dashStyle: '',
padding: {},
width: {}
},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {
backgroundColor: {}
},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [
{
alignment: '',
offset: {}
}
]
},
range: {}
},
updateSectionStyle: {
fields: '',
range: {},
sectionStyle: {
columnProperties: [
{
paddingEnd: {},
width: {}
}
],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
}
},
updateTableCellStyle: {
fields: '',
tableCellStyle: {
backgroundColor: {},
borderBottom: {
color: {},
dashStyle: '',
width: {}
},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
},
tableRange: {},
tableStartLocation: {}
},
updateTableColumnProperties: {
columnIndices: [],
fields: '',
tableColumnProperties: {
width: {},
widthType: ''
},
tableStartLocation: {}
},
updateTableRowStyle: {
fields: '',
rowIndices: [],
tableRowStyle: {
minRowHeight: {},
preventOverflow: false,
tableHeader: false
},
tableStartLocation: {}
},
updateTextStyle: {
fields: '',
range: {},
textStyle: {
backgroundColor: {},
baselineOffset: '',
bold: false,
fontSize: {},
foregroundColor: {},
italic: false,
link: {
bookmarkId: '',
headingId: '',
url: ''
},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {
fontFamily: '',
weight: 0
}
}
}
}
],
writeControl: {
requiredRevisionId: '',
targetRevisionId: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/documents/:documentId:batchUpdate');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/documents/:documentId:batchUpdate',
headers: {'content-type': 'application/json'},
data: {
requests: [
{
createFooter: {sectionBreakLocation: {index: 0, segmentId: ''}, type: ''},
createFootnote: {endOfSegmentLocation: {segmentId: ''}, location: {}},
createHeader: {sectionBreakLocation: {}, type: ''},
createNamedRange: {name: '', range: {endIndex: 0, segmentId: '', startIndex: 0}},
createParagraphBullets: {bulletPreset: '', range: {}},
deleteContentRange: {range: {}},
deleteFooter: {footerId: ''},
deleteHeader: {headerId: ''},
deleteNamedRange: {name: '', namedRangeId: ''},
deleteParagraphBullets: {range: {}},
deletePositionedObject: {objectId: ''},
deleteTableColumn: {tableCellLocation: {columnIndex: 0, rowIndex: 0, tableStartLocation: {}}},
deleteTableRow: {tableCellLocation: {}},
insertInlineImage: {
endOfSegmentLocation: {},
location: {},
objectSize: {height: {magnitude: '', unit: ''}, width: {}},
uri: ''
},
insertPageBreak: {endOfSegmentLocation: {}, location: {}},
insertSectionBreak: {endOfSegmentLocation: {}, location: {}, sectionType: ''},
insertTable: {columns: 0, endOfSegmentLocation: {}, location: {}, rows: 0},
insertTableColumn: {insertRight: false, tableCellLocation: {}},
insertTableRow: {insertBelow: false, tableCellLocation: {}},
insertText: {endOfSegmentLocation: {}, location: {}, text: ''},
mergeTableCells: {tableRange: {columnSpan: 0, rowSpan: 0, tableCellLocation: {}}},
pinTableHeaderRows: {pinnedHeaderRowsCount: 0, tableStartLocation: {}},
replaceAllText: {containsText: {matchCase: false, text: ''}, replaceText: ''},
replaceImage: {imageObjectId: '', imageReplaceMethod: '', uri: ''},
replaceNamedRangeContent: {namedRangeId: '', namedRangeName: '', text: ''},
unmergeTableCells: {tableRange: {}},
updateDocumentStyle: {
documentStyle: {
background: {color: {color: {rgbColor: {blue: '', green: '', red: ''}}}},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
fields: ''
},
updateParagraphStyle: {
fields: '',
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {color: {}, dashStyle: '', padding: {}, width: {}},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {backgroundColor: {}},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [{alignment: '', offset: {}}]
},
range: {}
},
updateSectionStyle: {
fields: '',
range: {},
sectionStyle: {
columnProperties: [{paddingEnd: {}, width: {}}],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
}
},
updateTableCellStyle: {
fields: '',
tableCellStyle: {
backgroundColor: {},
borderBottom: {color: {}, dashStyle: '', width: {}},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
},
tableRange: {},
tableStartLocation: {}
},
updateTableColumnProperties: {
columnIndices: [],
fields: '',
tableColumnProperties: {width: {}, widthType: ''},
tableStartLocation: {}
},
updateTableRowStyle: {
fields: '',
rowIndices: [],
tableRowStyle: {minRowHeight: {}, preventOverflow: false, tableHeader: false},
tableStartLocation: {}
},
updateTextStyle: {
fields: '',
range: {},
textStyle: {
backgroundColor: {},
baselineOffset: '',
bold: false,
fontSize: {},
foregroundColor: {},
italic: false,
link: {bookmarkId: '', headingId: '', url: ''},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {fontFamily: '', weight: 0}
}
}
}
],
writeControl: {requiredRevisionId: '', targetRevisionId: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/documents/:documentId:batchUpdate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"requests":[{"createFooter":{"sectionBreakLocation":{"index":0,"segmentId":""},"type":""},"createFootnote":{"endOfSegmentLocation":{"segmentId":""},"location":{}},"createHeader":{"sectionBreakLocation":{},"type":""},"createNamedRange":{"name":"","range":{"endIndex":0,"segmentId":"","startIndex":0}},"createParagraphBullets":{"bulletPreset":"","range":{}},"deleteContentRange":{"range":{}},"deleteFooter":{"footerId":""},"deleteHeader":{"headerId":""},"deleteNamedRange":{"name":"","namedRangeId":""},"deleteParagraphBullets":{"range":{}},"deletePositionedObject":{"objectId":""},"deleteTableColumn":{"tableCellLocation":{"columnIndex":0,"rowIndex":0,"tableStartLocation":{}}},"deleteTableRow":{"tableCellLocation":{}},"insertInlineImage":{"endOfSegmentLocation":{},"location":{},"objectSize":{"height":{"magnitude":"","unit":""},"width":{}},"uri":""},"insertPageBreak":{"endOfSegmentLocation":{},"location":{}},"insertSectionBreak":{"endOfSegmentLocation":{},"location":{},"sectionType":""},"insertTable":{"columns":0,"endOfSegmentLocation":{},"location":{},"rows":0},"insertTableColumn":{"insertRight":false,"tableCellLocation":{}},"insertTableRow":{"insertBelow":false,"tableCellLocation":{}},"insertText":{"endOfSegmentLocation":{},"location":{},"text":""},"mergeTableCells":{"tableRange":{"columnSpan":0,"rowSpan":0,"tableCellLocation":{}}},"pinTableHeaderRows":{"pinnedHeaderRowsCount":0,"tableStartLocation":{}},"replaceAllText":{"containsText":{"matchCase":false,"text":""},"replaceText":""},"replaceImage":{"imageObjectId":"","imageReplaceMethod":"","uri":""},"replaceNamedRangeContent":{"namedRangeId":"","namedRangeName":"","text":""},"unmergeTableCells":{"tableRange":{}},"updateDocumentStyle":{"documentStyle":{"background":{"color":{"color":{"rgbColor":{"blue":"","green":"","red":""}}}},"defaultFooterId":"","defaultHeaderId":"","evenPageFooterId":"","evenPageHeaderId":"","firstPageFooterId":"","firstPageHeaderId":"","marginBottom":{},"marginFooter":{},"marginHeader":{},"marginLeft":{},"marginRight":{},"marginTop":{},"pageNumberStart":0,"pageSize":{},"useCustomHeaderFooterMargins":false,"useEvenPageHeaderFooter":false,"useFirstPageHeaderFooter":false},"fields":""},"updateParagraphStyle":{"fields":"","paragraphStyle":{"alignment":"","avoidWidowAndOrphan":false,"borderBetween":{"color":{},"dashStyle":"","padding":{},"width":{}},"borderBottom":{},"borderLeft":{},"borderRight":{},"borderTop":{},"direction":"","headingId":"","indentEnd":{},"indentFirstLine":{},"indentStart":{},"keepLinesTogether":false,"keepWithNext":false,"lineSpacing":"","namedStyleType":"","pageBreakBefore":false,"shading":{"backgroundColor":{}},"spaceAbove":{},"spaceBelow":{},"spacingMode":"","tabStops":[{"alignment":"","offset":{}}]},"range":{}},"updateSectionStyle":{"fields":"","range":{},"sectionStyle":{"columnProperties":[{"paddingEnd":{},"width":{}}],"columnSeparatorStyle":"","contentDirection":"","defaultFooterId":"","defaultHeaderId":"","evenPageFooterId":"","evenPageHeaderId":"","firstPageFooterId":"","firstPageHeaderId":"","marginBottom":{},"marginFooter":{},"marginHeader":{},"marginLeft":{},"marginRight":{},"marginTop":{},"pageNumberStart":0,"sectionType":"","useFirstPageHeaderFooter":false}},"updateTableCellStyle":{"fields":"","tableCellStyle":{"backgroundColor":{},"borderBottom":{"color":{},"dashStyle":"","width":{}},"borderLeft":{},"borderRight":{},"borderTop":{},"columnSpan":0,"contentAlignment":"","paddingBottom":{},"paddingLeft":{},"paddingRight":{},"paddingTop":{},"rowSpan":0},"tableRange":{},"tableStartLocation":{}},"updateTableColumnProperties":{"columnIndices":[],"fields":"","tableColumnProperties":{"width":{},"widthType":""},"tableStartLocation":{}},"updateTableRowStyle":{"fields":"","rowIndices":[],"tableRowStyle":{"minRowHeight":{},"preventOverflow":false,"tableHeader":false},"tableStartLocation":{}},"updateTextStyle":{"fields":"","range":{},"textStyle":{"backgroundColor":{},"baselineOffset":"","bold":false,"fontSize":{},"foregroundColor":{},"italic":false,"link":{"bookmarkId":"","headingId":"","url":""},"smallCaps":false,"strikethrough":false,"underline":false,"weightedFontFamily":{"fontFamily":"","weight":0}}}}],"writeControl":{"requiredRevisionId":"","targetRevisionId":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/documents/:documentId:batchUpdate',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "requests": [\n {\n "createFooter": {\n "sectionBreakLocation": {\n "index": 0,\n "segmentId": ""\n },\n "type": ""\n },\n "createFootnote": {\n "endOfSegmentLocation": {\n "segmentId": ""\n },\n "location": {}\n },\n "createHeader": {\n "sectionBreakLocation": {},\n "type": ""\n },\n "createNamedRange": {\n "name": "",\n "range": {\n "endIndex": 0,\n "segmentId": "",\n "startIndex": 0\n }\n },\n "createParagraphBullets": {\n "bulletPreset": "",\n "range": {}\n },\n "deleteContentRange": {\n "range": {}\n },\n "deleteFooter": {\n "footerId": ""\n },\n "deleteHeader": {\n "headerId": ""\n },\n "deleteNamedRange": {\n "name": "",\n "namedRangeId": ""\n },\n "deleteParagraphBullets": {\n "range": {}\n },\n "deletePositionedObject": {\n "objectId": ""\n },\n "deleteTableColumn": {\n "tableCellLocation": {\n "columnIndex": 0,\n "rowIndex": 0,\n "tableStartLocation": {}\n }\n },\n "deleteTableRow": {\n "tableCellLocation": {}\n },\n "insertInlineImage": {\n "endOfSegmentLocation": {},\n "location": {},\n "objectSize": {\n "height": {\n "magnitude": "",\n "unit": ""\n },\n "width": {}\n },\n "uri": ""\n },\n "insertPageBreak": {\n "endOfSegmentLocation": {},\n "location": {}\n },\n "insertSectionBreak": {\n "endOfSegmentLocation": {},\n "location": {},\n "sectionType": ""\n },\n "insertTable": {\n "columns": 0,\n "endOfSegmentLocation": {},\n "location": {},\n "rows": 0\n },\n "insertTableColumn": {\n "insertRight": false,\n "tableCellLocation": {}\n },\n "insertTableRow": {\n "insertBelow": false,\n "tableCellLocation": {}\n },\n "insertText": {\n "endOfSegmentLocation": {},\n "location": {},\n "text": ""\n },\n "mergeTableCells": {\n "tableRange": {\n "columnSpan": 0,\n "rowSpan": 0,\n "tableCellLocation": {}\n }\n },\n "pinTableHeaderRows": {\n "pinnedHeaderRowsCount": 0,\n "tableStartLocation": {}\n },\n "replaceAllText": {\n "containsText": {\n "matchCase": false,\n "text": ""\n },\n "replaceText": ""\n },\n "replaceImage": {\n "imageObjectId": "",\n "imageReplaceMethod": "",\n "uri": ""\n },\n "replaceNamedRangeContent": {\n "namedRangeId": "",\n "namedRangeName": "",\n "text": ""\n },\n "unmergeTableCells": {\n "tableRange": {}\n },\n "updateDocumentStyle": {\n "documentStyle": {\n "background": {\n "color": {\n "color": {\n "rgbColor": {\n "blue": "",\n "green": "",\n "red": ""\n }\n }\n }\n },\n "defaultFooterId": "",\n "defaultHeaderId": "",\n "evenPageFooterId": "",\n "evenPageHeaderId": "",\n "firstPageFooterId": "",\n "firstPageHeaderId": "",\n "marginBottom": {},\n "marginFooter": {},\n "marginHeader": {},\n "marginLeft": {},\n "marginRight": {},\n "marginTop": {},\n "pageNumberStart": 0,\n "pageSize": {},\n "useCustomHeaderFooterMargins": false,\n "useEvenPageHeaderFooter": false,\n "useFirstPageHeaderFooter": false\n },\n "fields": ""\n },\n "updateParagraphStyle": {\n "fields": "",\n "paragraphStyle": {\n "alignment": "",\n "avoidWidowAndOrphan": false,\n "borderBetween": {\n "color": {},\n "dashStyle": "",\n "padding": {},\n "width": {}\n },\n "borderBottom": {},\n "borderLeft": {},\n "borderRight": {},\n "borderTop": {},\n "direction": "",\n "headingId": "",\n "indentEnd": {},\n "indentFirstLine": {},\n "indentStart": {},\n "keepLinesTogether": false,\n "keepWithNext": false,\n "lineSpacing": "",\n "namedStyleType": "",\n "pageBreakBefore": false,\n "shading": {\n "backgroundColor": {}\n },\n "spaceAbove": {},\n "spaceBelow": {},\n "spacingMode": "",\n "tabStops": [\n {\n "alignment": "",\n "offset": {}\n }\n ]\n },\n "range": {}\n },\n "updateSectionStyle": {\n "fields": "",\n "range": {},\n "sectionStyle": {\n "columnProperties": [\n {\n "paddingEnd": {},\n "width": {}\n }\n ],\n "columnSeparatorStyle": "",\n "contentDirection": "",\n "defaultFooterId": "",\n "defaultHeaderId": "",\n "evenPageFooterId": "",\n "evenPageHeaderId": "",\n "firstPageFooterId": "",\n "firstPageHeaderId": "",\n "marginBottom": {},\n "marginFooter": {},\n "marginHeader": {},\n "marginLeft": {},\n "marginRight": {},\n "marginTop": {},\n "pageNumberStart": 0,\n "sectionType": "",\n "useFirstPageHeaderFooter": false\n }\n },\n "updateTableCellStyle": {\n "fields": "",\n "tableCellStyle": {\n "backgroundColor": {},\n "borderBottom": {\n "color": {},\n "dashStyle": "",\n "width": {}\n },\n "borderLeft": {},\n "borderRight": {},\n "borderTop": {},\n "columnSpan": 0,\n "contentAlignment": "",\n "paddingBottom": {},\n "paddingLeft": {},\n "paddingRight": {},\n "paddingTop": {},\n "rowSpan": 0\n },\n "tableRange": {},\n "tableStartLocation": {}\n },\n "updateTableColumnProperties": {\n "columnIndices": [],\n "fields": "",\n "tableColumnProperties": {\n "width": {},\n "widthType": ""\n },\n "tableStartLocation": {}\n },\n "updateTableRowStyle": {\n "fields": "",\n "rowIndices": [],\n "tableRowStyle": {\n "minRowHeight": {},\n "preventOverflow": false,\n "tableHeader": false\n },\n "tableStartLocation": {}\n },\n "updateTextStyle": {\n "fields": "",\n "range": {},\n "textStyle": {\n "backgroundColor": {},\n "baselineOffset": "",\n "bold": false,\n "fontSize": {},\n "foregroundColor": {},\n "italic": false,\n "link": {\n "bookmarkId": "",\n "headingId": "",\n "url": ""\n },\n "smallCaps": false,\n "strikethrough": false,\n "underline": false,\n "weightedFontFamily": {\n "fontFamily": "",\n "weight": 0\n }\n }\n }\n }\n ],\n "writeControl": {\n "requiredRevisionId": "",\n "targetRevisionId": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/documents/:documentId:batchUpdate")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/documents/:documentId:batchUpdate',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
requests: [
{
createFooter: {sectionBreakLocation: {index: 0, segmentId: ''}, type: ''},
createFootnote: {endOfSegmentLocation: {segmentId: ''}, location: {}},
createHeader: {sectionBreakLocation: {}, type: ''},
createNamedRange: {name: '', range: {endIndex: 0, segmentId: '', startIndex: 0}},
createParagraphBullets: {bulletPreset: '', range: {}},
deleteContentRange: {range: {}},
deleteFooter: {footerId: ''},
deleteHeader: {headerId: ''},
deleteNamedRange: {name: '', namedRangeId: ''},
deleteParagraphBullets: {range: {}},
deletePositionedObject: {objectId: ''},
deleteTableColumn: {tableCellLocation: {columnIndex: 0, rowIndex: 0, tableStartLocation: {}}},
deleteTableRow: {tableCellLocation: {}},
insertInlineImage: {
endOfSegmentLocation: {},
location: {},
objectSize: {height: {magnitude: '', unit: ''}, width: {}},
uri: ''
},
insertPageBreak: {endOfSegmentLocation: {}, location: {}},
insertSectionBreak: {endOfSegmentLocation: {}, location: {}, sectionType: ''},
insertTable: {columns: 0, endOfSegmentLocation: {}, location: {}, rows: 0},
insertTableColumn: {insertRight: false, tableCellLocation: {}},
insertTableRow: {insertBelow: false, tableCellLocation: {}},
insertText: {endOfSegmentLocation: {}, location: {}, text: ''},
mergeTableCells: {tableRange: {columnSpan: 0, rowSpan: 0, tableCellLocation: {}}},
pinTableHeaderRows: {pinnedHeaderRowsCount: 0, tableStartLocation: {}},
replaceAllText: {containsText: {matchCase: false, text: ''}, replaceText: ''},
replaceImage: {imageObjectId: '', imageReplaceMethod: '', uri: ''},
replaceNamedRangeContent: {namedRangeId: '', namedRangeName: '', text: ''},
unmergeTableCells: {tableRange: {}},
updateDocumentStyle: {
documentStyle: {
background: {color: {color: {rgbColor: {blue: '', green: '', red: ''}}}},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
fields: ''
},
updateParagraphStyle: {
fields: '',
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {color: {}, dashStyle: '', padding: {}, width: {}},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {backgroundColor: {}},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [{alignment: '', offset: {}}]
},
range: {}
},
updateSectionStyle: {
fields: '',
range: {},
sectionStyle: {
columnProperties: [{paddingEnd: {}, width: {}}],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
}
},
updateTableCellStyle: {
fields: '',
tableCellStyle: {
backgroundColor: {},
borderBottom: {color: {}, dashStyle: '', width: {}},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
},
tableRange: {},
tableStartLocation: {}
},
updateTableColumnProperties: {
columnIndices: [],
fields: '',
tableColumnProperties: {width: {}, widthType: ''},
tableStartLocation: {}
},
updateTableRowStyle: {
fields: '',
rowIndices: [],
tableRowStyle: {minRowHeight: {}, preventOverflow: false, tableHeader: false},
tableStartLocation: {}
},
updateTextStyle: {
fields: '',
range: {},
textStyle: {
backgroundColor: {},
baselineOffset: '',
bold: false,
fontSize: {},
foregroundColor: {},
italic: false,
link: {bookmarkId: '', headingId: '', url: ''},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {fontFamily: '', weight: 0}
}
}
}
],
writeControl: {requiredRevisionId: '', targetRevisionId: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/documents/:documentId:batchUpdate',
headers: {'content-type': 'application/json'},
body: {
requests: [
{
createFooter: {sectionBreakLocation: {index: 0, segmentId: ''}, type: ''},
createFootnote: {endOfSegmentLocation: {segmentId: ''}, location: {}},
createHeader: {sectionBreakLocation: {}, type: ''},
createNamedRange: {name: '', range: {endIndex: 0, segmentId: '', startIndex: 0}},
createParagraphBullets: {bulletPreset: '', range: {}},
deleteContentRange: {range: {}},
deleteFooter: {footerId: ''},
deleteHeader: {headerId: ''},
deleteNamedRange: {name: '', namedRangeId: ''},
deleteParagraphBullets: {range: {}},
deletePositionedObject: {objectId: ''},
deleteTableColumn: {tableCellLocation: {columnIndex: 0, rowIndex: 0, tableStartLocation: {}}},
deleteTableRow: {tableCellLocation: {}},
insertInlineImage: {
endOfSegmentLocation: {},
location: {},
objectSize: {height: {magnitude: '', unit: ''}, width: {}},
uri: ''
},
insertPageBreak: {endOfSegmentLocation: {}, location: {}},
insertSectionBreak: {endOfSegmentLocation: {}, location: {}, sectionType: ''},
insertTable: {columns: 0, endOfSegmentLocation: {}, location: {}, rows: 0},
insertTableColumn: {insertRight: false, tableCellLocation: {}},
insertTableRow: {insertBelow: false, tableCellLocation: {}},
insertText: {endOfSegmentLocation: {}, location: {}, text: ''},
mergeTableCells: {tableRange: {columnSpan: 0, rowSpan: 0, tableCellLocation: {}}},
pinTableHeaderRows: {pinnedHeaderRowsCount: 0, tableStartLocation: {}},
replaceAllText: {containsText: {matchCase: false, text: ''}, replaceText: ''},
replaceImage: {imageObjectId: '', imageReplaceMethod: '', uri: ''},
replaceNamedRangeContent: {namedRangeId: '', namedRangeName: '', text: ''},
unmergeTableCells: {tableRange: {}},
updateDocumentStyle: {
documentStyle: {
background: {color: {color: {rgbColor: {blue: '', green: '', red: ''}}}},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
fields: ''
},
updateParagraphStyle: {
fields: '',
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {color: {}, dashStyle: '', padding: {}, width: {}},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {backgroundColor: {}},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [{alignment: '', offset: {}}]
},
range: {}
},
updateSectionStyle: {
fields: '',
range: {},
sectionStyle: {
columnProperties: [{paddingEnd: {}, width: {}}],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
}
},
updateTableCellStyle: {
fields: '',
tableCellStyle: {
backgroundColor: {},
borderBottom: {color: {}, dashStyle: '', width: {}},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
},
tableRange: {},
tableStartLocation: {}
},
updateTableColumnProperties: {
columnIndices: [],
fields: '',
tableColumnProperties: {width: {}, widthType: ''},
tableStartLocation: {}
},
updateTableRowStyle: {
fields: '',
rowIndices: [],
tableRowStyle: {minRowHeight: {}, preventOverflow: false, tableHeader: false},
tableStartLocation: {}
},
updateTextStyle: {
fields: '',
range: {},
textStyle: {
backgroundColor: {},
baselineOffset: '',
bold: false,
fontSize: {},
foregroundColor: {},
italic: false,
link: {bookmarkId: '', headingId: '', url: ''},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {fontFamily: '', weight: 0}
}
}
}
],
writeControl: {requiredRevisionId: '', targetRevisionId: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/documents/:documentId:batchUpdate');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
requests: [
{
createFooter: {
sectionBreakLocation: {
index: 0,
segmentId: ''
},
type: ''
},
createFootnote: {
endOfSegmentLocation: {
segmentId: ''
},
location: {}
},
createHeader: {
sectionBreakLocation: {},
type: ''
},
createNamedRange: {
name: '',
range: {
endIndex: 0,
segmentId: '',
startIndex: 0
}
},
createParagraphBullets: {
bulletPreset: '',
range: {}
},
deleteContentRange: {
range: {}
},
deleteFooter: {
footerId: ''
},
deleteHeader: {
headerId: ''
},
deleteNamedRange: {
name: '',
namedRangeId: ''
},
deleteParagraphBullets: {
range: {}
},
deletePositionedObject: {
objectId: ''
},
deleteTableColumn: {
tableCellLocation: {
columnIndex: 0,
rowIndex: 0,
tableStartLocation: {}
}
},
deleteTableRow: {
tableCellLocation: {}
},
insertInlineImage: {
endOfSegmentLocation: {},
location: {},
objectSize: {
height: {
magnitude: '',
unit: ''
},
width: {}
},
uri: ''
},
insertPageBreak: {
endOfSegmentLocation: {},
location: {}
},
insertSectionBreak: {
endOfSegmentLocation: {},
location: {},
sectionType: ''
},
insertTable: {
columns: 0,
endOfSegmentLocation: {},
location: {},
rows: 0
},
insertTableColumn: {
insertRight: false,
tableCellLocation: {}
},
insertTableRow: {
insertBelow: false,
tableCellLocation: {}
},
insertText: {
endOfSegmentLocation: {},
location: {},
text: ''
},
mergeTableCells: {
tableRange: {
columnSpan: 0,
rowSpan: 0,
tableCellLocation: {}
}
},
pinTableHeaderRows: {
pinnedHeaderRowsCount: 0,
tableStartLocation: {}
},
replaceAllText: {
containsText: {
matchCase: false,
text: ''
},
replaceText: ''
},
replaceImage: {
imageObjectId: '',
imageReplaceMethod: '',
uri: ''
},
replaceNamedRangeContent: {
namedRangeId: '',
namedRangeName: '',
text: ''
},
unmergeTableCells: {
tableRange: {}
},
updateDocumentStyle: {
documentStyle: {
background: {
color: {
color: {
rgbColor: {
blue: '',
green: '',
red: ''
}
}
}
},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
fields: ''
},
updateParagraphStyle: {
fields: '',
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {
color: {},
dashStyle: '',
padding: {},
width: {}
},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {
backgroundColor: {}
},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [
{
alignment: '',
offset: {}
}
]
},
range: {}
},
updateSectionStyle: {
fields: '',
range: {},
sectionStyle: {
columnProperties: [
{
paddingEnd: {},
width: {}
}
],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
}
},
updateTableCellStyle: {
fields: '',
tableCellStyle: {
backgroundColor: {},
borderBottom: {
color: {},
dashStyle: '',
width: {}
},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
},
tableRange: {},
tableStartLocation: {}
},
updateTableColumnProperties: {
columnIndices: [],
fields: '',
tableColumnProperties: {
width: {},
widthType: ''
},
tableStartLocation: {}
},
updateTableRowStyle: {
fields: '',
rowIndices: [],
tableRowStyle: {
minRowHeight: {},
preventOverflow: false,
tableHeader: false
},
tableStartLocation: {}
},
updateTextStyle: {
fields: '',
range: {},
textStyle: {
backgroundColor: {},
baselineOffset: '',
bold: false,
fontSize: {},
foregroundColor: {},
italic: false,
link: {
bookmarkId: '',
headingId: '',
url: ''
},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {
fontFamily: '',
weight: 0
}
}
}
}
],
writeControl: {
requiredRevisionId: '',
targetRevisionId: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/documents/:documentId:batchUpdate',
headers: {'content-type': 'application/json'},
data: {
requests: [
{
createFooter: {sectionBreakLocation: {index: 0, segmentId: ''}, type: ''},
createFootnote: {endOfSegmentLocation: {segmentId: ''}, location: {}},
createHeader: {sectionBreakLocation: {}, type: ''},
createNamedRange: {name: '', range: {endIndex: 0, segmentId: '', startIndex: 0}},
createParagraphBullets: {bulletPreset: '', range: {}},
deleteContentRange: {range: {}},
deleteFooter: {footerId: ''},
deleteHeader: {headerId: ''},
deleteNamedRange: {name: '', namedRangeId: ''},
deleteParagraphBullets: {range: {}},
deletePositionedObject: {objectId: ''},
deleteTableColumn: {tableCellLocation: {columnIndex: 0, rowIndex: 0, tableStartLocation: {}}},
deleteTableRow: {tableCellLocation: {}},
insertInlineImage: {
endOfSegmentLocation: {},
location: {},
objectSize: {height: {magnitude: '', unit: ''}, width: {}},
uri: ''
},
insertPageBreak: {endOfSegmentLocation: {}, location: {}},
insertSectionBreak: {endOfSegmentLocation: {}, location: {}, sectionType: ''},
insertTable: {columns: 0, endOfSegmentLocation: {}, location: {}, rows: 0},
insertTableColumn: {insertRight: false, tableCellLocation: {}},
insertTableRow: {insertBelow: false, tableCellLocation: {}},
insertText: {endOfSegmentLocation: {}, location: {}, text: ''},
mergeTableCells: {tableRange: {columnSpan: 0, rowSpan: 0, tableCellLocation: {}}},
pinTableHeaderRows: {pinnedHeaderRowsCount: 0, tableStartLocation: {}},
replaceAllText: {containsText: {matchCase: false, text: ''}, replaceText: ''},
replaceImage: {imageObjectId: '', imageReplaceMethod: '', uri: ''},
replaceNamedRangeContent: {namedRangeId: '', namedRangeName: '', text: ''},
unmergeTableCells: {tableRange: {}},
updateDocumentStyle: {
documentStyle: {
background: {color: {color: {rgbColor: {blue: '', green: '', red: ''}}}},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
fields: ''
},
updateParagraphStyle: {
fields: '',
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {color: {}, dashStyle: '', padding: {}, width: {}},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {backgroundColor: {}},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [{alignment: '', offset: {}}]
},
range: {}
},
updateSectionStyle: {
fields: '',
range: {},
sectionStyle: {
columnProperties: [{paddingEnd: {}, width: {}}],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
}
},
updateTableCellStyle: {
fields: '',
tableCellStyle: {
backgroundColor: {},
borderBottom: {color: {}, dashStyle: '', width: {}},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
},
tableRange: {},
tableStartLocation: {}
},
updateTableColumnProperties: {
columnIndices: [],
fields: '',
tableColumnProperties: {width: {}, widthType: ''},
tableStartLocation: {}
},
updateTableRowStyle: {
fields: '',
rowIndices: [],
tableRowStyle: {minRowHeight: {}, preventOverflow: false, tableHeader: false},
tableStartLocation: {}
},
updateTextStyle: {
fields: '',
range: {},
textStyle: {
backgroundColor: {},
baselineOffset: '',
bold: false,
fontSize: {},
foregroundColor: {},
italic: false,
link: {bookmarkId: '', headingId: '', url: ''},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {fontFamily: '', weight: 0}
}
}
}
],
writeControl: {requiredRevisionId: '', targetRevisionId: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/documents/:documentId:batchUpdate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"requests":[{"createFooter":{"sectionBreakLocation":{"index":0,"segmentId":""},"type":""},"createFootnote":{"endOfSegmentLocation":{"segmentId":""},"location":{}},"createHeader":{"sectionBreakLocation":{},"type":""},"createNamedRange":{"name":"","range":{"endIndex":0,"segmentId":"","startIndex":0}},"createParagraphBullets":{"bulletPreset":"","range":{}},"deleteContentRange":{"range":{}},"deleteFooter":{"footerId":""},"deleteHeader":{"headerId":""},"deleteNamedRange":{"name":"","namedRangeId":""},"deleteParagraphBullets":{"range":{}},"deletePositionedObject":{"objectId":""},"deleteTableColumn":{"tableCellLocation":{"columnIndex":0,"rowIndex":0,"tableStartLocation":{}}},"deleteTableRow":{"tableCellLocation":{}},"insertInlineImage":{"endOfSegmentLocation":{},"location":{},"objectSize":{"height":{"magnitude":"","unit":""},"width":{}},"uri":""},"insertPageBreak":{"endOfSegmentLocation":{},"location":{}},"insertSectionBreak":{"endOfSegmentLocation":{},"location":{},"sectionType":""},"insertTable":{"columns":0,"endOfSegmentLocation":{},"location":{},"rows":0},"insertTableColumn":{"insertRight":false,"tableCellLocation":{}},"insertTableRow":{"insertBelow":false,"tableCellLocation":{}},"insertText":{"endOfSegmentLocation":{},"location":{},"text":""},"mergeTableCells":{"tableRange":{"columnSpan":0,"rowSpan":0,"tableCellLocation":{}}},"pinTableHeaderRows":{"pinnedHeaderRowsCount":0,"tableStartLocation":{}},"replaceAllText":{"containsText":{"matchCase":false,"text":""},"replaceText":""},"replaceImage":{"imageObjectId":"","imageReplaceMethod":"","uri":""},"replaceNamedRangeContent":{"namedRangeId":"","namedRangeName":"","text":""},"unmergeTableCells":{"tableRange":{}},"updateDocumentStyle":{"documentStyle":{"background":{"color":{"color":{"rgbColor":{"blue":"","green":"","red":""}}}},"defaultFooterId":"","defaultHeaderId":"","evenPageFooterId":"","evenPageHeaderId":"","firstPageFooterId":"","firstPageHeaderId":"","marginBottom":{},"marginFooter":{},"marginHeader":{},"marginLeft":{},"marginRight":{},"marginTop":{},"pageNumberStart":0,"pageSize":{},"useCustomHeaderFooterMargins":false,"useEvenPageHeaderFooter":false,"useFirstPageHeaderFooter":false},"fields":""},"updateParagraphStyle":{"fields":"","paragraphStyle":{"alignment":"","avoidWidowAndOrphan":false,"borderBetween":{"color":{},"dashStyle":"","padding":{},"width":{}},"borderBottom":{},"borderLeft":{},"borderRight":{},"borderTop":{},"direction":"","headingId":"","indentEnd":{},"indentFirstLine":{},"indentStart":{},"keepLinesTogether":false,"keepWithNext":false,"lineSpacing":"","namedStyleType":"","pageBreakBefore":false,"shading":{"backgroundColor":{}},"spaceAbove":{},"spaceBelow":{},"spacingMode":"","tabStops":[{"alignment":"","offset":{}}]},"range":{}},"updateSectionStyle":{"fields":"","range":{},"sectionStyle":{"columnProperties":[{"paddingEnd":{},"width":{}}],"columnSeparatorStyle":"","contentDirection":"","defaultFooterId":"","defaultHeaderId":"","evenPageFooterId":"","evenPageHeaderId":"","firstPageFooterId":"","firstPageHeaderId":"","marginBottom":{},"marginFooter":{},"marginHeader":{},"marginLeft":{},"marginRight":{},"marginTop":{},"pageNumberStart":0,"sectionType":"","useFirstPageHeaderFooter":false}},"updateTableCellStyle":{"fields":"","tableCellStyle":{"backgroundColor":{},"borderBottom":{"color":{},"dashStyle":"","width":{}},"borderLeft":{},"borderRight":{},"borderTop":{},"columnSpan":0,"contentAlignment":"","paddingBottom":{},"paddingLeft":{},"paddingRight":{},"paddingTop":{},"rowSpan":0},"tableRange":{},"tableStartLocation":{}},"updateTableColumnProperties":{"columnIndices":[],"fields":"","tableColumnProperties":{"width":{},"widthType":""},"tableStartLocation":{}},"updateTableRowStyle":{"fields":"","rowIndices":[],"tableRowStyle":{"minRowHeight":{},"preventOverflow":false,"tableHeader":false},"tableStartLocation":{}},"updateTextStyle":{"fields":"","range":{},"textStyle":{"backgroundColor":{},"baselineOffset":"","bold":false,"fontSize":{},"foregroundColor":{},"italic":false,"link":{"bookmarkId":"","headingId":"","url":""},"smallCaps":false,"strikethrough":false,"underline":false,"weightedFontFamily":{"fontFamily":"","weight":0}}}}],"writeControl":{"requiredRevisionId":"","targetRevisionId":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requests": @[ @{ @"createFooter": @{ @"sectionBreakLocation": @{ @"index": @0, @"segmentId": @"" }, @"type": @"" }, @"createFootnote": @{ @"endOfSegmentLocation": @{ @"segmentId": @"" }, @"location": @{ } }, @"createHeader": @{ @"sectionBreakLocation": @{ }, @"type": @"" }, @"createNamedRange": @{ @"name": @"", @"range": @{ @"endIndex": @0, @"segmentId": @"", @"startIndex": @0 } }, @"createParagraphBullets": @{ @"bulletPreset": @"", @"range": @{ } }, @"deleteContentRange": @{ @"range": @{ } }, @"deleteFooter": @{ @"footerId": @"" }, @"deleteHeader": @{ @"headerId": @"" }, @"deleteNamedRange": @{ @"name": @"", @"namedRangeId": @"" }, @"deleteParagraphBullets": @{ @"range": @{ } }, @"deletePositionedObject": @{ @"objectId": @"" }, @"deleteTableColumn": @{ @"tableCellLocation": @{ @"columnIndex": @0, @"rowIndex": @0, @"tableStartLocation": @{ } } }, @"deleteTableRow": @{ @"tableCellLocation": @{ } }, @"insertInlineImage": @{ @"endOfSegmentLocation": @{ }, @"location": @{ }, @"objectSize": @{ @"height": @{ @"magnitude": @"", @"unit": @"" }, @"width": @{ } }, @"uri": @"" }, @"insertPageBreak": @{ @"endOfSegmentLocation": @{ }, @"location": @{ } }, @"insertSectionBreak": @{ @"endOfSegmentLocation": @{ }, @"location": @{ }, @"sectionType": @"" }, @"insertTable": @{ @"columns": @0, @"endOfSegmentLocation": @{ }, @"location": @{ }, @"rows": @0 }, @"insertTableColumn": @{ @"insertRight": @NO, @"tableCellLocation": @{ } }, @"insertTableRow": @{ @"insertBelow": @NO, @"tableCellLocation": @{ } }, @"insertText": @{ @"endOfSegmentLocation": @{ }, @"location": @{ }, @"text": @"" }, @"mergeTableCells": @{ @"tableRange": @{ @"columnSpan": @0, @"rowSpan": @0, @"tableCellLocation": @{ } } }, @"pinTableHeaderRows": @{ @"pinnedHeaderRowsCount": @0, @"tableStartLocation": @{ } }, @"replaceAllText": @{ @"containsText": @{ @"matchCase": @NO, @"text": @"" }, @"replaceText": @"" }, @"replaceImage": @{ @"imageObjectId": @"", @"imageReplaceMethod": @"", @"uri": @"" }, @"replaceNamedRangeContent": @{ @"namedRangeId": @"", @"namedRangeName": @"", @"text": @"" }, @"unmergeTableCells": @{ @"tableRange": @{ } }, @"updateDocumentStyle": @{ @"documentStyle": @{ @"background": @{ @"color": @{ @"color": @{ @"rgbColor": @{ @"blue": @"", @"green": @"", @"red": @"" } } } }, @"defaultFooterId": @"", @"defaultHeaderId": @"", @"evenPageFooterId": @"", @"evenPageHeaderId": @"", @"firstPageFooterId": @"", @"firstPageHeaderId": @"", @"marginBottom": @{ }, @"marginFooter": @{ }, @"marginHeader": @{ }, @"marginLeft": @{ }, @"marginRight": @{ }, @"marginTop": @{ }, @"pageNumberStart": @0, @"pageSize": @{ }, @"useCustomHeaderFooterMargins": @NO, @"useEvenPageHeaderFooter": @NO, @"useFirstPageHeaderFooter": @NO }, @"fields": @"" }, @"updateParagraphStyle": @{ @"fields": @"", @"paragraphStyle": @{ @"alignment": @"", @"avoidWidowAndOrphan": @NO, @"borderBetween": @{ @"color": @{ }, @"dashStyle": @"", @"padding": @{ }, @"width": @{ } }, @"borderBottom": @{ }, @"borderLeft": @{ }, @"borderRight": @{ }, @"borderTop": @{ }, @"direction": @"", @"headingId": @"", @"indentEnd": @{ }, @"indentFirstLine": @{ }, @"indentStart": @{ }, @"keepLinesTogether": @NO, @"keepWithNext": @NO, @"lineSpacing": @"", @"namedStyleType": @"", @"pageBreakBefore": @NO, @"shading": @{ @"backgroundColor": @{ } }, @"spaceAbove": @{ }, @"spaceBelow": @{ }, @"spacingMode": @"", @"tabStops": @[ @{ @"alignment": @"", @"offset": @{ } } ] }, @"range": @{ } }, @"updateSectionStyle": @{ @"fields": @"", @"range": @{ }, @"sectionStyle": @{ @"columnProperties": @[ @{ @"paddingEnd": @{ }, @"width": @{ } } ], @"columnSeparatorStyle": @"", @"contentDirection": @"", @"defaultFooterId": @"", @"defaultHeaderId": @"", @"evenPageFooterId": @"", @"evenPageHeaderId": @"", @"firstPageFooterId": @"", @"firstPageHeaderId": @"", @"marginBottom": @{ }, @"marginFooter": @{ }, @"marginHeader": @{ }, @"marginLeft": @{ }, @"marginRight": @{ }, @"marginTop": @{ }, @"pageNumberStart": @0, @"sectionType": @"", @"useFirstPageHeaderFooter": @NO } }, @"updateTableCellStyle": @{ @"fields": @"", @"tableCellStyle": @{ @"backgroundColor": @{ }, @"borderBottom": @{ @"color": @{ }, @"dashStyle": @"", @"width": @{ } }, @"borderLeft": @{ }, @"borderRight": @{ }, @"borderTop": @{ }, @"columnSpan": @0, @"contentAlignment": @"", @"paddingBottom": @{ }, @"paddingLeft": @{ }, @"paddingRight": @{ }, @"paddingTop": @{ }, @"rowSpan": @0 }, @"tableRange": @{ }, @"tableStartLocation": @{ } }, @"updateTableColumnProperties": @{ @"columnIndices": @[ ], @"fields": @"", @"tableColumnProperties": @{ @"width": @{ }, @"widthType": @"" }, @"tableStartLocation": @{ } }, @"updateTableRowStyle": @{ @"fields": @"", @"rowIndices": @[ ], @"tableRowStyle": @{ @"minRowHeight": @{ }, @"preventOverflow": @NO, @"tableHeader": @NO }, @"tableStartLocation": @{ } }, @"updateTextStyle": @{ @"fields": @"", @"range": @{ }, @"textStyle": @{ @"backgroundColor": @{ }, @"baselineOffset": @"", @"bold": @NO, @"fontSize": @{ }, @"foregroundColor": @{ }, @"italic": @NO, @"link": @{ @"bookmarkId": @"", @"headingId": @"", @"url": @"" }, @"smallCaps": @NO, @"strikethrough": @NO, @"underline": @NO, @"weightedFontFamily": @{ @"fontFamily": @"", @"weight": @0 } } } } ],
@"writeControl": @{ @"requiredRevisionId": @"", @"targetRevisionId": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/documents/:documentId:batchUpdate"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/documents/:documentId:batchUpdate" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/documents/:documentId:batchUpdate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requests' => [
[
'createFooter' => [
'sectionBreakLocation' => [
'index' => 0,
'segmentId' => ''
],
'type' => ''
],
'createFootnote' => [
'endOfSegmentLocation' => [
'segmentId' => ''
],
'location' => [
]
],
'createHeader' => [
'sectionBreakLocation' => [
],
'type' => ''
],
'createNamedRange' => [
'name' => '',
'range' => [
'endIndex' => 0,
'segmentId' => '',
'startIndex' => 0
]
],
'createParagraphBullets' => [
'bulletPreset' => '',
'range' => [
]
],
'deleteContentRange' => [
'range' => [
]
],
'deleteFooter' => [
'footerId' => ''
],
'deleteHeader' => [
'headerId' => ''
],
'deleteNamedRange' => [
'name' => '',
'namedRangeId' => ''
],
'deleteParagraphBullets' => [
'range' => [
]
],
'deletePositionedObject' => [
'objectId' => ''
],
'deleteTableColumn' => [
'tableCellLocation' => [
'columnIndex' => 0,
'rowIndex' => 0,
'tableStartLocation' => [
]
]
],
'deleteTableRow' => [
'tableCellLocation' => [
]
],
'insertInlineImage' => [
'endOfSegmentLocation' => [
],
'location' => [
],
'objectSize' => [
'height' => [
'magnitude' => '',
'unit' => ''
],
'width' => [
]
],
'uri' => ''
],
'insertPageBreak' => [
'endOfSegmentLocation' => [
],
'location' => [
]
],
'insertSectionBreak' => [
'endOfSegmentLocation' => [
],
'location' => [
],
'sectionType' => ''
],
'insertTable' => [
'columns' => 0,
'endOfSegmentLocation' => [
],
'location' => [
],
'rows' => 0
],
'insertTableColumn' => [
'insertRight' => null,
'tableCellLocation' => [
]
],
'insertTableRow' => [
'insertBelow' => null,
'tableCellLocation' => [
]
],
'insertText' => [
'endOfSegmentLocation' => [
],
'location' => [
],
'text' => ''
],
'mergeTableCells' => [
'tableRange' => [
'columnSpan' => 0,
'rowSpan' => 0,
'tableCellLocation' => [
]
]
],
'pinTableHeaderRows' => [
'pinnedHeaderRowsCount' => 0,
'tableStartLocation' => [
]
],
'replaceAllText' => [
'containsText' => [
'matchCase' => null,
'text' => ''
],
'replaceText' => ''
],
'replaceImage' => [
'imageObjectId' => '',
'imageReplaceMethod' => '',
'uri' => ''
],
'replaceNamedRangeContent' => [
'namedRangeId' => '',
'namedRangeName' => '',
'text' => ''
],
'unmergeTableCells' => [
'tableRange' => [
]
],
'updateDocumentStyle' => [
'documentStyle' => [
'background' => [
'color' => [
'color' => [
'rgbColor' => [
'blue' => '',
'green' => '',
'red' => ''
]
]
]
],
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'pageSize' => [
],
'useCustomHeaderFooterMargins' => null,
'useEvenPageHeaderFooter' => null,
'useFirstPageHeaderFooter' => null
],
'fields' => ''
],
'updateParagraphStyle' => [
'fields' => '',
'paragraphStyle' => [
'alignment' => '',
'avoidWidowAndOrphan' => null,
'borderBetween' => [
'color' => [
],
'dashStyle' => '',
'padding' => [
],
'width' => [
]
],
'borderBottom' => [
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'direction' => '',
'headingId' => '',
'indentEnd' => [
],
'indentFirstLine' => [
],
'indentStart' => [
],
'keepLinesTogether' => null,
'keepWithNext' => null,
'lineSpacing' => '',
'namedStyleType' => '',
'pageBreakBefore' => null,
'shading' => [
'backgroundColor' => [
]
],
'spaceAbove' => [
],
'spaceBelow' => [
],
'spacingMode' => '',
'tabStops' => [
[
'alignment' => '',
'offset' => [
]
]
]
],
'range' => [
]
],
'updateSectionStyle' => [
'fields' => '',
'range' => [
],
'sectionStyle' => [
'columnProperties' => [
[
'paddingEnd' => [
],
'width' => [
]
]
],
'columnSeparatorStyle' => '',
'contentDirection' => '',
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'sectionType' => '',
'useFirstPageHeaderFooter' => null
]
],
'updateTableCellStyle' => [
'fields' => '',
'tableCellStyle' => [
'backgroundColor' => [
],
'borderBottom' => [
'color' => [
],
'dashStyle' => '',
'width' => [
]
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'columnSpan' => 0,
'contentAlignment' => '',
'paddingBottom' => [
],
'paddingLeft' => [
],
'paddingRight' => [
],
'paddingTop' => [
],
'rowSpan' => 0
],
'tableRange' => [
],
'tableStartLocation' => [
]
],
'updateTableColumnProperties' => [
'columnIndices' => [
],
'fields' => '',
'tableColumnProperties' => [
'width' => [
],
'widthType' => ''
],
'tableStartLocation' => [
]
],
'updateTableRowStyle' => [
'fields' => '',
'rowIndices' => [
],
'tableRowStyle' => [
'minRowHeight' => [
],
'preventOverflow' => null,
'tableHeader' => null
],
'tableStartLocation' => [
]
],
'updateTextStyle' => [
'fields' => '',
'range' => [
],
'textStyle' => [
'backgroundColor' => [
],
'baselineOffset' => '',
'bold' => null,
'fontSize' => [
],
'foregroundColor' => [
],
'italic' => null,
'link' => [
'bookmarkId' => '',
'headingId' => '',
'url' => ''
],
'smallCaps' => null,
'strikethrough' => null,
'underline' => null,
'weightedFontFamily' => [
'fontFamily' => '',
'weight' => 0
]
]
]
]
],
'writeControl' => [
'requiredRevisionId' => '',
'targetRevisionId' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/documents/:documentId:batchUpdate', [
'body' => '{
"requests": [
{
"createFooter": {
"sectionBreakLocation": {
"index": 0,
"segmentId": ""
},
"type": ""
},
"createFootnote": {
"endOfSegmentLocation": {
"segmentId": ""
},
"location": {}
},
"createHeader": {
"sectionBreakLocation": {},
"type": ""
},
"createNamedRange": {
"name": "",
"range": {
"endIndex": 0,
"segmentId": "",
"startIndex": 0
}
},
"createParagraphBullets": {
"bulletPreset": "",
"range": {}
},
"deleteContentRange": {
"range": {}
},
"deleteFooter": {
"footerId": ""
},
"deleteHeader": {
"headerId": ""
},
"deleteNamedRange": {
"name": "",
"namedRangeId": ""
},
"deleteParagraphBullets": {
"range": {}
},
"deletePositionedObject": {
"objectId": ""
},
"deleteTableColumn": {
"tableCellLocation": {
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": {}
}
},
"deleteTableRow": {
"tableCellLocation": {}
},
"insertInlineImage": {
"endOfSegmentLocation": {},
"location": {},
"objectSize": {
"height": {
"magnitude": "",
"unit": ""
},
"width": {}
},
"uri": ""
},
"insertPageBreak": {
"endOfSegmentLocation": {},
"location": {}
},
"insertSectionBreak": {
"endOfSegmentLocation": {},
"location": {},
"sectionType": ""
},
"insertTable": {
"columns": 0,
"endOfSegmentLocation": {},
"location": {},
"rows": 0
},
"insertTableColumn": {
"insertRight": false,
"tableCellLocation": {}
},
"insertTableRow": {
"insertBelow": false,
"tableCellLocation": {}
},
"insertText": {
"endOfSegmentLocation": {},
"location": {},
"text": ""
},
"mergeTableCells": {
"tableRange": {
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": {}
}
},
"pinTableHeaderRows": {
"pinnedHeaderRowsCount": 0,
"tableStartLocation": {}
},
"replaceAllText": {
"containsText": {
"matchCase": false,
"text": ""
},
"replaceText": ""
},
"replaceImage": {
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
},
"replaceNamedRangeContent": {
"namedRangeId": "",
"namedRangeName": "",
"text": ""
},
"unmergeTableCells": {
"tableRange": {}
},
"updateDocumentStyle": {
"documentStyle": {
"background": {
"color": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"fields": ""
},
"updateParagraphStyle": {
"fields": "",
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"range": {}
},
"updateSectionStyle": {
"fields": "",
"range": {},
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
}
},
"updateTableCellStyle": {
"fields": "",
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
},
"tableRange": {},
"tableStartLocation": {}
},
"updateTableColumnProperties": {
"columnIndices": [],
"fields": "",
"tableColumnProperties": {
"width": {},
"widthType": ""
},
"tableStartLocation": {}
},
"updateTableRowStyle": {
"fields": "",
"rowIndices": [],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
},
"tableStartLocation": {}
},
"updateTextStyle": {
"fields": "",
"range": {},
"textStyle": {
"backgroundColor": {},
"baselineOffset": "",
"bold": false,
"fontSize": {},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
}
}
],
"writeControl": {
"requiredRevisionId": "",
"targetRevisionId": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/documents/:documentId:batchUpdate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requests' => [
[
'createFooter' => [
'sectionBreakLocation' => [
'index' => 0,
'segmentId' => ''
],
'type' => ''
],
'createFootnote' => [
'endOfSegmentLocation' => [
'segmentId' => ''
],
'location' => [
]
],
'createHeader' => [
'sectionBreakLocation' => [
],
'type' => ''
],
'createNamedRange' => [
'name' => '',
'range' => [
'endIndex' => 0,
'segmentId' => '',
'startIndex' => 0
]
],
'createParagraphBullets' => [
'bulletPreset' => '',
'range' => [
]
],
'deleteContentRange' => [
'range' => [
]
],
'deleteFooter' => [
'footerId' => ''
],
'deleteHeader' => [
'headerId' => ''
],
'deleteNamedRange' => [
'name' => '',
'namedRangeId' => ''
],
'deleteParagraphBullets' => [
'range' => [
]
],
'deletePositionedObject' => [
'objectId' => ''
],
'deleteTableColumn' => [
'tableCellLocation' => [
'columnIndex' => 0,
'rowIndex' => 0,
'tableStartLocation' => [
]
]
],
'deleteTableRow' => [
'tableCellLocation' => [
]
],
'insertInlineImage' => [
'endOfSegmentLocation' => [
],
'location' => [
],
'objectSize' => [
'height' => [
'magnitude' => '',
'unit' => ''
],
'width' => [
]
],
'uri' => ''
],
'insertPageBreak' => [
'endOfSegmentLocation' => [
],
'location' => [
]
],
'insertSectionBreak' => [
'endOfSegmentLocation' => [
],
'location' => [
],
'sectionType' => ''
],
'insertTable' => [
'columns' => 0,
'endOfSegmentLocation' => [
],
'location' => [
],
'rows' => 0
],
'insertTableColumn' => [
'insertRight' => null,
'tableCellLocation' => [
]
],
'insertTableRow' => [
'insertBelow' => null,
'tableCellLocation' => [
]
],
'insertText' => [
'endOfSegmentLocation' => [
],
'location' => [
],
'text' => ''
],
'mergeTableCells' => [
'tableRange' => [
'columnSpan' => 0,
'rowSpan' => 0,
'tableCellLocation' => [
]
]
],
'pinTableHeaderRows' => [
'pinnedHeaderRowsCount' => 0,
'tableStartLocation' => [
]
],
'replaceAllText' => [
'containsText' => [
'matchCase' => null,
'text' => ''
],
'replaceText' => ''
],
'replaceImage' => [
'imageObjectId' => '',
'imageReplaceMethod' => '',
'uri' => ''
],
'replaceNamedRangeContent' => [
'namedRangeId' => '',
'namedRangeName' => '',
'text' => ''
],
'unmergeTableCells' => [
'tableRange' => [
]
],
'updateDocumentStyle' => [
'documentStyle' => [
'background' => [
'color' => [
'color' => [
'rgbColor' => [
'blue' => '',
'green' => '',
'red' => ''
]
]
]
],
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'pageSize' => [
],
'useCustomHeaderFooterMargins' => null,
'useEvenPageHeaderFooter' => null,
'useFirstPageHeaderFooter' => null
],
'fields' => ''
],
'updateParagraphStyle' => [
'fields' => '',
'paragraphStyle' => [
'alignment' => '',
'avoidWidowAndOrphan' => null,
'borderBetween' => [
'color' => [
],
'dashStyle' => '',
'padding' => [
],
'width' => [
]
],
'borderBottom' => [
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'direction' => '',
'headingId' => '',
'indentEnd' => [
],
'indentFirstLine' => [
],
'indentStart' => [
],
'keepLinesTogether' => null,
'keepWithNext' => null,
'lineSpacing' => '',
'namedStyleType' => '',
'pageBreakBefore' => null,
'shading' => [
'backgroundColor' => [
]
],
'spaceAbove' => [
],
'spaceBelow' => [
],
'spacingMode' => '',
'tabStops' => [
[
'alignment' => '',
'offset' => [
]
]
]
],
'range' => [
]
],
'updateSectionStyle' => [
'fields' => '',
'range' => [
],
'sectionStyle' => [
'columnProperties' => [
[
'paddingEnd' => [
],
'width' => [
]
]
],
'columnSeparatorStyle' => '',
'contentDirection' => '',
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'sectionType' => '',
'useFirstPageHeaderFooter' => null
]
],
'updateTableCellStyle' => [
'fields' => '',
'tableCellStyle' => [
'backgroundColor' => [
],
'borderBottom' => [
'color' => [
],
'dashStyle' => '',
'width' => [
]
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'columnSpan' => 0,
'contentAlignment' => '',
'paddingBottom' => [
],
'paddingLeft' => [
],
'paddingRight' => [
],
'paddingTop' => [
],
'rowSpan' => 0
],
'tableRange' => [
],
'tableStartLocation' => [
]
],
'updateTableColumnProperties' => [
'columnIndices' => [
],
'fields' => '',
'tableColumnProperties' => [
'width' => [
],
'widthType' => ''
],
'tableStartLocation' => [
]
],
'updateTableRowStyle' => [
'fields' => '',
'rowIndices' => [
],
'tableRowStyle' => [
'minRowHeight' => [
],
'preventOverflow' => null,
'tableHeader' => null
],
'tableStartLocation' => [
]
],
'updateTextStyle' => [
'fields' => '',
'range' => [
],
'textStyle' => [
'backgroundColor' => [
],
'baselineOffset' => '',
'bold' => null,
'fontSize' => [
],
'foregroundColor' => [
],
'italic' => null,
'link' => [
'bookmarkId' => '',
'headingId' => '',
'url' => ''
],
'smallCaps' => null,
'strikethrough' => null,
'underline' => null,
'weightedFontFamily' => [
'fontFamily' => '',
'weight' => 0
]
]
]
]
],
'writeControl' => [
'requiredRevisionId' => '',
'targetRevisionId' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requests' => [
[
'createFooter' => [
'sectionBreakLocation' => [
'index' => 0,
'segmentId' => ''
],
'type' => ''
],
'createFootnote' => [
'endOfSegmentLocation' => [
'segmentId' => ''
],
'location' => [
]
],
'createHeader' => [
'sectionBreakLocation' => [
],
'type' => ''
],
'createNamedRange' => [
'name' => '',
'range' => [
'endIndex' => 0,
'segmentId' => '',
'startIndex' => 0
]
],
'createParagraphBullets' => [
'bulletPreset' => '',
'range' => [
]
],
'deleteContentRange' => [
'range' => [
]
],
'deleteFooter' => [
'footerId' => ''
],
'deleteHeader' => [
'headerId' => ''
],
'deleteNamedRange' => [
'name' => '',
'namedRangeId' => ''
],
'deleteParagraphBullets' => [
'range' => [
]
],
'deletePositionedObject' => [
'objectId' => ''
],
'deleteTableColumn' => [
'tableCellLocation' => [
'columnIndex' => 0,
'rowIndex' => 0,
'tableStartLocation' => [
]
]
],
'deleteTableRow' => [
'tableCellLocation' => [
]
],
'insertInlineImage' => [
'endOfSegmentLocation' => [
],
'location' => [
],
'objectSize' => [
'height' => [
'magnitude' => '',
'unit' => ''
],
'width' => [
]
],
'uri' => ''
],
'insertPageBreak' => [
'endOfSegmentLocation' => [
],
'location' => [
]
],
'insertSectionBreak' => [
'endOfSegmentLocation' => [
],
'location' => [
],
'sectionType' => ''
],
'insertTable' => [
'columns' => 0,
'endOfSegmentLocation' => [
],
'location' => [
],
'rows' => 0
],
'insertTableColumn' => [
'insertRight' => null,
'tableCellLocation' => [
]
],
'insertTableRow' => [
'insertBelow' => null,
'tableCellLocation' => [
]
],
'insertText' => [
'endOfSegmentLocation' => [
],
'location' => [
],
'text' => ''
],
'mergeTableCells' => [
'tableRange' => [
'columnSpan' => 0,
'rowSpan' => 0,
'tableCellLocation' => [
]
]
],
'pinTableHeaderRows' => [
'pinnedHeaderRowsCount' => 0,
'tableStartLocation' => [
]
],
'replaceAllText' => [
'containsText' => [
'matchCase' => null,
'text' => ''
],
'replaceText' => ''
],
'replaceImage' => [
'imageObjectId' => '',
'imageReplaceMethod' => '',
'uri' => ''
],
'replaceNamedRangeContent' => [
'namedRangeId' => '',
'namedRangeName' => '',
'text' => ''
],
'unmergeTableCells' => [
'tableRange' => [
]
],
'updateDocumentStyle' => [
'documentStyle' => [
'background' => [
'color' => [
'color' => [
'rgbColor' => [
'blue' => '',
'green' => '',
'red' => ''
]
]
]
],
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'pageSize' => [
],
'useCustomHeaderFooterMargins' => null,
'useEvenPageHeaderFooter' => null,
'useFirstPageHeaderFooter' => null
],
'fields' => ''
],
'updateParagraphStyle' => [
'fields' => '',
'paragraphStyle' => [
'alignment' => '',
'avoidWidowAndOrphan' => null,
'borderBetween' => [
'color' => [
],
'dashStyle' => '',
'padding' => [
],
'width' => [
]
],
'borderBottom' => [
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'direction' => '',
'headingId' => '',
'indentEnd' => [
],
'indentFirstLine' => [
],
'indentStart' => [
],
'keepLinesTogether' => null,
'keepWithNext' => null,
'lineSpacing' => '',
'namedStyleType' => '',
'pageBreakBefore' => null,
'shading' => [
'backgroundColor' => [
]
],
'spaceAbove' => [
],
'spaceBelow' => [
],
'spacingMode' => '',
'tabStops' => [
[
'alignment' => '',
'offset' => [
]
]
]
],
'range' => [
]
],
'updateSectionStyle' => [
'fields' => '',
'range' => [
],
'sectionStyle' => [
'columnProperties' => [
[
'paddingEnd' => [
],
'width' => [
]
]
],
'columnSeparatorStyle' => '',
'contentDirection' => '',
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'sectionType' => '',
'useFirstPageHeaderFooter' => null
]
],
'updateTableCellStyle' => [
'fields' => '',
'tableCellStyle' => [
'backgroundColor' => [
],
'borderBottom' => [
'color' => [
],
'dashStyle' => '',
'width' => [
]
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'columnSpan' => 0,
'contentAlignment' => '',
'paddingBottom' => [
],
'paddingLeft' => [
],
'paddingRight' => [
],
'paddingTop' => [
],
'rowSpan' => 0
],
'tableRange' => [
],
'tableStartLocation' => [
]
],
'updateTableColumnProperties' => [
'columnIndices' => [
],
'fields' => '',
'tableColumnProperties' => [
'width' => [
],
'widthType' => ''
],
'tableStartLocation' => [
]
],
'updateTableRowStyle' => [
'fields' => '',
'rowIndices' => [
],
'tableRowStyle' => [
'minRowHeight' => [
],
'preventOverflow' => null,
'tableHeader' => null
],
'tableStartLocation' => [
]
],
'updateTextStyle' => [
'fields' => '',
'range' => [
],
'textStyle' => [
'backgroundColor' => [
],
'baselineOffset' => '',
'bold' => null,
'fontSize' => [
],
'foregroundColor' => [
],
'italic' => null,
'link' => [
'bookmarkId' => '',
'headingId' => '',
'url' => ''
],
'smallCaps' => null,
'strikethrough' => null,
'underline' => null,
'weightedFontFamily' => [
'fontFamily' => '',
'weight' => 0
]
]
]
]
],
'writeControl' => [
'requiredRevisionId' => '',
'targetRevisionId' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/documents/:documentId:batchUpdate');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/documents/:documentId:batchUpdate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requests": [
{
"createFooter": {
"sectionBreakLocation": {
"index": 0,
"segmentId": ""
},
"type": ""
},
"createFootnote": {
"endOfSegmentLocation": {
"segmentId": ""
},
"location": {}
},
"createHeader": {
"sectionBreakLocation": {},
"type": ""
},
"createNamedRange": {
"name": "",
"range": {
"endIndex": 0,
"segmentId": "",
"startIndex": 0
}
},
"createParagraphBullets": {
"bulletPreset": "",
"range": {}
},
"deleteContentRange": {
"range": {}
},
"deleteFooter": {
"footerId": ""
},
"deleteHeader": {
"headerId": ""
},
"deleteNamedRange": {
"name": "",
"namedRangeId": ""
},
"deleteParagraphBullets": {
"range": {}
},
"deletePositionedObject": {
"objectId": ""
},
"deleteTableColumn": {
"tableCellLocation": {
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": {}
}
},
"deleteTableRow": {
"tableCellLocation": {}
},
"insertInlineImage": {
"endOfSegmentLocation": {},
"location": {},
"objectSize": {
"height": {
"magnitude": "",
"unit": ""
},
"width": {}
},
"uri": ""
},
"insertPageBreak": {
"endOfSegmentLocation": {},
"location": {}
},
"insertSectionBreak": {
"endOfSegmentLocation": {},
"location": {},
"sectionType": ""
},
"insertTable": {
"columns": 0,
"endOfSegmentLocation": {},
"location": {},
"rows": 0
},
"insertTableColumn": {
"insertRight": false,
"tableCellLocation": {}
},
"insertTableRow": {
"insertBelow": false,
"tableCellLocation": {}
},
"insertText": {
"endOfSegmentLocation": {},
"location": {},
"text": ""
},
"mergeTableCells": {
"tableRange": {
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": {}
}
},
"pinTableHeaderRows": {
"pinnedHeaderRowsCount": 0,
"tableStartLocation": {}
},
"replaceAllText": {
"containsText": {
"matchCase": false,
"text": ""
},
"replaceText": ""
},
"replaceImage": {
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
},
"replaceNamedRangeContent": {
"namedRangeId": "",
"namedRangeName": "",
"text": ""
},
"unmergeTableCells": {
"tableRange": {}
},
"updateDocumentStyle": {
"documentStyle": {
"background": {
"color": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"fields": ""
},
"updateParagraphStyle": {
"fields": "",
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"range": {}
},
"updateSectionStyle": {
"fields": "",
"range": {},
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
}
},
"updateTableCellStyle": {
"fields": "",
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
},
"tableRange": {},
"tableStartLocation": {}
},
"updateTableColumnProperties": {
"columnIndices": [],
"fields": "",
"tableColumnProperties": {
"width": {},
"widthType": ""
},
"tableStartLocation": {}
},
"updateTableRowStyle": {
"fields": "",
"rowIndices": [],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
},
"tableStartLocation": {}
},
"updateTextStyle": {
"fields": "",
"range": {},
"textStyle": {
"backgroundColor": {},
"baselineOffset": "",
"bold": false,
"fontSize": {},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
}
}
],
"writeControl": {
"requiredRevisionId": "",
"targetRevisionId": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/documents/:documentId:batchUpdate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requests": [
{
"createFooter": {
"sectionBreakLocation": {
"index": 0,
"segmentId": ""
},
"type": ""
},
"createFootnote": {
"endOfSegmentLocation": {
"segmentId": ""
},
"location": {}
},
"createHeader": {
"sectionBreakLocation": {},
"type": ""
},
"createNamedRange": {
"name": "",
"range": {
"endIndex": 0,
"segmentId": "",
"startIndex": 0
}
},
"createParagraphBullets": {
"bulletPreset": "",
"range": {}
},
"deleteContentRange": {
"range": {}
},
"deleteFooter": {
"footerId": ""
},
"deleteHeader": {
"headerId": ""
},
"deleteNamedRange": {
"name": "",
"namedRangeId": ""
},
"deleteParagraphBullets": {
"range": {}
},
"deletePositionedObject": {
"objectId": ""
},
"deleteTableColumn": {
"tableCellLocation": {
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": {}
}
},
"deleteTableRow": {
"tableCellLocation": {}
},
"insertInlineImage": {
"endOfSegmentLocation": {},
"location": {},
"objectSize": {
"height": {
"magnitude": "",
"unit": ""
},
"width": {}
},
"uri": ""
},
"insertPageBreak": {
"endOfSegmentLocation": {},
"location": {}
},
"insertSectionBreak": {
"endOfSegmentLocation": {},
"location": {},
"sectionType": ""
},
"insertTable": {
"columns": 0,
"endOfSegmentLocation": {},
"location": {},
"rows": 0
},
"insertTableColumn": {
"insertRight": false,
"tableCellLocation": {}
},
"insertTableRow": {
"insertBelow": false,
"tableCellLocation": {}
},
"insertText": {
"endOfSegmentLocation": {},
"location": {},
"text": ""
},
"mergeTableCells": {
"tableRange": {
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": {}
}
},
"pinTableHeaderRows": {
"pinnedHeaderRowsCount": 0,
"tableStartLocation": {}
},
"replaceAllText": {
"containsText": {
"matchCase": false,
"text": ""
},
"replaceText": ""
},
"replaceImage": {
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
},
"replaceNamedRangeContent": {
"namedRangeId": "",
"namedRangeName": "",
"text": ""
},
"unmergeTableCells": {
"tableRange": {}
},
"updateDocumentStyle": {
"documentStyle": {
"background": {
"color": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"fields": ""
},
"updateParagraphStyle": {
"fields": "",
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"range": {}
},
"updateSectionStyle": {
"fields": "",
"range": {},
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
}
},
"updateTableCellStyle": {
"fields": "",
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
},
"tableRange": {},
"tableStartLocation": {}
},
"updateTableColumnProperties": {
"columnIndices": [],
"fields": "",
"tableColumnProperties": {
"width": {},
"widthType": ""
},
"tableStartLocation": {}
},
"updateTableRowStyle": {
"fields": "",
"rowIndices": [],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
},
"tableStartLocation": {}
},
"updateTextStyle": {
"fields": "",
"range": {},
"textStyle": {
"backgroundColor": {},
"baselineOffset": "",
"bold": false,
"fontSize": {},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
}
}
],
"writeControl": {
"requiredRevisionId": "",
"targetRevisionId": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/documents/:documentId:batchUpdate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/documents/:documentId:batchUpdate"
payload = {
"requests": [
{
"createFooter": {
"sectionBreakLocation": {
"index": 0,
"segmentId": ""
},
"type": ""
},
"createFootnote": {
"endOfSegmentLocation": { "segmentId": "" },
"location": {}
},
"createHeader": {
"sectionBreakLocation": {},
"type": ""
},
"createNamedRange": {
"name": "",
"range": {
"endIndex": 0,
"segmentId": "",
"startIndex": 0
}
},
"createParagraphBullets": {
"bulletPreset": "",
"range": {}
},
"deleteContentRange": { "range": {} },
"deleteFooter": { "footerId": "" },
"deleteHeader": { "headerId": "" },
"deleteNamedRange": {
"name": "",
"namedRangeId": ""
},
"deleteParagraphBullets": { "range": {} },
"deletePositionedObject": { "objectId": "" },
"deleteTableColumn": { "tableCellLocation": {
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": {}
} },
"deleteTableRow": { "tableCellLocation": {} },
"insertInlineImage": {
"endOfSegmentLocation": {},
"location": {},
"objectSize": {
"height": {
"magnitude": "",
"unit": ""
},
"width": {}
},
"uri": ""
},
"insertPageBreak": {
"endOfSegmentLocation": {},
"location": {}
},
"insertSectionBreak": {
"endOfSegmentLocation": {},
"location": {},
"sectionType": ""
},
"insertTable": {
"columns": 0,
"endOfSegmentLocation": {},
"location": {},
"rows": 0
},
"insertTableColumn": {
"insertRight": False,
"tableCellLocation": {}
},
"insertTableRow": {
"insertBelow": False,
"tableCellLocation": {}
},
"insertText": {
"endOfSegmentLocation": {},
"location": {},
"text": ""
},
"mergeTableCells": { "tableRange": {
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": {}
} },
"pinTableHeaderRows": {
"pinnedHeaderRowsCount": 0,
"tableStartLocation": {}
},
"replaceAllText": {
"containsText": {
"matchCase": False,
"text": ""
},
"replaceText": ""
},
"replaceImage": {
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
},
"replaceNamedRangeContent": {
"namedRangeId": "",
"namedRangeName": "",
"text": ""
},
"unmergeTableCells": { "tableRange": {} },
"updateDocumentStyle": {
"documentStyle": {
"background": { "color": { "color": { "rgbColor": {
"blue": "",
"green": "",
"red": ""
} } } },
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {},
"useCustomHeaderFooterMargins": False,
"useEvenPageHeaderFooter": False,
"useFirstPageHeaderFooter": False
},
"fields": ""
},
"updateParagraphStyle": {
"fields": "",
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": False,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": False,
"keepWithNext": False,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": False,
"shading": { "backgroundColor": {} },
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"range": {}
},
"updateSectionStyle": {
"fields": "",
"range": {},
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": False
}
},
"updateTableCellStyle": {
"fields": "",
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
},
"tableRange": {},
"tableStartLocation": {}
},
"updateTableColumnProperties": {
"columnIndices": [],
"fields": "",
"tableColumnProperties": {
"width": {},
"widthType": ""
},
"tableStartLocation": {}
},
"updateTableRowStyle": {
"fields": "",
"rowIndices": [],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": False,
"tableHeader": False
},
"tableStartLocation": {}
},
"updateTextStyle": {
"fields": "",
"range": {},
"textStyle": {
"backgroundColor": {},
"baselineOffset": "",
"bold": False,
"fontSize": {},
"foregroundColor": {},
"italic": False,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": False,
"strikethrough": False,
"underline": False,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
}
}
],
"writeControl": {
"requiredRevisionId": "",
"targetRevisionId": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/documents/:documentId:batchUpdate"
payload <- "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/documents/:documentId:batchUpdate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/documents/:documentId:batchUpdate') do |req|
req.body = "{\n \"requests\": [\n {\n \"createFooter\": {\n \"sectionBreakLocation\": {\n \"index\": 0,\n \"segmentId\": \"\"\n },\n \"type\": \"\"\n },\n \"createFootnote\": {\n \"endOfSegmentLocation\": {\n \"segmentId\": \"\"\n },\n \"location\": {}\n },\n \"createHeader\": {\n \"sectionBreakLocation\": {},\n \"type\": \"\"\n },\n \"createNamedRange\": {\n \"name\": \"\",\n \"range\": {\n \"endIndex\": 0,\n \"segmentId\": \"\",\n \"startIndex\": 0\n }\n },\n \"createParagraphBullets\": {\n \"bulletPreset\": \"\",\n \"range\": {}\n },\n \"deleteContentRange\": {\n \"range\": {}\n },\n \"deleteFooter\": {\n \"footerId\": \"\"\n },\n \"deleteHeader\": {\n \"headerId\": \"\"\n },\n \"deleteNamedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\"\n },\n \"deleteParagraphBullets\": {\n \"range\": {}\n },\n \"deletePositionedObject\": {\n \"objectId\": \"\"\n },\n \"deleteTableColumn\": {\n \"tableCellLocation\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"tableStartLocation\": {}\n }\n },\n \"deleteTableRow\": {\n \"tableCellLocation\": {}\n },\n \"insertInlineImage\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"objectSize\": {\n \"height\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"width\": {}\n },\n \"uri\": \"\"\n },\n \"insertPageBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {}\n },\n \"insertSectionBreak\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"sectionType\": \"\"\n },\n \"insertTable\": {\n \"columns\": 0,\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"rows\": 0\n },\n \"insertTableColumn\": {\n \"insertRight\": false,\n \"tableCellLocation\": {}\n },\n \"insertTableRow\": {\n \"insertBelow\": false,\n \"tableCellLocation\": {}\n },\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"location\": {},\n \"text\": \"\"\n },\n \"mergeTableCells\": {\n \"tableRange\": {\n \"columnSpan\": 0,\n \"rowSpan\": 0,\n \"tableCellLocation\": {}\n }\n },\n \"pinTableHeaderRows\": {\n \"pinnedHeaderRowsCount\": 0,\n \"tableStartLocation\": {}\n },\n \"replaceAllText\": {\n \"containsText\": {\n \"matchCase\": false,\n \"text\": \"\"\n },\n \"replaceText\": \"\"\n },\n \"replaceImage\": {\n \"imageObjectId\": \"\",\n \"imageReplaceMethod\": \"\",\n \"uri\": \"\"\n },\n \"replaceNamedRangeContent\": {\n \"namedRangeId\": \"\",\n \"namedRangeName\": \"\",\n \"text\": \"\"\n },\n \"unmergeTableCells\": {\n \"tableRange\": {}\n },\n \"updateDocumentStyle\": {\n \"documentStyle\": {\n \"background\": {\n \"color\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n }\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {},\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"fields\": \"\"\n },\n \"updateParagraphStyle\": {\n \"fields\": \"\",\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"range\": {}\n },\n \"updateSectionStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n }\n },\n \"updateTableCellStyle\": {\n \"fields\": \"\",\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n },\n \"tableRange\": {},\n \"tableStartLocation\": {}\n },\n \"updateTableColumnProperties\": {\n \"columnIndices\": [],\n \"fields\": \"\",\n \"tableColumnProperties\": {\n \"width\": {},\n \"widthType\": \"\"\n },\n \"tableStartLocation\": {}\n },\n \"updateTableRowStyle\": {\n \"fields\": \"\",\n \"rowIndices\": [],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n },\n \"tableStartLocation\": {}\n },\n \"updateTextStyle\": {\n \"fields\": \"\",\n \"range\": {},\n \"textStyle\": {\n \"backgroundColor\": {},\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {},\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n }\n }\n ],\n \"writeControl\": {\n \"requiredRevisionId\": \"\",\n \"targetRevisionId\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/documents/:documentId:batchUpdate";
let payload = json!({
"requests": (
json!({
"createFooter": json!({
"sectionBreakLocation": json!({
"index": 0,
"segmentId": ""
}),
"type": ""
}),
"createFootnote": json!({
"endOfSegmentLocation": json!({"segmentId": ""}),
"location": json!({})
}),
"createHeader": json!({
"sectionBreakLocation": json!({}),
"type": ""
}),
"createNamedRange": json!({
"name": "",
"range": json!({
"endIndex": 0,
"segmentId": "",
"startIndex": 0
})
}),
"createParagraphBullets": json!({
"bulletPreset": "",
"range": json!({})
}),
"deleteContentRange": json!({"range": json!({})}),
"deleteFooter": json!({"footerId": ""}),
"deleteHeader": json!({"headerId": ""}),
"deleteNamedRange": json!({
"name": "",
"namedRangeId": ""
}),
"deleteParagraphBullets": json!({"range": json!({})}),
"deletePositionedObject": json!({"objectId": ""}),
"deleteTableColumn": json!({"tableCellLocation": json!({
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": json!({})
})}),
"deleteTableRow": json!({"tableCellLocation": json!({})}),
"insertInlineImage": json!({
"endOfSegmentLocation": json!({}),
"location": json!({}),
"objectSize": json!({
"height": json!({
"magnitude": "",
"unit": ""
}),
"width": json!({})
}),
"uri": ""
}),
"insertPageBreak": json!({
"endOfSegmentLocation": json!({}),
"location": json!({})
}),
"insertSectionBreak": json!({
"endOfSegmentLocation": json!({}),
"location": json!({}),
"sectionType": ""
}),
"insertTable": json!({
"columns": 0,
"endOfSegmentLocation": json!({}),
"location": json!({}),
"rows": 0
}),
"insertTableColumn": json!({
"insertRight": false,
"tableCellLocation": json!({})
}),
"insertTableRow": json!({
"insertBelow": false,
"tableCellLocation": json!({})
}),
"insertText": json!({
"endOfSegmentLocation": json!({}),
"location": json!({}),
"text": ""
}),
"mergeTableCells": json!({"tableRange": json!({
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": json!({})
})}),
"pinTableHeaderRows": json!({
"pinnedHeaderRowsCount": 0,
"tableStartLocation": json!({})
}),
"replaceAllText": json!({
"containsText": json!({
"matchCase": false,
"text": ""
}),
"replaceText": ""
}),
"replaceImage": json!({
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
}),
"replaceNamedRangeContent": json!({
"namedRangeId": "",
"namedRangeName": "",
"text": ""
}),
"unmergeTableCells": json!({"tableRange": json!({})}),
"updateDocumentStyle": json!({
"documentStyle": json!({
"background": json!({"color": json!({"color": json!({"rgbColor": json!({
"blue": "",
"green": "",
"red": ""
})})})}),
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": json!({}),
"marginFooter": json!({}),
"marginHeader": json!({}),
"marginLeft": json!({}),
"marginRight": json!({}),
"marginTop": json!({}),
"pageNumberStart": 0,
"pageSize": json!({}),
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
}),
"fields": ""
}),
"updateParagraphStyle": json!({
"fields": "",
"paragraphStyle": json!({
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": json!({
"color": json!({}),
"dashStyle": "",
"padding": json!({}),
"width": json!({})
}),
"borderBottom": json!({}),
"borderLeft": json!({}),
"borderRight": json!({}),
"borderTop": json!({}),
"direction": "",
"headingId": "",
"indentEnd": json!({}),
"indentFirstLine": json!({}),
"indentStart": json!({}),
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": json!({"backgroundColor": json!({})}),
"spaceAbove": json!({}),
"spaceBelow": json!({}),
"spacingMode": "",
"tabStops": (
json!({
"alignment": "",
"offset": json!({})
})
)
}),
"range": json!({})
}),
"updateSectionStyle": json!({
"fields": "",
"range": json!({}),
"sectionStyle": json!({
"columnProperties": (
json!({
"paddingEnd": json!({}),
"width": json!({})
})
),
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": json!({}),
"marginFooter": json!({}),
"marginHeader": json!({}),
"marginLeft": json!({}),
"marginRight": json!({}),
"marginTop": json!({}),
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
})
}),
"updateTableCellStyle": json!({
"fields": "",
"tableCellStyle": json!({
"backgroundColor": json!({}),
"borderBottom": json!({
"color": json!({}),
"dashStyle": "",
"width": json!({})
}),
"borderLeft": json!({}),
"borderRight": json!({}),
"borderTop": json!({}),
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": json!({}),
"paddingLeft": json!({}),
"paddingRight": json!({}),
"paddingTop": json!({}),
"rowSpan": 0
}),
"tableRange": json!({}),
"tableStartLocation": json!({})
}),
"updateTableColumnProperties": json!({
"columnIndices": (),
"fields": "",
"tableColumnProperties": json!({
"width": json!({}),
"widthType": ""
}),
"tableStartLocation": json!({})
}),
"updateTableRowStyle": json!({
"fields": "",
"rowIndices": (),
"tableRowStyle": json!({
"minRowHeight": json!({}),
"preventOverflow": false,
"tableHeader": false
}),
"tableStartLocation": json!({})
}),
"updateTextStyle": json!({
"fields": "",
"range": json!({}),
"textStyle": json!({
"backgroundColor": json!({}),
"baselineOffset": "",
"bold": false,
"fontSize": json!({}),
"foregroundColor": json!({}),
"italic": false,
"link": json!({
"bookmarkId": "",
"headingId": "",
"url": ""
}),
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": json!({
"fontFamily": "",
"weight": 0
})
})
})
})
),
"writeControl": json!({
"requiredRevisionId": "",
"targetRevisionId": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/documents/:documentId:batchUpdate \
--header 'content-type: application/json' \
--data '{
"requests": [
{
"createFooter": {
"sectionBreakLocation": {
"index": 0,
"segmentId": ""
},
"type": ""
},
"createFootnote": {
"endOfSegmentLocation": {
"segmentId": ""
},
"location": {}
},
"createHeader": {
"sectionBreakLocation": {},
"type": ""
},
"createNamedRange": {
"name": "",
"range": {
"endIndex": 0,
"segmentId": "",
"startIndex": 0
}
},
"createParagraphBullets": {
"bulletPreset": "",
"range": {}
},
"deleteContentRange": {
"range": {}
},
"deleteFooter": {
"footerId": ""
},
"deleteHeader": {
"headerId": ""
},
"deleteNamedRange": {
"name": "",
"namedRangeId": ""
},
"deleteParagraphBullets": {
"range": {}
},
"deletePositionedObject": {
"objectId": ""
},
"deleteTableColumn": {
"tableCellLocation": {
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": {}
}
},
"deleteTableRow": {
"tableCellLocation": {}
},
"insertInlineImage": {
"endOfSegmentLocation": {},
"location": {},
"objectSize": {
"height": {
"magnitude": "",
"unit": ""
},
"width": {}
},
"uri": ""
},
"insertPageBreak": {
"endOfSegmentLocation": {},
"location": {}
},
"insertSectionBreak": {
"endOfSegmentLocation": {},
"location": {},
"sectionType": ""
},
"insertTable": {
"columns": 0,
"endOfSegmentLocation": {},
"location": {},
"rows": 0
},
"insertTableColumn": {
"insertRight": false,
"tableCellLocation": {}
},
"insertTableRow": {
"insertBelow": false,
"tableCellLocation": {}
},
"insertText": {
"endOfSegmentLocation": {},
"location": {},
"text": ""
},
"mergeTableCells": {
"tableRange": {
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": {}
}
},
"pinTableHeaderRows": {
"pinnedHeaderRowsCount": 0,
"tableStartLocation": {}
},
"replaceAllText": {
"containsText": {
"matchCase": false,
"text": ""
},
"replaceText": ""
},
"replaceImage": {
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
},
"replaceNamedRangeContent": {
"namedRangeId": "",
"namedRangeName": "",
"text": ""
},
"unmergeTableCells": {
"tableRange": {}
},
"updateDocumentStyle": {
"documentStyle": {
"background": {
"color": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"fields": ""
},
"updateParagraphStyle": {
"fields": "",
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"range": {}
},
"updateSectionStyle": {
"fields": "",
"range": {},
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
}
},
"updateTableCellStyle": {
"fields": "",
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
},
"tableRange": {},
"tableStartLocation": {}
},
"updateTableColumnProperties": {
"columnIndices": [],
"fields": "",
"tableColumnProperties": {
"width": {},
"widthType": ""
},
"tableStartLocation": {}
},
"updateTableRowStyle": {
"fields": "",
"rowIndices": [],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
},
"tableStartLocation": {}
},
"updateTextStyle": {
"fields": "",
"range": {},
"textStyle": {
"backgroundColor": {},
"baselineOffset": "",
"bold": false,
"fontSize": {},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
}
}
],
"writeControl": {
"requiredRevisionId": "",
"targetRevisionId": ""
}
}'
echo '{
"requests": [
{
"createFooter": {
"sectionBreakLocation": {
"index": 0,
"segmentId": ""
},
"type": ""
},
"createFootnote": {
"endOfSegmentLocation": {
"segmentId": ""
},
"location": {}
},
"createHeader": {
"sectionBreakLocation": {},
"type": ""
},
"createNamedRange": {
"name": "",
"range": {
"endIndex": 0,
"segmentId": "",
"startIndex": 0
}
},
"createParagraphBullets": {
"bulletPreset": "",
"range": {}
},
"deleteContentRange": {
"range": {}
},
"deleteFooter": {
"footerId": ""
},
"deleteHeader": {
"headerId": ""
},
"deleteNamedRange": {
"name": "",
"namedRangeId": ""
},
"deleteParagraphBullets": {
"range": {}
},
"deletePositionedObject": {
"objectId": ""
},
"deleteTableColumn": {
"tableCellLocation": {
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": {}
}
},
"deleteTableRow": {
"tableCellLocation": {}
},
"insertInlineImage": {
"endOfSegmentLocation": {},
"location": {},
"objectSize": {
"height": {
"magnitude": "",
"unit": ""
},
"width": {}
},
"uri": ""
},
"insertPageBreak": {
"endOfSegmentLocation": {},
"location": {}
},
"insertSectionBreak": {
"endOfSegmentLocation": {},
"location": {},
"sectionType": ""
},
"insertTable": {
"columns": 0,
"endOfSegmentLocation": {},
"location": {},
"rows": 0
},
"insertTableColumn": {
"insertRight": false,
"tableCellLocation": {}
},
"insertTableRow": {
"insertBelow": false,
"tableCellLocation": {}
},
"insertText": {
"endOfSegmentLocation": {},
"location": {},
"text": ""
},
"mergeTableCells": {
"tableRange": {
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": {}
}
},
"pinTableHeaderRows": {
"pinnedHeaderRowsCount": 0,
"tableStartLocation": {}
},
"replaceAllText": {
"containsText": {
"matchCase": false,
"text": ""
},
"replaceText": ""
},
"replaceImage": {
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
},
"replaceNamedRangeContent": {
"namedRangeId": "",
"namedRangeName": "",
"text": ""
},
"unmergeTableCells": {
"tableRange": {}
},
"updateDocumentStyle": {
"documentStyle": {
"background": {
"color": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"fields": ""
},
"updateParagraphStyle": {
"fields": "",
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"range": {}
},
"updateSectionStyle": {
"fields": "",
"range": {},
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
}
},
"updateTableCellStyle": {
"fields": "",
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
},
"tableRange": {},
"tableStartLocation": {}
},
"updateTableColumnProperties": {
"columnIndices": [],
"fields": "",
"tableColumnProperties": {
"width": {},
"widthType": ""
},
"tableStartLocation": {}
},
"updateTableRowStyle": {
"fields": "",
"rowIndices": [],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
},
"tableStartLocation": {}
},
"updateTextStyle": {
"fields": "",
"range": {},
"textStyle": {
"backgroundColor": {},
"baselineOffset": "",
"bold": false,
"fontSize": {},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
}
}
],
"writeControl": {
"requiredRevisionId": "",
"targetRevisionId": ""
}
}' | \
http POST {{baseUrl}}/v1/documents/:documentId:batchUpdate \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "requests": [\n {\n "createFooter": {\n "sectionBreakLocation": {\n "index": 0,\n "segmentId": ""\n },\n "type": ""\n },\n "createFootnote": {\n "endOfSegmentLocation": {\n "segmentId": ""\n },\n "location": {}\n },\n "createHeader": {\n "sectionBreakLocation": {},\n "type": ""\n },\n "createNamedRange": {\n "name": "",\n "range": {\n "endIndex": 0,\n "segmentId": "",\n "startIndex": 0\n }\n },\n "createParagraphBullets": {\n "bulletPreset": "",\n "range": {}\n },\n "deleteContentRange": {\n "range": {}\n },\n "deleteFooter": {\n "footerId": ""\n },\n "deleteHeader": {\n "headerId": ""\n },\n "deleteNamedRange": {\n "name": "",\n "namedRangeId": ""\n },\n "deleteParagraphBullets": {\n "range": {}\n },\n "deletePositionedObject": {\n "objectId": ""\n },\n "deleteTableColumn": {\n "tableCellLocation": {\n "columnIndex": 0,\n "rowIndex": 0,\n "tableStartLocation": {}\n }\n },\n "deleteTableRow": {\n "tableCellLocation": {}\n },\n "insertInlineImage": {\n "endOfSegmentLocation": {},\n "location": {},\n "objectSize": {\n "height": {\n "magnitude": "",\n "unit": ""\n },\n "width": {}\n },\n "uri": ""\n },\n "insertPageBreak": {\n "endOfSegmentLocation": {},\n "location": {}\n },\n "insertSectionBreak": {\n "endOfSegmentLocation": {},\n "location": {},\n "sectionType": ""\n },\n "insertTable": {\n "columns": 0,\n "endOfSegmentLocation": {},\n "location": {},\n "rows": 0\n },\n "insertTableColumn": {\n "insertRight": false,\n "tableCellLocation": {}\n },\n "insertTableRow": {\n "insertBelow": false,\n "tableCellLocation": {}\n },\n "insertText": {\n "endOfSegmentLocation": {},\n "location": {},\n "text": ""\n },\n "mergeTableCells": {\n "tableRange": {\n "columnSpan": 0,\n "rowSpan": 0,\n "tableCellLocation": {}\n }\n },\n "pinTableHeaderRows": {\n "pinnedHeaderRowsCount": 0,\n "tableStartLocation": {}\n },\n "replaceAllText": {\n "containsText": {\n "matchCase": false,\n "text": ""\n },\n "replaceText": ""\n },\n "replaceImage": {\n "imageObjectId": "",\n "imageReplaceMethod": "",\n "uri": ""\n },\n "replaceNamedRangeContent": {\n "namedRangeId": "",\n "namedRangeName": "",\n "text": ""\n },\n "unmergeTableCells": {\n "tableRange": {}\n },\n "updateDocumentStyle": {\n "documentStyle": {\n "background": {\n "color": {\n "color": {\n "rgbColor": {\n "blue": "",\n "green": "",\n "red": ""\n }\n }\n }\n },\n "defaultFooterId": "",\n "defaultHeaderId": "",\n "evenPageFooterId": "",\n "evenPageHeaderId": "",\n "firstPageFooterId": "",\n "firstPageHeaderId": "",\n "marginBottom": {},\n "marginFooter": {},\n "marginHeader": {},\n "marginLeft": {},\n "marginRight": {},\n "marginTop": {},\n "pageNumberStart": 0,\n "pageSize": {},\n "useCustomHeaderFooterMargins": false,\n "useEvenPageHeaderFooter": false,\n "useFirstPageHeaderFooter": false\n },\n "fields": ""\n },\n "updateParagraphStyle": {\n "fields": "",\n "paragraphStyle": {\n "alignment": "",\n "avoidWidowAndOrphan": false,\n "borderBetween": {\n "color": {},\n "dashStyle": "",\n "padding": {},\n "width": {}\n },\n "borderBottom": {},\n "borderLeft": {},\n "borderRight": {},\n "borderTop": {},\n "direction": "",\n "headingId": "",\n "indentEnd": {},\n "indentFirstLine": {},\n "indentStart": {},\n "keepLinesTogether": false,\n "keepWithNext": false,\n "lineSpacing": "",\n "namedStyleType": "",\n "pageBreakBefore": false,\n "shading": {\n "backgroundColor": {}\n },\n "spaceAbove": {},\n "spaceBelow": {},\n "spacingMode": "",\n "tabStops": [\n {\n "alignment": "",\n "offset": {}\n }\n ]\n },\n "range": {}\n },\n "updateSectionStyle": {\n "fields": "",\n "range": {},\n "sectionStyle": {\n "columnProperties": [\n {\n "paddingEnd": {},\n "width": {}\n }\n ],\n "columnSeparatorStyle": "",\n "contentDirection": "",\n "defaultFooterId": "",\n "defaultHeaderId": "",\n "evenPageFooterId": "",\n "evenPageHeaderId": "",\n "firstPageFooterId": "",\n "firstPageHeaderId": "",\n "marginBottom": {},\n "marginFooter": {},\n "marginHeader": {},\n "marginLeft": {},\n "marginRight": {},\n "marginTop": {},\n "pageNumberStart": 0,\n "sectionType": "",\n "useFirstPageHeaderFooter": false\n }\n },\n "updateTableCellStyle": {\n "fields": "",\n "tableCellStyle": {\n "backgroundColor": {},\n "borderBottom": {\n "color": {},\n "dashStyle": "",\n "width": {}\n },\n "borderLeft": {},\n "borderRight": {},\n "borderTop": {},\n "columnSpan": 0,\n "contentAlignment": "",\n "paddingBottom": {},\n "paddingLeft": {},\n "paddingRight": {},\n "paddingTop": {},\n "rowSpan": 0\n },\n "tableRange": {},\n "tableStartLocation": {}\n },\n "updateTableColumnProperties": {\n "columnIndices": [],\n "fields": "",\n "tableColumnProperties": {\n "width": {},\n "widthType": ""\n },\n "tableStartLocation": {}\n },\n "updateTableRowStyle": {\n "fields": "",\n "rowIndices": [],\n "tableRowStyle": {\n "minRowHeight": {},\n "preventOverflow": false,\n "tableHeader": false\n },\n "tableStartLocation": {}\n },\n "updateTextStyle": {\n "fields": "",\n "range": {},\n "textStyle": {\n "backgroundColor": {},\n "baselineOffset": "",\n "bold": false,\n "fontSize": {},\n "foregroundColor": {},\n "italic": false,\n "link": {\n "bookmarkId": "",\n "headingId": "",\n "url": ""\n },\n "smallCaps": false,\n "strikethrough": false,\n "underline": false,\n "weightedFontFamily": {\n "fontFamily": "",\n "weight": 0\n }\n }\n }\n }\n ],\n "writeControl": {\n "requiredRevisionId": "",\n "targetRevisionId": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v1/documents/:documentId:batchUpdate
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"requests": [
[
"createFooter": [
"sectionBreakLocation": [
"index": 0,
"segmentId": ""
],
"type": ""
],
"createFootnote": [
"endOfSegmentLocation": ["segmentId": ""],
"location": []
],
"createHeader": [
"sectionBreakLocation": [],
"type": ""
],
"createNamedRange": [
"name": "",
"range": [
"endIndex": 0,
"segmentId": "",
"startIndex": 0
]
],
"createParagraphBullets": [
"bulletPreset": "",
"range": []
],
"deleteContentRange": ["range": []],
"deleteFooter": ["footerId": ""],
"deleteHeader": ["headerId": ""],
"deleteNamedRange": [
"name": "",
"namedRangeId": ""
],
"deleteParagraphBullets": ["range": []],
"deletePositionedObject": ["objectId": ""],
"deleteTableColumn": ["tableCellLocation": [
"columnIndex": 0,
"rowIndex": 0,
"tableStartLocation": []
]],
"deleteTableRow": ["tableCellLocation": []],
"insertInlineImage": [
"endOfSegmentLocation": [],
"location": [],
"objectSize": [
"height": [
"magnitude": "",
"unit": ""
],
"width": []
],
"uri": ""
],
"insertPageBreak": [
"endOfSegmentLocation": [],
"location": []
],
"insertSectionBreak": [
"endOfSegmentLocation": [],
"location": [],
"sectionType": ""
],
"insertTable": [
"columns": 0,
"endOfSegmentLocation": [],
"location": [],
"rows": 0
],
"insertTableColumn": [
"insertRight": false,
"tableCellLocation": []
],
"insertTableRow": [
"insertBelow": false,
"tableCellLocation": []
],
"insertText": [
"endOfSegmentLocation": [],
"location": [],
"text": ""
],
"mergeTableCells": ["tableRange": [
"columnSpan": 0,
"rowSpan": 0,
"tableCellLocation": []
]],
"pinTableHeaderRows": [
"pinnedHeaderRowsCount": 0,
"tableStartLocation": []
],
"replaceAllText": [
"containsText": [
"matchCase": false,
"text": ""
],
"replaceText": ""
],
"replaceImage": [
"imageObjectId": "",
"imageReplaceMethod": "",
"uri": ""
],
"replaceNamedRangeContent": [
"namedRangeId": "",
"namedRangeName": "",
"text": ""
],
"unmergeTableCells": ["tableRange": []],
"updateDocumentStyle": [
"documentStyle": [
"background": ["color": ["color": ["rgbColor": [
"blue": "",
"green": "",
"red": ""
]]]],
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": [],
"marginFooter": [],
"marginHeader": [],
"marginLeft": [],
"marginRight": [],
"marginTop": [],
"pageNumberStart": 0,
"pageSize": [],
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
],
"fields": ""
],
"updateParagraphStyle": [
"fields": "",
"paragraphStyle": [
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": [
"color": [],
"dashStyle": "",
"padding": [],
"width": []
],
"borderBottom": [],
"borderLeft": [],
"borderRight": [],
"borderTop": [],
"direction": "",
"headingId": "",
"indentEnd": [],
"indentFirstLine": [],
"indentStart": [],
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": ["backgroundColor": []],
"spaceAbove": [],
"spaceBelow": [],
"spacingMode": "",
"tabStops": [
[
"alignment": "",
"offset": []
]
]
],
"range": []
],
"updateSectionStyle": [
"fields": "",
"range": [],
"sectionStyle": [
"columnProperties": [
[
"paddingEnd": [],
"width": []
]
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": [],
"marginFooter": [],
"marginHeader": [],
"marginLeft": [],
"marginRight": [],
"marginTop": [],
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
]
],
"updateTableCellStyle": [
"fields": "",
"tableCellStyle": [
"backgroundColor": [],
"borderBottom": [
"color": [],
"dashStyle": "",
"width": []
],
"borderLeft": [],
"borderRight": [],
"borderTop": [],
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": [],
"paddingLeft": [],
"paddingRight": [],
"paddingTop": [],
"rowSpan": 0
],
"tableRange": [],
"tableStartLocation": []
],
"updateTableColumnProperties": [
"columnIndices": [],
"fields": "",
"tableColumnProperties": [
"width": [],
"widthType": ""
],
"tableStartLocation": []
],
"updateTableRowStyle": [
"fields": "",
"rowIndices": [],
"tableRowStyle": [
"minRowHeight": [],
"preventOverflow": false,
"tableHeader": false
],
"tableStartLocation": []
],
"updateTextStyle": [
"fields": "",
"range": [],
"textStyle": [
"backgroundColor": [],
"baselineOffset": "",
"bold": false,
"fontSize": [],
"foregroundColor": [],
"italic": false,
"link": [
"bookmarkId": "",
"headingId": "",
"url": ""
],
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": [
"fontFamily": "",
"weight": 0
]
]
]
]
],
"writeControl": [
"requiredRevisionId": "",
"targetRevisionId": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/documents/:documentId:batchUpdate")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
docs.documents.create
{{baseUrl}}/v1/documents
BODY json
{
"body": {
"content": [
{
"endIndex": 0,
"paragraph": {
"bullet": {
"listId": "",
"nestingLevel": 0,
"textStyle": {
"backgroundColor": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
},
"baselineOffset": "",
"bold": false,
"fontSize": {
"magnitude": "",
"unit": ""
},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
},
"elements": [
{
"autoText": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {},
"type": ""
},
"columnBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"endIndex": 0,
"equation": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"footnoteReference": {
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"horizontalRule": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"inlineObjectElement": {
"inlineObjectId": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"pageBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"person": {
"personId": "",
"personProperties": {
"email": "",
"name": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"richLink": {
"richLinkId": "",
"richLinkProperties": {
"mimeType": "",
"title": "",
"uri": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"startIndex": 0,
"textRun": {
"content": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
}
}
],
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"positionedObjectIds": [],
"suggestedBulletChanges": {},
"suggestedParagraphStyleChanges": {},
"suggestedPositionedObjectIds": {}
},
"sectionBreak": {
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"startIndex": 0,
"table": {
"columns": 0,
"rows": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"tableRows": [
{
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableRowStyleChanges": {},
"tableCells": [
{
"content": [],
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableCellStyleChanges": {},
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
}
}
],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
}
}
],
"tableStyle": {
"tableColumnProperties": [
{
"width": {},
"widthType": ""
}
]
}
},
"tableOfContents": {
"content": [],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
}
}
]
},
"documentId": "",
"documentStyle": {
"background": {
"color": {}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {
"height": {},
"width": {}
},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"footers": {},
"footnotes": {},
"headers": {},
"inlineObjects": {},
"lists": {},
"namedRanges": {},
"namedStyles": {
"styles": [
{
"namedStyleType": "",
"paragraphStyle": {},
"textStyle": {}
}
]
},
"positionedObjects": {},
"revisionId": "",
"suggestedDocumentStyleChanges": {},
"suggestedNamedStylesChanges": {},
"suggestionsViewMode": "",
"title": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/documents");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/documents" {:content-type :json
:form-params {:body {:content [{:endIndex 0
:paragraph {:bullet {:listId ""
:nestingLevel 0
:textStyle {:backgroundColor {:color {:rgbColor {:blue ""
:green ""
:red ""}}}
:baselineOffset ""
:bold false
:fontSize {:magnitude ""
:unit ""}
:foregroundColor {}
:italic false
:link {:bookmarkId ""
:headingId ""
:url ""}
:smallCaps false
:strikethrough false
:underline false
:weightedFontFamily {:fontFamily ""
:weight 0}}}
:elements [{:autoText {:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTextStyleChanges {}
:textStyle {}
:type ""}
:columnBreak {:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTextStyleChanges {}
:textStyle {}}
:endIndex 0
:equation {:suggestedDeletionIds []
:suggestedInsertionIds []}
:footnoteReference {:footnoteId ""
:footnoteNumber ""
:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTextStyleChanges {}
:textStyle {}}
:horizontalRule {:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTextStyleChanges {}
:textStyle {}}
:inlineObjectElement {:inlineObjectId ""
:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTextStyleChanges {}
:textStyle {}}
:pageBreak {:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTextStyleChanges {}
:textStyle {}}
:person {:personId ""
:personProperties {:email ""
:name ""}
:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTextStyleChanges {}
:textStyle {}}
:richLink {:richLinkId ""
:richLinkProperties {:mimeType ""
:title ""
:uri ""}
:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTextStyleChanges {}
:textStyle {}}
:startIndex 0
:textRun {:content ""
:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTextStyleChanges {}
:textStyle {}}}]
:paragraphStyle {:alignment ""
:avoidWidowAndOrphan false
:borderBetween {:color {}
:dashStyle ""
:padding {}
:width {}}
:borderBottom {}
:borderLeft {}
:borderRight {}
:borderTop {}
:direction ""
:headingId ""
:indentEnd {}
:indentFirstLine {}
:indentStart {}
:keepLinesTogether false
:keepWithNext false
:lineSpacing ""
:namedStyleType ""
:pageBreakBefore false
:shading {:backgroundColor {}}
:spaceAbove {}
:spaceBelow {}
:spacingMode ""
:tabStops [{:alignment ""
:offset {}}]}
:positionedObjectIds []
:suggestedBulletChanges {}
:suggestedParagraphStyleChanges {}
:suggestedPositionedObjectIds {}}
:sectionBreak {:sectionStyle {:columnProperties [{:paddingEnd {}
:width {}}]
:columnSeparatorStyle ""
:contentDirection ""
:defaultFooterId ""
:defaultHeaderId ""
:evenPageFooterId ""
:evenPageHeaderId ""
:firstPageFooterId ""
:firstPageHeaderId ""
:marginBottom {}
:marginFooter {}
:marginHeader {}
:marginLeft {}
:marginRight {}
:marginTop {}
:pageNumberStart 0
:sectionType ""
:useFirstPageHeaderFooter false}
:suggestedDeletionIds []
:suggestedInsertionIds []}
:startIndex 0
:table {:columns 0
:rows 0
:suggestedDeletionIds []
:suggestedInsertionIds []
:tableRows [{:endIndex 0
:startIndex 0
:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTableRowStyleChanges {}
:tableCells [{:content []
:endIndex 0
:startIndex 0
:suggestedDeletionIds []
:suggestedInsertionIds []
:suggestedTableCellStyleChanges {}
:tableCellStyle {:backgroundColor {}
:borderBottom {:color {}
:dashStyle ""
:width {}}
:borderLeft {}
:borderRight {}
:borderTop {}
:columnSpan 0
:contentAlignment ""
:paddingBottom {}
:paddingLeft {}
:paddingRight {}
:paddingTop {}
:rowSpan 0}}]
:tableRowStyle {:minRowHeight {}
:preventOverflow false
:tableHeader false}}]
:tableStyle {:tableColumnProperties [{:width {}
:widthType ""}]}}
:tableOfContents {:content []
:suggestedDeletionIds []
:suggestedInsertionIds []}}]}
:documentId ""
:documentStyle {:background {:color {}}
:defaultFooterId ""
:defaultHeaderId ""
:evenPageFooterId ""
:evenPageHeaderId ""
:firstPageFooterId ""
:firstPageHeaderId ""
:marginBottom {}
:marginFooter {}
:marginHeader {}
:marginLeft {}
:marginRight {}
:marginTop {}
:pageNumberStart 0
:pageSize {:height {}
:width {}}
:useCustomHeaderFooterMargins false
:useEvenPageHeaderFooter false
:useFirstPageHeaderFooter false}
:footers {}
:footnotes {}
:headers {}
:inlineObjects {}
:lists {}
:namedRanges {}
:namedStyles {:styles [{:namedStyleType ""
:paragraphStyle {}
:textStyle {}}]}
:positionedObjects {}
:revisionId ""
:suggestedDocumentStyleChanges {}
:suggestedNamedStylesChanges {}
:suggestionsViewMode ""
:title ""}})
require "http/client"
url = "{{baseUrl}}/v1/documents"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/documents"),
Content = new StringContent("{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/documents");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/documents"
payload := strings.NewReader("{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/documents HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 8838
{
"body": {
"content": [
{
"endIndex": 0,
"paragraph": {
"bullet": {
"listId": "",
"nestingLevel": 0,
"textStyle": {
"backgroundColor": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
},
"baselineOffset": "",
"bold": false,
"fontSize": {
"magnitude": "",
"unit": ""
},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
},
"elements": [
{
"autoText": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {},
"type": ""
},
"columnBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"endIndex": 0,
"equation": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"footnoteReference": {
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"horizontalRule": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"inlineObjectElement": {
"inlineObjectId": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"pageBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"person": {
"personId": "",
"personProperties": {
"email": "",
"name": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"richLink": {
"richLinkId": "",
"richLinkProperties": {
"mimeType": "",
"title": "",
"uri": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"startIndex": 0,
"textRun": {
"content": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
}
}
],
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"positionedObjectIds": [],
"suggestedBulletChanges": {},
"suggestedParagraphStyleChanges": {},
"suggestedPositionedObjectIds": {}
},
"sectionBreak": {
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"startIndex": 0,
"table": {
"columns": 0,
"rows": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"tableRows": [
{
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableRowStyleChanges": {},
"tableCells": [
{
"content": [],
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableCellStyleChanges": {},
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
}
}
],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
}
}
],
"tableStyle": {
"tableColumnProperties": [
{
"width": {},
"widthType": ""
}
]
}
},
"tableOfContents": {
"content": [],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
}
}
]
},
"documentId": "",
"documentStyle": {
"background": {
"color": {}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {
"height": {},
"width": {}
},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"footers": {},
"footnotes": {},
"headers": {},
"inlineObjects": {},
"lists": {},
"namedRanges": {},
"namedStyles": {
"styles": [
{
"namedStyleType": "",
"paragraphStyle": {},
"textStyle": {}
}
]
},
"positionedObjects": {},
"revisionId": "",
"suggestedDocumentStyleChanges": {},
"suggestedNamedStylesChanges": {},
"suggestionsViewMode": "",
"title": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/documents")
.setHeader("content-type", "application/json")
.setBody("{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/documents"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/documents")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/documents")
.header("content-type", "application/json")
.body("{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}")
.asString();
const data = JSON.stringify({
body: {
content: [
{
endIndex: 0,
paragraph: {
bullet: {
listId: '',
nestingLevel: 0,
textStyle: {
backgroundColor: {
color: {
rgbColor: {
blue: '',
green: '',
red: ''
}
}
},
baselineOffset: '',
bold: false,
fontSize: {
magnitude: '',
unit: ''
},
foregroundColor: {},
italic: false,
link: {
bookmarkId: '',
headingId: '',
url: ''
},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {
fontFamily: '',
weight: 0
}
}
},
elements: [
{
autoText: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {},
type: ''
},
columnBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
endIndex: 0,
equation: {
suggestedDeletionIds: [],
suggestedInsertionIds: []
},
footnoteReference: {
footnoteId: '',
footnoteNumber: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
horizontalRule: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
inlineObjectElement: {
inlineObjectId: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
pageBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
person: {
personId: '',
personProperties: {
email: '',
name: ''
},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
richLink: {
richLinkId: '',
richLinkProperties: {
mimeType: '',
title: '',
uri: ''
},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
startIndex: 0,
textRun: {
content: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
}
}
],
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {
color: {},
dashStyle: '',
padding: {},
width: {}
},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {
backgroundColor: {}
},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [
{
alignment: '',
offset: {}
}
]
},
positionedObjectIds: [],
suggestedBulletChanges: {},
suggestedParagraphStyleChanges: {},
suggestedPositionedObjectIds: {}
},
sectionBreak: {
sectionStyle: {
columnProperties: [
{
paddingEnd: {},
width: {}
}
],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
},
suggestedDeletionIds: [],
suggestedInsertionIds: []
},
startIndex: 0,
table: {
columns: 0,
rows: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
tableRows: [
{
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableRowStyleChanges: {},
tableCells: [
{
content: [],
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableCellStyleChanges: {},
tableCellStyle: {
backgroundColor: {},
borderBottom: {
color: {},
dashStyle: '',
width: {}
},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
}
}
],
tableRowStyle: {
minRowHeight: {},
preventOverflow: false,
tableHeader: false
}
}
],
tableStyle: {
tableColumnProperties: [
{
width: {},
widthType: ''
}
]
}
},
tableOfContents: {
content: [],
suggestedDeletionIds: [],
suggestedInsertionIds: []
}
}
]
},
documentId: '',
documentStyle: {
background: {
color: {}
},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {
height: {},
width: {}
},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
footers: {},
footnotes: {},
headers: {},
inlineObjects: {},
lists: {},
namedRanges: {},
namedStyles: {
styles: [
{
namedStyleType: '',
paragraphStyle: {},
textStyle: {}
}
]
},
positionedObjects: {},
revisionId: '',
suggestedDocumentStyleChanges: {},
suggestedNamedStylesChanges: {},
suggestionsViewMode: '',
title: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/documents');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/documents',
headers: {'content-type': 'application/json'},
data: {
body: {
content: [
{
endIndex: 0,
paragraph: {
bullet: {
listId: '',
nestingLevel: 0,
textStyle: {
backgroundColor: {color: {rgbColor: {blue: '', green: '', red: ''}}},
baselineOffset: '',
bold: false,
fontSize: {magnitude: '', unit: ''},
foregroundColor: {},
italic: false,
link: {bookmarkId: '', headingId: '', url: ''},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {fontFamily: '', weight: 0}
}
},
elements: [
{
autoText: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {},
type: ''
},
columnBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
endIndex: 0,
equation: {suggestedDeletionIds: [], suggestedInsertionIds: []},
footnoteReference: {
footnoteId: '',
footnoteNumber: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
horizontalRule: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
inlineObjectElement: {
inlineObjectId: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
pageBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
person: {
personId: '',
personProperties: {email: '', name: ''},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
richLink: {
richLinkId: '',
richLinkProperties: {mimeType: '', title: '', uri: ''},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
startIndex: 0,
textRun: {
content: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
}
}
],
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {color: {}, dashStyle: '', padding: {}, width: {}},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {backgroundColor: {}},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [{alignment: '', offset: {}}]
},
positionedObjectIds: [],
suggestedBulletChanges: {},
suggestedParagraphStyleChanges: {},
suggestedPositionedObjectIds: {}
},
sectionBreak: {
sectionStyle: {
columnProperties: [{paddingEnd: {}, width: {}}],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
},
suggestedDeletionIds: [],
suggestedInsertionIds: []
},
startIndex: 0,
table: {
columns: 0,
rows: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
tableRows: [
{
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableRowStyleChanges: {},
tableCells: [
{
content: [],
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableCellStyleChanges: {},
tableCellStyle: {
backgroundColor: {},
borderBottom: {color: {}, dashStyle: '', width: {}},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
}
}
],
tableRowStyle: {minRowHeight: {}, preventOverflow: false, tableHeader: false}
}
],
tableStyle: {tableColumnProperties: [{width: {}, widthType: ''}]}
},
tableOfContents: {content: [], suggestedDeletionIds: [], suggestedInsertionIds: []}
}
]
},
documentId: '',
documentStyle: {
background: {color: {}},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {height: {}, width: {}},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
footers: {},
footnotes: {},
headers: {},
inlineObjects: {},
lists: {},
namedRanges: {},
namedStyles: {styles: [{namedStyleType: '', paragraphStyle: {}, textStyle: {}}]},
positionedObjects: {},
revisionId: '',
suggestedDocumentStyleChanges: {},
suggestedNamedStylesChanges: {},
suggestionsViewMode: '',
title: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/documents';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"body":{"content":[{"endIndex":0,"paragraph":{"bullet":{"listId":"","nestingLevel":0,"textStyle":{"backgroundColor":{"color":{"rgbColor":{"blue":"","green":"","red":""}}},"baselineOffset":"","bold":false,"fontSize":{"magnitude":"","unit":""},"foregroundColor":{},"italic":false,"link":{"bookmarkId":"","headingId":"","url":""},"smallCaps":false,"strikethrough":false,"underline":false,"weightedFontFamily":{"fontFamily":"","weight":0}}},"elements":[{"autoText":{"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{},"type":""},"columnBreak":{"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"endIndex":0,"equation":{"suggestedDeletionIds":[],"suggestedInsertionIds":[]},"footnoteReference":{"footnoteId":"","footnoteNumber":"","suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"horizontalRule":{"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"inlineObjectElement":{"inlineObjectId":"","suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"pageBreak":{"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"person":{"personId":"","personProperties":{"email":"","name":""},"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"richLink":{"richLinkId":"","richLinkProperties":{"mimeType":"","title":"","uri":""},"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"startIndex":0,"textRun":{"content":"","suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}}}],"paragraphStyle":{"alignment":"","avoidWidowAndOrphan":false,"borderBetween":{"color":{},"dashStyle":"","padding":{},"width":{}},"borderBottom":{},"borderLeft":{},"borderRight":{},"borderTop":{},"direction":"","headingId":"","indentEnd":{},"indentFirstLine":{},"indentStart":{},"keepLinesTogether":false,"keepWithNext":false,"lineSpacing":"","namedStyleType":"","pageBreakBefore":false,"shading":{"backgroundColor":{}},"spaceAbove":{},"spaceBelow":{},"spacingMode":"","tabStops":[{"alignment":"","offset":{}}]},"positionedObjectIds":[],"suggestedBulletChanges":{},"suggestedParagraphStyleChanges":{},"suggestedPositionedObjectIds":{}},"sectionBreak":{"sectionStyle":{"columnProperties":[{"paddingEnd":{},"width":{}}],"columnSeparatorStyle":"","contentDirection":"","defaultFooterId":"","defaultHeaderId":"","evenPageFooterId":"","evenPageHeaderId":"","firstPageFooterId":"","firstPageHeaderId":"","marginBottom":{},"marginFooter":{},"marginHeader":{},"marginLeft":{},"marginRight":{},"marginTop":{},"pageNumberStart":0,"sectionType":"","useFirstPageHeaderFooter":false},"suggestedDeletionIds":[],"suggestedInsertionIds":[]},"startIndex":0,"table":{"columns":0,"rows":0,"suggestedDeletionIds":[],"suggestedInsertionIds":[],"tableRows":[{"endIndex":0,"startIndex":0,"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTableRowStyleChanges":{},"tableCells":[{"content":[],"endIndex":0,"startIndex":0,"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTableCellStyleChanges":{},"tableCellStyle":{"backgroundColor":{},"borderBottom":{"color":{},"dashStyle":"","width":{}},"borderLeft":{},"borderRight":{},"borderTop":{},"columnSpan":0,"contentAlignment":"","paddingBottom":{},"paddingLeft":{},"paddingRight":{},"paddingTop":{},"rowSpan":0}}],"tableRowStyle":{"minRowHeight":{},"preventOverflow":false,"tableHeader":false}}],"tableStyle":{"tableColumnProperties":[{"width":{},"widthType":""}]}},"tableOfContents":{"content":[],"suggestedDeletionIds":[],"suggestedInsertionIds":[]}}]},"documentId":"","documentStyle":{"background":{"color":{}},"defaultFooterId":"","defaultHeaderId":"","evenPageFooterId":"","evenPageHeaderId":"","firstPageFooterId":"","firstPageHeaderId":"","marginBottom":{},"marginFooter":{},"marginHeader":{},"marginLeft":{},"marginRight":{},"marginTop":{},"pageNumberStart":0,"pageSize":{"height":{},"width":{}},"useCustomHeaderFooterMargins":false,"useEvenPageHeaderFooter":false,"useFirstPageHeaderFooter":false},"footers":{},"footnotes":{},"headers":{},"inlineObjects":{},"lists":{},"namedRanges":{},"namedStyles":{"styles":[{"namedStyleType":"","paragraphStyle":{},"textStyle":{}}]},"positionedObjects":{},"revisionId":"","suggestedDocumentStyleChanges":{},"suggestedNamedStylesChanges":{},"suggestionsViewMode":"","title":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/documents',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "body": {\n "content": [\n {\n "endIndex": 0,\n "paragraph": {\n "bullet": {\n "listId": "",\n "nestingLevel": 0,\n "textStyle": {\n "backgroundColor": {\n "color": {\n "rgbColor": {\n "blue": "",\n "green": "",\n "red": ""\n }\n }\n },\n "baselineOffset": "",\n "bold": false,\n "fontSize": {\n "magnitude": "",\n "unit": ""\n },\n "foregroundColor": {},\n "italic": false,\n "link": {\n "bookmarkId": "",\n "headingId": "",\n "url": ""\n },\n "smallCaps": false,\n "strikethrough": false,\n "underline": false,\n "weightedFontFamily": {\n "fontFamily": "",\n "weight": 0\n }\n }\n },\n "elements": [\n {\n "autoText": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {},\n "type": ""\n },\n "columnBreak": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "endIndex": 0,\n "equation": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": []\n },\n "footnoteReference": {\n "footnoteId": "",\n "footnoteNumber": "",\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "horizontalRule": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "inlineObjectElement": {\n "inlineObjectId": "",\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "pageBreak": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "person": {\n "personId": "",\n "personProperties": {\n "email": "",\n "name": ""\n },\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "richLink": {\n "richLinkId": "",\n "richLinkProperties": {\n "mimeType": "",\n "title": "",\n "uri": ""\n },\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "startIndex": 0,\n "textRun": {\n "content": "",\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n }\n }\n ],\n "paragraphStyle": {\n "alignment": "",\n "avoidWidowAndOrphan": false,\n "borderBetween": {\n "color": {},\n "dashStyle": "",\n "padding": {},\n "width": {}\n },\n "borderBottom": {},\n "borderLeft": {},\n "borderRight": {},\n "borderTop": {},\n "direction": "",\n "headingId": "",\n "indentEnd": {},\n "indentFirstLine": {},\n "indentStart": {},\n "keepLinesTogether": false,\n "keepWithNext": false,\n "lineSpacing": "",\n "namedStyleType": "",\n "pageBreakBefore": false,\n "shading": {\n "backgroundColor": {}\n },\n "spaceAbove": {},\n "spaceBelow": {},\n "spacingMode": "",\n "tabStops": [\n {\n "alignment": "",\n "offset": {}\n }\n ]\n },\n "positionedObjectIds": [],\n "suggestedBulletChanges": {},\n "suggestedParagraphStyleChanges": {},\n "suggestedPositionedObjectIds": {}\n },\n "sectionBreak": {\n "sectionStyle": {\n "columnProperties": [\n {\n "paddingEnd": {},\n "width": {}\n }\n ],\n "columnSeparatorStyle": "",\n "contentDirection": "",\n "defaultFooterId": "",\n "defaultHeaderId": "",\n "evenPageFooterId": "",\n "evenPageHeaderId": "",\n "firstPageFooterId": "",\n "firstPageHeaderId": "",\n "marginBottom": {},\n "marginFooter": {},\n "marginHeader": {},\n "marginLeft": {},\n "marginRight": {},\n "marginTop": {},\n "pageNumberStart": 0,\n "sectionType": "",\n "useFirstPageHeaderFooter": false\n },\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": []\n },\n "startIndex": 0,\n "table": {\n "columns": 0,\n "rows": 0,\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "tableRows": [\n {\n "endIndex": 0,\n "startIndex": 0,\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTableRowStyleChanges": {},\n "tableCells": [\n {\n "content": [],\n "endIndex": 0,\n "startIndex": 0,\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTableCellStyleChanges": {},\n "tableCellStyle": {\n "backgroundColor": {},\n "borderBottom": {\n "color": {},\n "dashStyle": "",\n "width": {}\n },\n "borderLeft": {},\n "borderRight": {},\n "borderTop": {},\n "columnSpan": 0,\n "contentAlignment": "",\n "paddingBottom": {},\n "paddingLeft": {},\n "paddingRight": {},\n "paddingTop": {},\n "rowSpan": 0\n }\n }\n ],\n "tableRowStyle": {\n "minRowHeight": {},\n "preventOverflow": false,\n "tableHeader": false\n }\n }\n ],\n "tableStyle": {\n "tableColumnProperties": [\n {\n "width": {},\n "widthType": ""\n }\n ]\n }\n },\n "tableOfContents": {\n "content": [],\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": []\n }\n }\n ]\n },\n "documentId": "",\n "documentStyle": {\n "background": {\n "color": {}\n },\n "defaultFooterId": "",\n "defaultHeaderId": "",\n "evenPageFooterId": "",\n "evenPageHeaderId": "",\n "firstPageFooterId": "",\n "firstPageHeaderId": "",\n "marginBottom": {},\n "marginFooter": {},\n "marginHeader": {},\n "marginLeft": {},\n "marginRight": {},\n "marginTop": {},\n "pageNumberStart": 0,\n "pageSize": {\n "height": {},\n "width": {}\n },\n "useCustomHeaderFooterMargins": false,\n "useEvenPageHeaderFooter": false,\n "useFirstPageHeaderFooter": false\n },\n "footers": {},\n "footnotes": {},\n "headers": {},\n "inlineObjects": {},\n "lists": {},\n "namedRanges": {},\n "namedStyles": {\n "styles": [\n {\n "namedStyleType": "",\n "paragraphStyle": {},\n "textStyle": {}\n }\n ]\n },\n "positionedObjects": {},\n "revisionId": "",\n "suggestedDocumentStyleChanges": {},\n "suggestedNamedStylesChanges": {},\n "suggestionsViewMode": "",\n "title": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/documents")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/documents',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
body: {
content: [
{
endIndex: 0,
paragraph: {
bullet: {
listId: '',
nestingLevel: 0,
textStyle: {
backgroundColor: {color: {rgbColor: {blue: '', green: '', red: ''}}},
baselineOffset: '',
bold: false,
fontSize: {magnitude: '', unit: ''},
foregroundColor: {},
italic: false,
link: {bookmarkId: '', headingId: '', url: ''},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {fontFamily: '', weight: 0}
}
},
elements: [
{
autoText: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {},
type: ''
},
columnBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
endIndex: 0,
equation: {suggestedDeletionIds: [], suggestedInsertionIds: []},
footnoteReference: {
footnoteId: '',
footnoteNumber: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
horizontalRule: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
inlineObjectElement: {
inlineObjectId: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
pageBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
person: {
personId: '',
personProperties: {email: '', name: ''},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
richLink: {
richLinkId: '',
richLinkProperties: {mimeType: '', title: '', uri: ''},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
startIndex: 0,
textRun: {
content: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
}
}
],
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {color: {}, dashStyle: '', padding: {}, width: {}},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {backgroundColor: {}},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [{alignment: '', offset: {}}]
},
positionedObjectIds: [],
suggestedBulletChanges: {},
suggestedParagraphStyleChanges: {},
suggestedPositionedObjectIds: {}
},
sectionBreak: {
sectionStyle: {
columnProperties: [{paddingEnd: {}, width: {}}],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
},
suggestedDeletionIds: [],
suggestedInsertionIds: []
},
startIndex: 0,
table: {
columns: 0,
rows: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
tableRows: [
{
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableRowStyleChanges: {},
tableCells: [
{
content: [],
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableCellStyleChanges: {},
tableCellStyle: {
backgroundColor: {},
borderBottom: {color: {}, dashStyle: '', width: {}},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
}
}
],
tableRowStyle: {minRowHeight: {}, preventOverflow: false, tableHeader: false}
}
],
tableStyle: {tableColumnProperties: [{width: {}, widthType: ''}]}
},
tableOfContents: {content: [], suggestedDeletionIds: [], suggestedInsertionIds: []}
}
]
},
documentId: '',
documentStyle: {
background: {color: {}},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {height: {}, width: {}},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
footers: {},
footnotes: {},
headers: {},
inlineObjects: {},
lists: {},
namedRanges: {},
namedStyles: {styles: [{namedStyleType: '', paragraphStyle: {}, textStyle: {}}]},
positionedObjects: {},
revisionId: '',
suggestedDocumentStyleChanges: {},
suggestedNamedStylesChanges: {},
suggestionsViewMode: '',
title: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/documents',
headers: {'content-type': 'application/json'},
body: {
body: {
content: [
{
endIndex: 0,
paragraph: {
bullet: {
listId: '',
nestingLevel: 0,
textStyle: {
backgroundColor: {color: {rgbColor: {blue: '', green: '', red: ''}}},
baselineOffset: '',
bold: false,
fontSize: {magnitude: '', unit: ''},
foregroundColor: {},
italic: false,
link: {bookmarkId: '', headingId: '', url: ''},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {fontFamily: '', weight: 0}
}
},
elements: [
{
autoText: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {},
type: ''
},
columnBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
endIndex: 0,
equation: {suggestedDeletionIds: [], suggestedInsertionIds: []},
footnoteReference: {
footnoteId: '',
footnoteNumber: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
horizontalRule: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
inlineObjectElement: {
inlineObjectId: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
pageBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
person: {
personId: '',
personProperties: {email: '', name: ''},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
richLink: {
richLinkId: '',
richLinkProperties: {mimeType: '', title: '', uri: ''},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
startIndex: 0,
textRun: {
content: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
}
}
],
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {color: {}, dashStyle: '', padding: {}, width: {}},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {backgroundColor: {}},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [{alignment: '', offset: {}}]
},
positionedObjectIds: [],
suggestedBulletChanges: {},
suggestedParagraphStyleChanges: {},
suggestedPositionedObjectIds: {}
},
sectionBreak: {
sectionStyle: {
columnProperties: [{paddingEnd: {}, width: {}}],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
},
suggestedDeletionIds: [],
suggestedInsertionIds: []
},
startIndex: 0,
table: {
columns: 0,
rows: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
tableRows: [
{
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableRowStyleChanges: {},
tableCells: [
{
content: [],
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableCellStyleChanges: {},
tableCellStyle: {
backgroundColor: {},
borderBottom: {color: {}, dashStyle: '', width: {}},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
}
}
],
tableRowStyle: {minRowHeight: {}, preventOverflow: false, tableHeader: false}
}
],
tableStyle: {tableColumnProperties: [{width: {}, widthType: ''}]}
},
tableOfContents: {content: [], suggestedDeletionIds: [], suggestedInsertionIds: []}
}
]
},
documentId: '',
documentStyle: {
background: {color: {}},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {height: {}, width: {}},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
footers: {},
footnotes: {},
headers: {},
inlineObjects: {},
lists: {},
namedRanges: {},
namedStyles: {styles: [{namedStyleType: '', paragraphStyle: {}, textStyle: {}}]},
positionedObjects: {},
revisionId: '',
suggestedDocumentStyleChanges: {},
suggestedNamedStylesChanges: {},
suggestionsViewMode: '',
title: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/documents');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
body: {
content: [
{
endIndex: 0,
paragraph: {
bullet: {
listId: '',
nestingLevel: 0,
textStyle: {
backgroundColor: {
color: {
rgbColor: {
blue: '',
green: '',
red: ''
}
}
},
baselineOffset: '',
bold: false,
fontSize: {
magnitude: '',
unit: ''
},
foregroundColor: {},
italic: false,
link: {
bookmarkId: '',
headingId: '',
url: ''
},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {
fontFamily: '',
weight: 0
}
}
},
elements: [
{
autoText: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {},
type: ''
},
columnBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
endIndex: 0,
equation: {
suggestedDeletionIds: [],
suggestedInsertionIds: []
},
footnoteReference: {
footnoteId: '',
footnoteNumber: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
horizontalRule: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
inlineObjectElement: {
inlineObjectId: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
pageBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
person: {
personId: '',
personProperties: {
email: '',
name: ''
},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
richLink: {
richLinkId: '',
richLinkProperties: {
mimeType: '',
title: '',
uri: ''
},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
startIndex: 0,
textRun: {
content: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
}
}
],
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {
color: {},
dashStyle: '',
padding: {},
width: {}
},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {
backgroundColor: {}
},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [
{
alignment: '',
offset: {}
}
]
},
positionedObjectIds: [],
suggestedBulletChanges: {},
suggestedParagraphStyleChanges: {},
suggestedPositionedObjectIds: {}
},
sectionBreak: {
sectionStyle: {
columnProperties: [
{
paddingEnd: {},
width: {}
}
],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
},
suggestedDeletionIds: [],
suggestedInsertionIds: []
},
startIndex: 0,
table: {
columns: 0,
rows: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
tableRows: [
{
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableRowStyleChanges: {},
tableCells: [
{
content: [],
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableCellStyleChanges: {},
tableCellStyle: {
backgroundColor: {},
borderBottom: {
color: {},
dashStyle: '',
width: {}
},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
}
}
],
tableRowStyle: {
minRowHeight: {},
preventOverflow: false,
tableHeader: false
}
}
],
tableStyle: {
tableColumnProperties: [
{
width: {},
widthType: ''
}
]
}
},
tableOfContents: {
content: [],
suggestedDeletionIds: [],
suggestedInsertionIds: []
}
}
]
},
documentId: '',
documentStyle: {
background: {
color: {}
},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {
height: {},
width: {}
},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
footers: {},
footnotes: {},
headers: {},
inlineObjects: {},
lists: {},
namedRanges: {},
namedStyles: {
styles: [
{
namedStyleType: '',
paragraphStyle: {},
textStyle: {}
}
]
},
positionedObjects: {},
revisionId: '',
suggestedDocumentStyleChanges: {},
suggestedNamedStylesChanges: {},
suggestionsViewMode: '',
title: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/documents',
headers: {'content-type': 'application/json'},
data: {
body: {
content: [
{
endIndex: 0,
paragraph: {
bullet: {
listId: '',
nestingLevel: 0,
textStyle: {
backgroundColor: {color: {rgbColor: {blue: '', green: '', red: ''}}},
baselineOffset: '',
bold: false,
fontSize: {magnitude: '', unit: ''},
foregroundColor: {},
italic: false,
link: {bookmarkId: '', headingId: '', url: ''},
smallCaps: false,
strikethrough: false,
underline: false,
weightedFontFamily: {fontFamily: '', weight: 0}
}
},
elements: [
{
autoText: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {},
type: ''
},
columnBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
endIndex: 0,
equation: {suggestedDeletionIds: [], suggestedInsertionIds: []},
footnoteReference: {
footnoteId: '',
footnoteNumber: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
horizontalRule: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
inlineObjectElement: {
inlineObjectId: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
pageBreak: {
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
person: {
personId: '',
personProperties: {email: '', name: ''},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
richLink: {
richLinkId: '',
richLinkProperties: {mimeType: '', title: '', uri: ''},
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
},
startIndex: 0,
textRun: {
content: '',
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTextStyleChanges: {},
textStyle: {}
}
}
],
paragraphStyle: {
alignment: '',
avoidWidowAndOrphan: false,
borderBetween: {color: {}, dashStyle: '', padding: {}, width: {}},
borderBottom: {},
borderLeft: {},
borderRight: {},
borderTop: {},
direction: '',
headingId: '',
indentEnd: {},
indentFirstLine: {},
indentStart: {},
keepLinesTogether: false,
keepWithNext: false,
lineSpacing: '',
namedStyleType: '',
pageBreakBefore: false,
shading: {backgroundColor: {}},
spaceAbove: {},
spaceBelow: {},
spacingMode: '',
tabStops: [{alignment: '', offset: {}}]
},
positionedObjectIds: [],
suggestedBulletChanges: {},
suggestedParagraphStyleChanges: {},
suggestedPositionedObjectIds: {}
},
sectionBreak: {
sectionStyle: {
columnProperties: [{paddingEnd: {}, width: {}}],
columnSeparatorStyle: '',
contentDirection: '',
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
sectionType: '',
useFirstPageHeaderFooter: false
},
suggestedDeletionIds: [],
suggestedInsertionIds: []
},
startIndex: 0,
table: {
columns: 0,
rows: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
tableRows: [
{
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableRowStyleChanges: {},
tableCells: [
{
content: [],
endIndex: 0,
startIndex: 0,
suggestedDeletionIds: [],
suggestedInsertionIds: [],
suggestedTableCellStyleChanges: {},
tableCellStyle: {
backgroundColor: {},
borderBottom: {color: {}, dashStyle: '', width: {}},
borderLeft: {},
borderRight: {},
borderTop: {},
columnSpan: 0,
contentAlignment: '',
paddingBottom: {},
paddingLeft: {},
paddingRight: {},
paddingTop: {},
rowSpan: 0
}
}
],
tableRowStyle: {minRowHeight: {}, preventOverflow: false, tableHeader: false}
}
],
tableStyle: {tableColumnProperties: [{width: {}, widthType: ''}]}
},
tableOfContents: {content: [], suggestedDeletionIds: [], suggestedInsertionIds: []}
}
]
},
documentId: '',
documentStyle: {
background: {color: {}},
defaultFooterId: '',
defaultHeaderId: '',
evenPageFooterId: '',
evenPageHeaderId: '',
firstPageFooterId: '',
firstPageHeaderId: '',
marginBottom: {},
marginFooter: {},
marginHeader: {},
marginLeft: {},
marginRight: {},
marginTop: {},
pageNumberStart: 0,
pageSize: {height: {}, width: {}},
useCustomHeaderFooterMargins: false,
useEvenPageHeaderFooter: false,
useFirstPageHeaderFooter: false
},
footers: {},
footnotes: {},
headers: {},
inlineObjects: {},
lists: {},
namedRanges: {},
namedStyles: {styles: [{namedStyleType: '', paragraphStyle: {}, textStyle: {}}]},
positionedObjects: {},
revisionId: '',
suggestedDocumentStyleChanges: {},
suggestedNamedStylesChanges: {},
suggestionsViewMode: '',
title: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/documents';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"body":{"content":[{"endIndex":0,"paragraph":{"bullet":{"listId":"","nestingLevel":0,"textStyle":{"backgroundColor":{"color":{"rgbColor":{"blue":"","green":"","red":""}}},"baselineOffset":"","bold":false,"fontSize":{"magnitude":"","unit":""},"foregroundColor":{},"italic":false,"link":{"bookmarkId":"","headingId":"","url":""},"smallCaps":false,"strikethrough":false,"underline":false,"weightedFontFamily":{"fontFamily":"","weight":0}}},"elements":[{"autoText":{"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{},"type":""},"columnBreak":{"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"endIndex":0,"equation":{"suggestedDeletionIds":[],"suggestedInsertionIds":[]},"footnoteReference":{"footnoteId":"","footnoteNumber":"","suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"horizontalRule":{"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"inlineObjectElement":{"inlineObjectId":"","suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"pageBreak":{"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"person":{"personId":"","personProperties":{"email":"","name":""},"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"richLink":{"richLinkId":"","richLinkProperties":{"mimeType":"","title":"","uri":""},"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}},"startIndex":0,"textRun":{"content":"","suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTextStyleChanges":{},"textStyle":{}}}],"paragraphStyle":{"alignment":"","avoidWidowAndOrphan":false,"borderBetween":{"color":{},"dashStyle":"","padding":{},"width":{}},"borderBottom":{},"borderLeft":{},"borderRight":{},"borderTop":{},"direction":"","headingId":"","indentEnd":{},"indentFirstLine":{},"indentStart":{},"keepLinesTogether":false,"keepWithNext":false,"lineSpacing":"","namedStyleType":"","pageBreakBefore":false,"shading":{"backgroundColor":{}},"spaceAbove":{},"spaceBelow":{},"spacingMode":"","tabStops":[{"alignment":"","offset":{}}]},"positionedObjectIds":[],"suggestedBulletChanges":{},"suggestedParagraphStyleChanges":{},"suggestedPositionedObjectIds":{}},"sectionBreak":{"sectionStyle":{"columnProperties":[{"paddingEnd":{},"width":{}}],"columnSeparatorStyle":"","contentDirection":"","defaultFooterId":"","defaultHeaderId":"","evenPageFooterId":"","evenPageHeaderId":"","firstPageFooterId":"","firstPageHeaderId":"","marginBottom":{},"marginFooter":{},"marginHeader":{},"marginLeft":{},"marginRight":{},"marginTop":{},"pageNumberStart":0,"sectionType":"","useFirstPageHeaderFooter":false},"suggestedDeletionIds":[],"suggestedInsertionIds":[]},"startIndex":0,"table":{"columns":0,"rows":0,"suggestedDeletionIds":[],"suggestedInsertionIds":[],"tableRows":[{"endIndex":0,"startIndex":0,"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTableRowStyleChanges":{},"tableCells":[{"content":[],"endIndex":0,"startIndex":0,"suggestedDeletionIds":[],"suggestedInsertionIds":[],"suggestedTableCellStyleChanges":{},"tableCellStyle":{"backgroundColor":{},"borderBottom":{"color":{},"dashStyle":"","width":{}},"borderLeft":{},"borderRight":{},"borderTop":{},"columnSpan":0,"contentAlignment":"","paddingBottom":{},"paddingLeft":{},"paddingRight":{},"paddingTop":{},"rowSpan":0}}],"tableRowStyle":{"minRowHeight":{},"preventOverflow":false,"tableHeader":false}}],"tableStyle":{"tableColumnProperties":[{"width":{},"widthType":""}]}},"tableOfContents":{"content":[],"suggestedDeletionIds":[],"suggestedInsertionIds":[]}}]},"documentId":"","documentStyle":{"background":{"color":{}},"defaultFooterId":"","defaultHeaderId":"","evenPageFooterId":"","evenPageHeaderId":"","firstPageFooterId":"","firstPageHeaderId":"","marginBottom":{},"marginFooter":{},"marginHeader":{},"marginLeft":{},"marginRight":{},"marginTop":{},"pageNumberStart":0,"pageSize":{"height":{},"width":{}},"useCustomHeaderFooterMargins":false,"useEvenPageHeaderFooter":false,"useFirstPageHeaderFooter":false},"footers":{},"footnotes":{},"headers":{},"inlineObjects":{},"lists":{},"namedRanges":{},"namedStyles":{"styles":[{"namedStyleType":"","paragraphStyle":{},"textStyle":{}}]},"positionedObjects":{},"revisionId":"","suggestedDocumentStyleChanges":{},"suggestedNamedStylesChanges":{},"suggestionsViewMode":"","title":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"body": @{ @"content": @[ @{ @"endIndex": @0, @"paragraph": @{ @"bullet": @{ @"listId": @"", @"nestingLevel": @0, @"textStyle": @{ @"backgroundColor": @{ @"color": @{ @"rgbColor": @{ @"blue": @"", @"green": @"", @"red": @"" } } }, @"baselineOffset": @"", @"bold": @NO, @"fontSize": @{ @"magnitude": @"", @"unit": @"" }, @"foregroundColor": @{ }, @"italic": @NO, @"link": @{ @"bookmarkId": @"", @"headingId": @"", @"url": @"" }, @"smallCaps": @NO, @"strikethrough": @NO, @"underline": @NO, @"weightedFontFamily": @{ @"fontFamily": @"", @"weight": @0 } } }, @"elements": @[ @{ @"autoText": @{ @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTextStyleChanges": @{ }, @"textStyle": @{ }, @"type": @"" }, @"columnBreak": @{ @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTextStyleChanges": @{ }, @"textStyle": @{ } }, @"endIndex": @0, @"equation": @{ @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ] }, @"footnoteReference": @{ @"footnoteId": @"", @"footnoteNumber": @"", @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTextStyleChanges": @{ }, @"textStyle": @{ } }, @"horizontalRule": @{ @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTextStyleChanges": @{ }, @"textStyle": @{ } }, @"inlineObjectElement": @{ @"inlineObjectId": @"", @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTextStyleChanges": @{ }, @"textStyle": @{ } }, @"pageBreak": @{ @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTextStyleChanges": @{ }, @"textStyle": @{ } }, @"person": @{ @"personId": @"", @"personProperties": @{ @"email": @"", @"name": @"" }, @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTextStyleChanges": @{ }, @"textStyle": @{ } }, @"richLink": @{ @"richLinkId": @"", @"richLinkProperties": @{ @"mimeType": @"", @"title": @"", @"uri": @"" }, @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTextStyleChanges": @{ }, @"textStyle": @{ } }, @"startIndex": @0, @"textRun": @{ @"content": @"", @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTextStyleChanges": @{ }, @"textStyle": @{ } } } ], @"paragraphStyle": @{ @"alignment": @"", @"avoidWidowAndOrphan": @NO, @"borderBetween": @{ @"color": @{ }, @"dashStyle": @"", @"padding": @{ }, @"width": @{ } }, @"borderBottom": @{ }, @"borderLeft": @{ }, @"borderRight": @{ }, @"borderTop": @{ }, @"direction": @"", @"headingId": @"", @"indentEnd": @{ }, @"indentFirstLine": @{ }, @"indentStart": @{ }, @"keepLinesTogether": @NO, @"keepWithNext": @NO, @"lineSpacing": @"", @"namedStyleType": @"", @"pageBreakBefore": @NO, @"shading": @{ @"backgroundColor": @{ } }, @"spaceAbove": @{ }, @"spaceBelow": @{ }, @"spacingMode": @"", @"tabStops": @[ @{ @"alignment": @"", @"offset": @{ } } ] }, @"positionedObjectIds": @[ ], @"suggestedBulletChanges": @{ }, @"suggestedParagraphStyleChanges": @{ }, @"suggestedPositionedObjectIds": @{ } }, @"sectionBreak": @{ @"sectionStyle": @{ @"columnProperties": @[ @{ @"paddingEnd": @{ }, @"width": @{ } } ], @"columnSeparatorStyle": @"", @"contentDirection": @"", @"defaultFooterId": @"", @"defaultHeaderId": @"", @"evenPageFooterId": @"", @"evenPageHeaderId": @"", @"firstPageFooterId": @"", @"firstPageHeaderId": @"", @"marginBottom": @{ }, @"marginFooter": @{ }, @"marginHeader": @{ }, @"marginLeft": @{ }, @"marginRight": @{ }, @"marginTop": @{ }, @"pageNumberStart": @0, @"sectionType": @"", @"useFirstPageHeaderFooter": @NO }, @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ] }, @"startIndex": @0, @"table": @{ @"columns": @0, @"rows": @0, @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"tableRows": @[ @{ @"endIndex": @0, @"startIndex": @0, @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTableRowStyleChanges": @{ }, @"tableCells": @[ @{ @"content": @[ ], @"endIndex": @0, @"startIndex": @0, @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ], @"suggestedTableCellStyleChanges": @{ }, @"tableCellStyle": @{ @"backgroundColor": @{ }, @"borderBottom": @{ @"color": @{ }, @"dashStyle": @"", @"width": @{ } }, @"borderLeft": @{ }, @"borderRight": @{ }, @"borderTop": @{ }, @"columnSpan": @0, @"contentAlignment": @"", @"paddingBottom": @{ }, @"paddingLeft": @{ }, @"paddingRight": @{ }, @"paddingTop": @{ }, @"rowSpan": @0 } } ], @"tableRowStyle": @{ @"minRowHeight": @{ }, @"preventOverflow": @NO, @"tableHeader": @NO } } ], @"tableStyle": @{ @"tableColumnProperties": @[ @{ @"width": @{ }, @"widthType": @"" } ] } }, @"tableOfContents": @{ @"content": @[ ], @"suggestedDeletionIds": @[ ], @"suggestedInsertionIds": @[ ] } } ] },
@"documentId": @"",
@"documentStyle": @{ @"background": @{ @"color": @{ } }, @"defaultFooterId": @"", @"defaultHeaderId": @"", @"evenPageFooterId": @"", @"evenPageHeaderId": @"", @"firstPageFooterId": @"", @"firstPageHeaderId": @"", @"marginBottom": @{ }, @"marginFooter": @{ }, @"marginHeader": @{ }, @"marginLeft": @{ }, @"marginRight": @{ }, @"marginTop": @{ }, @"pageNumberStart": @0, @"pageSize": @{ @"height": @{ }, @"width": @{ } }, @"useCustomHeaderFooterMargins": @NO, @"useEvenPageHeaderFooter": @NO, @"useFirstPageHeaderFooter": @NO },
@"footers": @{ },
@"footnotes": @{ },
@"headers": @{ },
@"inlineObjects": @{ },
@"lists": @{ },
@"namedRanges": @{ },
@"namedStyles": @{ @"styles": @[ @{ @"namedStyleType": @"", @"paragraphStyle": @{ }, @"textStyle": @{ } } ] },
@"positionedObjects": @{ },
@"revisionId": @"",
@"suggestedDocumentStyleChanges": @{ },
@"suggestedNamedStylesChanges": @{ },
@"suggestionsViewMode": @"",
@"title": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/documents"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/documents" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'body' => [
'content' => [
[
'endIndex' => 0,
'paragraph' => [
'bullet' => [
'listId' => '',
'nestingLevel' => 0,
'textStyle' => [
'backgroundColor' => [
'color' => [
'rgbColor' => [
'blue' => '',
'green' => '',
'red' => ''
]
]
],
'baselineOffset' => '',
'bold' => null,
'fontSize' => [
'magnitude' => '',
'unit' => ''
],
'foregroundColor' => [
],
'italic' => null,
'link' => [
'bookmarkId' => '',
'headingId' => '',
'url' => ''
],
'smallCaps' => null,
'strikethrough' => null,
'underline' => null,
'weightedFontFamily' => [
'fontFamily' => '',
'weight' => 0
]
]
],
'elements' => [
[
'autoText' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
],
'type' => ''
],
'columnBreak' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'endIndex' => 0,
'equation' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
]
],
'footnoteReference' => [
'footnoteId' => '',
'footnoteNumber' => '',
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'horizontalRule' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'inlineObjectElement' => [
'inlineObjectId' => '',
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'pageBreak' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'person' => [
'personId' => '',
'personProperties' => [
'email' => '',
'name' => ''
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'richLink' => [
'richLinkId' => '',
'richLinkProperties' => [
'mimeType' => '',
'title' => '',
'uri' => ''
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'startIndex' => 0,
'textRun' => [
'content' => '',
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
]
]
],
'paragraphStyle' => [
'alignment' => '',
'avoidWidowAndOrphan' => null,
'borderBetween' => [
'color' => [
],
'dashStyle' => '',
'padding' => [
],
'width' => [
]
],
'borderBottom' => [
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'direction' => '',
'headingId' => '',
'indentEnd' => [
],
'indentFirstLine' => [
],
'indentStart' => [
],
'keepLinesTogether' => null,
'keepWithNext' => null,
'lineSpacing' => '',
'namedStyleType' => '',
'pageBreakBefore' => null,
'shading' => [
'backgroundColor' => [
]
],
'spaceAbove' => [
],
'spaceBelow' => [
],
'spacingMode' => '',
'tabStops' => [
[
'alignment' => '',
'offset' => [
]
]
]
],
'positionedObjectIds' => [
],
'suggestedBulletChanges' => [
],
'suggestedParagraphStyleChanges' => [
],
'suggestedPositionedObjectIds' => [
]
],
'sectionBreak' => [
'sectionStyle' => [
'columnProperties' => [
[
'paddingEnd' => [
],
'width' => [
]
]
],
'columnSeparatorStyle' => '',
'contentDirection' => '',
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'sectionType' => '',
'useFirstPageHeaderFooter' => null
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
]
],
'startIndex' => 0,
'table' => [
'columns' => 0,
'rows' => 0,
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'tableRows' => [
[
'endIndex' => 0,
'startIndex' => 0,
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTableRowStyleChanges' => [
],
'tableCells' => [
[
'content' => [
],
'endIndex' => 0,
'startIndex' => 0,
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTableCellStyleChanges' => [
],
'tableCellStyle' => [
'backgroundColor' => [
],
'borderBottom' => [
'color' => [
],
'dashStyle' => '',
'width' => [
]
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'columnSpan' => 0,
'contentAlignment' => '',
'paddingBottom' => [
],
'paddingLeft' => [
],
'paddingRight' => [
],
'paddingTop' => [
],
'rowSpan' => 0
]
]
],
'tableRowStyle' => [
'minRowHeight' => [
],
'preventOverflow' => null,
'tableHeader' => null
]
]
],
'tableStyle' => [
'tableColumnProperties' => [
[
'width' => [
],
'widthType' => ''
]
]
]
],
'tableOfContents' => [
'content' => [
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
]
]
]
]
],
'documentId' => '',
'documentStyle' => [
'background' => [
'color' => [
]
],
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'pageSize' => [
'height' => [
],
'width' => [
]
],
'useCustomHeaderFooterMargins' => null,
'useEvenPageHeaderFooter' => null,
'useFirstPageHeaderFooter' => null
],
'footers' => [
],
'footnotes' => [
],
'headers' => [
],
'inlineObjects' => [
],
'lists' => [
],
'namedRanges' => [
],
'namedStyles' => [
'styles' => [
[
'namedStyleType' => '',
'paragraphStyle' => [
],
'textStyle' => [
]
]
]
],
'positionedObjects' => [
],
'revisionId' => '',
'suggestedDocumentStyleChanges' => [
],
'suggestedNamedStylesChanges' => [
],
'suggestionsViewMode' => '',
'title' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/documents', [
'body' => '{
"body": {
"content": [
{
"endIndex": 0,
"paragraph": {
"bullet": {
"listId": "",
"nestingLevel": 0,
"textStyle": {
"backgroundColor": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
},
"baselineOffset": "",
"bold": false,
"fontSize": {
"magnitude": "",
"unit": ""
},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
},
"elements": [
{
"autoText": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {},
"type": ""
},
"columnBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"endIndex": 0,
"equation": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"footnoteReference": {
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"horizontalRule": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"inlineObjectElement": {
"inlineObjectId": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"pageBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"person": {
"personId": "",
"personProperties": {
"email": "",
"name": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"richLink": {
"richLinkId": "",
"richLinkProperties": {
"mimeType": "",
"title": "",
"uri": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"startIndex": 0,
"textRun": {
"content": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
}
}
],
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"positionedObjectIds": [],
"suggestedBulletChanges": {},
"suggestedParagraphStyleChanges": {},
"suggestedPositionedObjectIds": {}
},
"sectionBreak": {
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"startIndex": 0,
"table": {
"columns": 0,
"rows": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"tableRows": [
{
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableRowStyleChanges": {},
"tableCells": [
{
"content": [],
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableCellStyleChanges": {},
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
}
}
],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
}
}
],
"tableStyle": {
"tableColumnProperties": [
{
"width": {},
"widthType": ""
}
]
}
},
"tableOfContents": {
"content": [],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
}
}
]
},
"documentId": "",
"documentStyle": {
"background": {
"color": {}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {
"height": {},
"width": {}
},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"footers": {},
"footnotes": {},
"headers": {},
"inlineObjects": {},
"lists": {},
"namedRanges": {},
"namedStyles": {
"styles": [
{
"namedStyleType": "",
"paragraphStyle": {},
"textStyle": {}
}
]
},
"positionedObjects": {},
"revisionId": "",
"suggestedDocumentStyleChanges": {},
"suggestedNamedStylesChanges": {},
"suggestionsViewMode": "",
"title": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/documents');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'body' => [
'content' => [
[
'endIndex' => 0,
'paragraph' => [
'bullet' => [
'listId' => '',
'nestingLevel' => 0,
'textStyle' => [
'backgroundColor' => [
'color' => [
'rgbColor' => [
'blue' => '',
'green' => '',
'red' => ''
]
]
],
'baselineOffset' => '',
'bold' => null,
'fontSize' => [
'magnitude' => '',
'unit' => ''
],
'foregroundColor' => [
],
'italic' => null,
'link' => [
'bookmarkId' => '',
'headingId' => '',
'url' => ''
],
'smallCaps' => null,
'strikethrough' => null,
'underline' => null,
'weightedFontFamily' => [
'fontFamily' => '',
'weight' => 0
]
]
],
'elements' => [
[
'autoText' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
],
'type' => ''
],
'columnBreak' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'endIndex' => 0,
'equation' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
]
],
'footnoteReference' => [
'footnoteId' => '',
'footnoteNumber' => '',
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'horizontalRule' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'inlineObjectElement' => [
'inlineObjectId' => '',
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'pageBreak' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'person' => [
'personId' => '',
'personProperties' => [
'email' => '',
'name' => ''
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'richLink' => [
'richLinkId' => '',
'richLinkProperties' => [
'mimeType' => '',
'title' => '',
'uri' => ''
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'startIndex' => 0,
'textRun' => [
'content' => '',
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
]
]
],
'paragraphStyle' => [
'alignment' => '',
'avoidWidowAndOrphan' => null,
'borderBetween' => [
'color' => [
],
'dashStyle' => '',
'padding' => [
],
'width' => [
]
],
'borderBottom' => [
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'direction' => '',
'headingId' => '',
'indentEnd' => [
],
'indentFirstLine' => [
],
'indentStart' => [
],
'keepLinesTogether' => null,
'keepWithNext' => null,
'lineSpacing' => '',
'namedStyleType' => '',
'pageBreakBefore' => null,
'shading' => [
'backgroundColor' => [
]
],
'spaceAbove' => [
],
'spaceBelow' => [
],
'spacingMode' => '',
'tabStops' => [
[
'alignment' => '',
'offset' => [
]
]
]
],
'positionedObjectIds' => [
],
'suggestedBulletChanges' => [
],
'suggestedParagraphStyleChanges' => [
],
'suggestedPositionedObjectIds' => [
]
],
'sectionBreak' => [
'sectionStyle' => [
'columnProperties' => [
[
'paddingEnd' => [
],
'width' => [
]
]
],
'columnSeparatorStyle' => '',
'contentDirection' => '',
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'sectionType' => '',
'useFirstPageHeaderFooter' => null
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
]
],
'startIndex' => 0,
'table' => [
'columns' => 0,
'rows' => 0,
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'tableRows' => [
[
'endIndex' => 0,
'startIndex' => 0,
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTableRowStyleChanges' => [
],
'tableCells' => [
[
'content' => [
],
'endIndex' => 0,
'startIndex' => 0,
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTableCellStyleChanges' => [
],
'tableCellStyle' => [
'backgroundColor' => [
],
'borderBottom' => [
'color' => [
],
'dashStyle' => '',
'width' => [
]
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'columnSpan' => 0,
'contentAlignment' => '',
'paddingBottom' => [
],
'paddingLeft' => [
],
'paddingRight' => [
],
'paddingTop' => [
],
'rowSpan' => 0
]
]
],
'tableRowStyle' => [
'minRowHeight' => [
],
'preventOverflow' => null,
'tableHeader' => null
]
]
],
'tableStyle' => [
'tableColumnProperties' => [
[
'width' => [
],
'widthType' => ''
]
]
]
],
'tableOfContents' => [
'content' => [
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
]
]
]
]
],
'documentId' => '',
'documentStyle' => [
'background' => [
'color' => [
]
],
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'pageSize' => [
'height' => [
],
'width' => [
]
],
'useCustomHeaderFooterMargins' => null,
'useEvenPageHeaderFooter' => null,
'useFirstPageHeaderFooter' => null
],
'footers' => [
],
'footnotes' => [
],
'headers' => [
],
'inlineObjects' => [
],
'lists' => [
],
'namedRanges' => [
],
'namedStyles' => [
'styles' => [
[
'namedStyleType' => '',
'paragraphStyle' => [
],
'textStyle' => [
]
]
]
],
'positionedObjects' => [
],
'revisionId' => '',
'suggestedDocumentStyleChanges' => [
],
'suggestedNamedStylesChanges' => [
],
'suggestionsViewMode' => '',
'title' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'body' => [
'content' => [
[
'endIndex' => 0,
'paragraph' => [
'bullet' => [
'listId' => '',
'nestingLevel' => 0,
'textStyle' => [
'backgroundColor' => [
'color' => [
'rgbColor' => [
'blue' => '',
'green' => '',
'red' => ''
]
]
],
'baselineOffset' => '',
'bold' => null,
'fontSize' => [
'magnitude' => '',
'unit' => ''
],
'foregroundColor' => [
],
'italic' => null,
'link' => [
'bookmarkId' => '',
'headingId' => '',
'url' => ''
],
'smallCaps' => null,
'strikethrough' => null,
'underline' => null,
'weightedFontFamily' => [
'fontFamily' => '',
'weight' => 0
]
]
],
'elements' => [
[
'autoText' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
],
'type' => ''
],
'columnBreak' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'endIndex' => 0,
'equation' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
]
],
'footnoteReference' => [
'footnoteId' => '',
'footnoteNumber' => '',
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'horizontalRule' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'inlineObjectElement' => [
'inlineObjectId' => '',
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'pageBreak' => [
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'person' => [
'personId' => '',
'personProperties' => [
'email' => '',
'name' => ''
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'richLink' => [
'richLinkId' => '',
'richLinkProperties' => [
'mimeType' => '',
'title' => '',
'uri' => ''
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
],
'startIndex' => 0,
'textRun' => [
'content' => '',
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTextStyleChanges' => [
],
'textStyle' => [
]
]
]
],
'paragraphStyle' => [
'alignment' => '',
'avoidWidowAndOrphan' => null,
'borderBetween' => [
'color' => [
],
'dashStyle' => '',
'padding' => [
],
'width' => [
]
],
'borderBottom' => [
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'direction' => '',
'headingId' => '',
'indentEnd' => [
],
'indentFirstLine' => [
],
'indentStart' => [
],
'keepLinesTogether' => null,
'keepWithNext' => null,
'lineSpacing' => '',
'namedStyleType' => '',
'pageBreakBefore' => null,
'shading' => [
'backgroundColor' => [
]
],
'spaceAbove' => [
],
'spaceBelow' => [
],
'spacingMode' => '',
'tabStops' => [
[
'alignment' => '',
'offset' => [
]
]
]
],
'positionedObjectIds' => [
],
'suggestedBulletChanges' => [
],
'suggestedParagraphStyleChanges' => [
],
'suggestedPositionedObjectIds' => [
]
],
'sectionBreak' => [
'sectionStyle' => [
'columnProperties' => [
[
'paddingEnd' => [
],
'width' => [
]
]
],
'columnSeparatorStyle' => '',
'contentDirection' => '',
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'sectionType' => '',
'useFirstPageHeaderFooter' => null
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
]
],
'startIndex' => 0,
'table' => [
'columns' => 0,
'rows' => 0,
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'tableRows' => [
[
'endIndex' => 0,
'startIndex' => 0,
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTableRowStyleChanges' => [
],
'tableCells' => [
[
'content' => [
],
'endIndex' => 0,
'startIndex' => 0,
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
],
'suggestedTableCellStyleChanges' => [
],
'tableCellStyle' => [
'backgroundColor' => [
],
'borderBottom' => [
'color' => [
],
'dashStyle' => '',
'width' => [
]
],
'borderLeft' => [
],
'borderRight' => [
],
'borderTop' => [
],
'columnSpan' => 0,
'contentAlignment' => '',
'paddingBottom' => [
],
'paddingLeft' => [
],
'paddingRight' => [
],
'paddingTop' => [
],
'rowSpan' => 0
]
]
],
'tableRowStyle' => [
'minRowHeight' => [
],
'preventOverflow' => null,
'tableHeader' => null
]
]
],
'tableStyle' => [
'tableColumnProperties' => [
[
'width' => [
],
'widthType' => ''
]
]
]
],
'tableOfContents' => [
'content' => [
],
'suggestedDeletionIds' => [
],
'suggestedInsertionIds' => [
]
]
]
]
],
'documentId' => '',
'documentStyle' => [
'background' => [
'color' => [
]
],
'defaultFooterId' => '',
'defaultHeaderId' => '',
'evenPageFooterId' => '',
'evenPageHeaderId' => '',
'firstPageFooterId' => '',
'firstPageHeaderId' => '',
'marginBottom' => [
],
'marginFooter' => [
],
'marginHeader' => [
],
'marginLeft' => [
],
'marginRight' => [
],
'marginTop' => [
],
'pageNumberStart' => 0,
'pageSize' => [
'height' => [
],
'width' => [
]
],
'useCustomHeaderFooterMargins' => null,
'useEvenPageHeaderFooter' => null,
'useFirstPageHeaderFooter' => null
],
'footers' => [
],
'footnotes' => [
],
'headers' => [
],
'inlineObjects' => [
],
'lists' => [
],
'namedRanges' => [
],
'namedStyles' => [
'styles' => [
[
'namedStyleType' => '',
'paragraphStyle' => [
],
'textStyle' => [
]
]
]
],
'positionedObjects' => [
],
'revisionId' => '',
'suggestedDocumentStyleChanges' => [
],
'suggestedNamedStylesChanges' => [
],
'suggestionsViewMode' => '',
'title' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/documents');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/documents' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"body": {
"content": [
{
"endIndex": 0,
"paragraph": {
"bullet": {
"listId": "",
"nestingLevel": 0,
"textStyle": {
"backgroundColor": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
},
"baselineOffset": "",
"bold": false,
"fontSize": {
"magnitude": "",
"unit": ""
},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
},
"elements": [
{
"autoText": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {},
"type": ""
},
"columnBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"endIndex": 0,
"equation": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"footnoteReference": {
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"horizontalRule": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"inlineObjectElement": {
"inlineObjectId": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"pageBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"person": {
"personId": "",
"personProperties": {
"email": "",
"name": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"richLink": {
"richLinkId": "",
"richLinkProperties": {
"mimeType": "",
"title": "",
"uri": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"startIndex": 0,
"textRun": {
"content": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
}
}
],
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"positionedObjectIds": [],
"suggestedBulletChanges": {},
"suggestedParagraphStyleChanges": {},
"suggestedPositionedObjectIds": {}
},
"sectionBreak": {
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"startIndex": 0,
"table": {
"columns": 0,
"rows": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"tableRows": [
{
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableRowStyleChanges": {},
"tableCells": [
{
"content": [],
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableCellStyleChanges": {},
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
}
}
],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
}
}
],
"tableStyle": {
"tableColumnProperties": [
{
"width": {},
"widthType": ""
}
]
}
},
"tableOfContents": {
"content": [],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
}
}
]
},
"documentId": "",
"documentStyle": {
"background": {
"color": {}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {
"height": {},
"width": {}
},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"footers": {},
"footnotes": {},
"headers": {},
"inlineObjects": {},
"lists": {},
"namedRanges": {},
"namedStyles": {
"styles": [
{
"namedStyleType": "",
"paragraphStyle": {},
"textStyle": {}
}
]
},
"positionedObjects": {},
"revisionId": "",
"suggestedDocumentStyleChanges": {},
"suggestedNamedStylesChanges": {},
"suggestionsViewMode": "",
"title": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/documents' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"body": {
"content": [
{
"endIndex": 0,
"paragraph": {
"bullet": {
"listId": "",
"nestingLevel": 0,
"textStyle": {
"backgroundColor": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
},
"baselineOffset": "",
"bold": false,
"fontSize": {
"magnitude": "",
"unit": ""
},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
},
"elements": [
{
"autoText": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {},
"type": ""
},
"columnBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"endIndex": 0,
"equation": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"footnoteReference": {
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"horizontalRule": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"inlineObjectElement": {
"inlineObjectId": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"pageBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"person": {
"personId": "",
"personProperties": {
"email": "",
"name": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"richLink": {
"richLinkId": "",
"richLinkProperties": {
"mimeType": "",
"title": "",
"uri": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"startIndex": 0,
"textRun": {
"content": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
}
}
],
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"positionedObjectIds": [],
"suggestedBulletChanges": {},
"suggestedParagraphStyleChanges": {},
"suggestedPositionedObjectIds": {}
},
"sectionBreak": {
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"startIndex": 0,
"table": {
"columns": 0,
"rows": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"tableRows": [
{
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableRowStyleChanges": {},
"tableCells": [
{
"content": [],
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableCellStyleChanges": {},
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
}
}
],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
}
}
],
"tableStyle": {
"tableColumnProperties": [
{
"width": {},
"widthType": ""
}
]
}
},
"tableOfContents": {
"content": [],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
}
}
]
},
"documentId": "",
"documentStyle": {
"background": {
"color": {}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {
"height": {},
"width": {}
},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"footers": {},
"footnotes": {},
"headers": {},
"inlineObjects": {},
"lists": {},
"namedRanges": {},
"namedStyles": {
"styles": [
{
"namedStyleType": "",
"paragraphStyle": {},
"textStyle": {}
}
]
},
"positionedObjects": {},
"revisionId": "",
"suggestedDocumentStyleChanges": {},
"suggestedNamedStylesChanges": {},
"suggestionsViewMode": "",
"title": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/documents", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/documents"
payload = {
"body": { "content": [
{
"endIndex": 0,
"paragraph": {
"bullet": {
"listId": "",
"nestingLevel": 0,
"textStyle": {
"backgroundColor": { "color": { "rgbColor": {
"blue": "",
"green": "",
"red": ""
} } },
"baselineOffset": "",
"bold": False,
"fontSize": {
"magnitude": "",
"unit": ""
},
"foregroundColor": {},
"italic": False,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": False,
"strikethrough": False,
"underline": False,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
},
"elements": [
{
"autoText": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {},
"type": ""
},
"columnBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"endIndex": 0,
"equation": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"footnoteReference": {
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"horizontalRule": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"inlineObjectElement": {
"inlineObjectId": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"pageBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"person": {
"personId": "",
"personProperties": {
"email": "",
"name": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"richLink": {
"richLinkId": "",
"richLinkProperties": {
"mimeType": "",
"title": "",
"uri": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"startIndex": 0,
"textRun": {
"content": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
}
}
],
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": False,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": False,
"keepWithNext": False,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": False,
"shading": { "backgroundColor": {} },
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"positionedObjectIds": [],
"suggestedBulletChanges": {},
"suggestedParagraphStyleChanges": {},
"suggestedPositionedObjectIds": {}
},
"sectionBreak": {
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": False
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"startIndex": 0,
"table": {
"columns": 0,
"rows": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"tableRows": [
{
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableRowStyleChanges": {},
"tableCells": [
{
"content": [],
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableCellStyleChanges": {},
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
}
}
],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": False,
"tableHeader": False
}
}
],
"tableStyle": { "tableColumnProperties": [
{
"width": {},
"widthType": ""
}
] }
},
"tableOfContents": {
"content": [],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
}
}
] },
"documentId": "",
"documentStyle": {
"background": { "color": {} },
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {
"height": {},
"width": {}
},
"useCustomHeaderFooterMargins": False,
"useEvenPageHeaderFooter": False,
"useFirstPageHeaderFooter": False
},
"footers": {},
"footnotes": {},
"headers": {},
"inlineObjects": {},
"lists": {},
"namedRanges": {},
"namedStyles": { "styles": [
{
"namedStyleType": "",
"paragraphStyle": {},
"textStyle": {}
}
] },
"positionedObjects": {},
"revisionId": "",
"suggestedDocumentStyleChanges": {},
"suggestedNamedStylesChanges": {},
"suggestionsViewMode": "",
"title": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/documents"
payload <- "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/documents') do |req|
req.body = "{\n \"body\": {\n \"content\": [\n {\n \"endIndex\": 0,\n \"paragraph\": {\n \"bullet\": {\n \"listId\": \"\",\n \"nestingLevel\": 0,\n \"textStyle\": {\n \"backgroundColor\": {\n \"color\": {\n \"rgbColor\": {\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n }\n }\n },\n \"baselineOffset\": \"\",\n \"bold\": false,\n \"fontSize\": {\n \"magnitude\": \"\",\n \"unit\": \"\"\n },\n \"foregroundColor\": {},\n \"italic\": false,\n \"link\": {\n \"bookmarkId\": \"\",\n \"headingId\": \"\",\n \"url\": \"\"\n },\n \"smallCaps\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"weightedFontFamily\": {\n \"fontFamily\": \"\",\n \"weight\": 0\n }\n }\n },\n \"elements\": [\n {\n \"autoText\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {},\n \"type\": \"\"\n },\n \"columnBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"endIndex\": 0,\n \"equation\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"footnoteReference\": {\n \"footnoteId\": \"\",\n \"footnoteNumber\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"horizontalRule\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"inlineObjectElement\": {\n \"inlineObjectId\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"pageBreak\": {\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"person\": {\n \"personId\": \"\",\n \"personProperties\": {\n \"email\": \"\",\n \"name\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"richLink\": {\n \"richLinkId\": \"\",\n \"richLinkProperties\": {\n \"mimeType\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n },\n \"startIndex\": 0,\n \"textRun\": {\n \"content\": \"\",\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTextStyleChanges\": {},\n \"textStyle\": {}\n }\n }\n ],\n \"paragraphStyle\": {\n \"alignment\": \"\",\n \"avoidWidowAndOrphan\": false,\n \"borderBetween\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"padding\": {},\n \"width\": {}\n },\n \"borderBottom\": {},\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"direction\": \"\",\n \"headingId\": \"\",\n \"indentEnd\": {},\n \"indentFirstLine\": {},\n \"indentStart\": {},\n \"keepLinesTogether\": false,\n \"keepWithNext\": false,\n \"lineSpacing\": \"\",\n \"namedStyleType\": \"\",\n \"pageBreakBefore\": false,\n \"shading\": {\n \"backgroundColor\": {}\n },\n \"spaceAbove\": {},\n \"spaceBelow\": {},\n \"spacingMode\": \"\",\n \"tabStops\": [\n {\n \"alignment\": \"\",\n \"offset\": {}\n }\n ]\n },\n \"positionedObjectIds\": [],\n \"suggestedBulletChanges\": {},\n \"suggestedParagraphStyleChanges\": {},\n \"suggestedPositionedObjectIds\": {}\n },\n \"sectionBreak\": {\n \"sectionStyle\": {\n \"columnProperties\": [\n {\n \"paddingEnd\": {},\n \"width\": {}\n }\n ],\n \"columnSeparatorStyle\": \"\",\n \"contentDirection\": \"\",\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"sectionType\": \"\",\n \"useFirstPageHeaderFooter\": false\n },\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n },\n \"startIndex\": 0,\n \"table\": {\n \"columns\": 0,\n \"rows\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"tableRows\": [\n {\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableRowStyleChanges\": {},\n \"tableCells\": [\n {\n \"content\": [],\n \"endIndex\": 0,\n \"startIndex\": 0,\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": [],\n \"suggestedTableCellStyleChanges\": {},\n \"tableCellStyle\": {\n \"backgroundColor\": {},\n \"borderBottom\": {\n \"color\": {},\n \"dashStyle\": \"\",\n \"width\": {}\n },\n \"borderLeft\": {},\n \"borderRight\": {},\n \"borderTop\": {},\n \"columnSpan\": 0,\n \"contentAlignment\": \"\",\n \"paddingBottom\": {},\n \"paddingLeft\": {},\n \"paddingRight\": {},\n \"paddingTop\": {},\n \"rowSpan\": 0\n }\n }\n ],\n \"tableRowStyle\": {\n \"minRowHeight\": {},\n \"preventOverflow\": false,\n \"tableHeader\": false\n }\n }\n ],\n \"tableStyle\": {\n \"tableColumnProperties\": [\n {\n \"width\": {},\n \"widthType\": \"\"\n }\n ]\n }\n },\n \"tableOfContents\": {\n \"content\": [],\n \"suggestedDeletionIds\": [],\n \"suggestedInsertionIds\": []\n }\n }\n ]\n },\n \"documentId\": \"\",\n \"documentStyle\": {\n \"background\": {\n \"color\": {}\n },\n \"defaultFooterId\": \"\",\n \"defaultHeaderId\": \"\",\n \"evenPageFooterId\": \"\",\n \"evenPageHeaderId\": \"\",\n \"firstPageFooterId\": \"\",\n \"firstPageHeaderId\": \"\",\n \"marginBottom\": {},\n \"marginFooter\": {},\n \"marginHeader\": {},\n \"marginLeft\": {},\n \"marginRight\": {},\n \"marginTop\": {},\n \"pageNumberStart\": 0,\n \"pageSize\": {\n \"height\": {},\n \"width\": {}\n },\n \"useCustomHeaderFooterMargins\": false,\n \"useEvenPageHeaderFooter\": false,\n \"useFirstPageHeaderFooter\": false\n },\n \"footers\": {},\n \"footnotes\": {},\n \"headers\": {},\n \"inlineObjects\": {},\n \"lists\": {},\n \"namedRanges\": {},\n \"namedStyles\": {\n \"styles\": [\n {\n \"namedStyleType\": \"\",\n \"paragraphStyle\": {},\n \"textStyle\": {}\n }\n ]\n },\n \"positionedObjects\": {},\n \"revisionId\": \"\",\n \"suggestedDocumentStyleChanges\": {},\n \"suggestedNamedStylesChanges\": {},\n \"suggestionsViewMode\": \"\",\n \"title\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/documents";
let payload = json!({
"body": json!({"content": (
json!({
"endIndex": 0,
"paragraph": json!({
"bullet": json!({
"listId": "",
"nestingLevel": 0,
"textStyle": json!({
"backgroundColor": json!({"color": json!({"rgbColor": json!({
"blue": "",
"green": "",
"red": ""
})})}),
"baselineOffset": "",
"bold": false,
"fontSize": json!({
"magnitude": "",
"unit": ""
}),
"foregroundColor": json!({}),
"italic": false,
"link": json!({
"bookmarkId": "",
"headingId": "",
"url": ""
}),
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": json!({
"fontFamily": "",
"weight": 0
})
})
}),
"elements": (
json!({
"autoText": json!({
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTextStyleChanges": json!({}),
"textStyle": json!({}),
"type": ""
}),
"columnBreak": json!({
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTextStyleChanges": json!({}),
"textStyle": json!({})
}),
"endIndex": 0,
"equation": json!({
"suggestedDeletionIds": (),
"suggestedInsertionIds": ()
}),
"footnoteReference": json!({
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTextStyleChanges": json!({}),
"textStyle": json!({})
}),
"horizontalRule": json!({
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTextStyleChanges": json!({}),
"textStyle": json!({})
}),
"inlineObjectElement": json!({
"inlineObjectId": "",
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTextStyleChanges": json!({}),
"textStyle": json!({})
}),
"pageBreak": json!({
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTextStyleChanges": json!({}),
"textStyle": json!({})
}),
"person": json!({
"personId": "",
"personProperties": json!({
"email": "",
"name": ""
}),
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTextStyleChanges": json!({}),
"textStyle": json!({})
}),
"richLink": json!({
"richLinkId": "",
"richLinkProperties": json!({
"mimeType": "",
"title": "",
"uri": ""
}),
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTextStyleChanges": json!({}),
"textStyle": json!({})
}),
"startIndex": 0,
"textRun": json!({
"content": "",
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTextStyleChanges": json!({}),
"textStyle": json!({})
})
})
),
"paragraphStyle": json!({
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": json!({
"color": json!({}),
"dashStyle": "",
"padding": json!({}),
"width": json!({})
}),
"borderBottom": json!({}),
"borderLeft": json!({}),
"borderRight": json!({}),
"borderTop": json!({}),
"direction": "",
"headingId": "",
"indentEnd": json!({}),
"indentFirstLine": json!({}),
"indentStart": json!({}),
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": json!({"backgroundColor": json!({})}),
"spaceAbove": json!({}),
"spaceBelow": json!({}),
"spacingMode": "",
"tabStops": (
json!({
"alignment": "",
"offset": json!({})
})
)
}),
"positionedObjectIds": (),
"suggestedBulletChanges": json!({}),
"suggestedParagraphStyleChanges": json!({}),
"suggestedPositionedObjectIds": json!({})
}),
"sectionBreak": json!({
"sectionStyle": json!({
"columnProperties": (
json!({
"paddingEnd": json!({}),
"width": json!({})
})
),
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": json!({}),
"marginFooter": json!({}),
"marginHeader": json!({}),
"marginLeft": json!({}),
"marginRight": json!({}),
"marginTop": json!({}),
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
}),
"suggestedDeletionIds": (),
"suggestedInsertionIds": ()
}),
"startIndex": 0,
"table": json!({
"columns": 0,
"rows": 0,
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"tableRows": (
json!({
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTableRowStyleChanges": json!({}),
"tableCells": (
json!({
"content": (),
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": (),
"suggestedInsertionIds": (),
"suggestedTableCellStyleChanges": json!({}),
"tableCellStyle": json!({
"backgroundColor": json!({}),
"borderBottom": json!({
"color": json!({}),
"dashStyle": "",
"width": json!({})
}),
"borderLeft": json!({}),
"borderRight": json!({}),
"borderTop": json!({}),
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": json!({}),
"paddingLeft": json!({}),
"paddingRight": json!({}),
"paddingTop": json!({}),
"rowSpan": 0
})
})
),
"tableRowStyle": json!({
"minRowHeight": json!({}),
"preventOverflow": false,
"tableHeader": false
})
})
),
"tableStyle": json!({"tableColumnProperties": (
json!({
"width": json!({}),
"widthType": ""
})
)})
}),
"tableOfContents": json!({
"content": (),
"suggestedDeletionIds": (),
"suggestedInsertionIds": ()
})
})
)}),
"documentId": "",
"documentStyle": json!({
"background": json!({"color": json!({})}),
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": json!({}),
"marginFooter": json!({}),
"marginHeader": json!({}),
"marginLeft": json!({}),
"marginRight": json!({}),
"marginTop": json!({}),
"pageNumberStart": 0,
"pageSize": json!({
"height": json!({}),
"width": json!({})
}),
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
}),
"footers": json!({}),
"footnotes": json!({}),
"headers": json!({}),
"inlineObjects": json!({}),
"lists": json!({}),
"namedRanges": json!({}),
"namedStyles": json!({"styles": (
json!({
"namedStyleType": "",
"paragraphStyle": json!({}),
"textStyle": json!({})
})
)}),
"positionedObjects": json!({}),
"revisionId": "",
"suggestedDocumentStyleChanges": json!({}),
"suggestedNamedStylesChanges": json!({}),
"suggestionsViewMode": "",
"title": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/documents \
--header 'content-type: application/json' \
--data '{
"body": {
"content": [
{
"endIndex": 0,
"paragraph": {
"bullet": {
"listId": "",
"nestingLevel": 0,
"textStyle": {
"backgroundColor": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
},
"baselineOffset": "",
"bold": false,
"fontSize": {
"magnitude": "",
"unit": ""
},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
},
"elements": [
{
"autoText": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {},
"type": ""
},
"columnBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"endIndex": 0,
"equation": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"footnoteReference": {
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"horizontalRule": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"inlineObjectElement": {
"inlineObjectId": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"pageBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"person": {
"personId": "",
"personProperties": {
"email": "",
"name": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"richLink": {
"richLinkId": "",
"richLinkProperties": {
"mimeType": "",
"title": "",
"uri": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"startIndex": 0,
"textRun": {
"content": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
}
}
],
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"positionedObjectIds": [],
"suggestedBulletChanges": {},
"suggestedParagraphStyleChanges": {},
"suggestedPositionedObjectIds": {}
},
"sectionBreak": {
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"startIndex": 0,
"table": {
"columns": 0,
"rows": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"tableRows": [
{
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableRowStyleChanges": {},
"tableCells": [
{
"content": [],
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableCellStyleChanges": {},
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
}
}
],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
}
}
],
"tableStyle": {
"tableColumnProperties": [
{
"width": {},
"widthType": ""
}
]
}
},
"tableOfContents": {
"content": [],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
}
}
]
},
"documentId": "",
"documentStyle": {
"background": {
"color": {}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {
"height": {},
"width": {}
},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"footers": {},
"footnotes": {},
"headers": {},
"inlineObjects": {},
"lists": {},
"namedRanges": {},
"namedStyles": {
"styles": [
{
"namedStyleType": "",
"paragraphStyle": {},
"textStyle": {}
}
]
},
"positionedObjects": {},
"revisionId": "",
"suggestedDocumentStyleChanges": {},
"suggestedNamedStylesChanges": {},
"suggestionsViewMode": "",
"title": ""
}'
echo '{
"body": {
"content": [
{
"endIndex": 0,
"paragraph": {
"bullet": {
"listId": "",
"nestingLevel": 0,
"textStyle": {
"backgroundColor": {
"color": {
"rgbColor": {
"blue": "",
"green": "",
"red": ""
}
}
},
"baselineOffset": "",
"bold": false,
"fontSize": {
"magnitude": "",
"unit": ""
},
"foregroundColor": {},
"italic": false,
"link": {
"bookmarkId": "",
"headingId": "",
"url": ""
},
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": {
"fontFamily": "",
"weight": 0
}
}
},
"elements": [
{
"autoText": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {},
"type": ""
},
"columnBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"endIndex": 0,
"equation": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"footnoteReference": {
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"horizontalRule": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"inlineObjectElement": {
"inlineObjectId": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"pageBreak": {
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"person": {
"personId": "",
"personProperties": {
"email": "",
"name": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"richLink": {
"richLinkId": "",
"richLinkProperties": {
"mimeType": "",
"title": "",
"uri": ""
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
},
"startIndex": 0,
"textRun": {
"content": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": {},
"textStyle": {}
}
}
],
"paragraphStyle": {
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": {
"color": {},
"dashStyle": "",
"padding": {},
"width": {}
},
"borderBottom": {},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"direction": "",
"headingId": "",
"indentEnd": {},
"indentFirstLine": {},
"indentStart": {},
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": {
"backgroundColor": {}
},
"spaceAbove": {},
"spaceBelow": {},
"spacingMode": "",
"tabStops": [
{
"alignment": "",
"offset": {}
}
]
},
"positionedObjectIds": [],
"suggestedBulletChanges": {},
"suggestedParagraphStyleChanges": {},
"suggestedPositionedObjectIds": {}
},
"sectionBreak": {
"sectionStyle": {
"columnProperties": [
{
"paddingEnd": {},
"width": {}
}
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
},
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
},
"startIndex": 0,
"table": {
"columns": 0,
"rows": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"tableRows": [
{
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableRowStyleChanges": {},
"tableCells": [
{
"content": [],
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableCellStyleChanges": {},
"tableCellStyle": {
"backgroundColor": {},
"borderBottom": {
"color": {},
"dashStyle": "",
"width": {}
},
"borderLeft": {},
"borderRight": {},
"borderTop": {},
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": {},
"paddingLeft": {},
"paddingRight": {},
"paddingTop": {},
"rowSpan": 0
}
}
],
"tableRowStyle": {
"minRowHeight": {},
"preventOverflow": false,
"tableHeader": false
}
}
],
"tableStyle": {
"tableColumnProperties": [
{
"width": {},
"widthType": ""
}
]
}
},
"tableOfContents": {
"content": [],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
}
}
]
},
"documentId": "",
"documentStyle": {
"background": {
"color": {}
},
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": {},
"marginFooter": {},
"marginHeader": {},
"marginLeft": {},
"marginRight": {},
"marginTop": {},
"pageNumberStart": 0,
"pageSize": {
"height": {},
"width": {}
},
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
},
"footers": {},
"footnotes": {},
"headers": {},
"inlineObjects": {},
"lists": {},
"namedRanges": {},
"namedStyles": {
"styles": [
{
"namedStyleType": "",
"paragraphStyle": {},
"textStyle": {}
}
]
},
"positionedObjects": {},
"revisionId": "",
"suggestedDocumentStyleChanges": {},
"suggestedNamedStylesChanges": {},
"suggestionsViewMode": "",
"title": ""
}' | \
http POST {{baseUrl}}/v1/documents \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "body": {\n "content": [\n {\n "endIndex": 0,\n "paragraph": {\n "bullet": {\n "listId": "",\n "nestingLevel": 0,\n "textStyle": {\n "backgroundColor": {\n "color": {\n "rgbColor": {\n "blue": "",\n "green": "",\n "red": ""\n }\n }\n },\n "baselineOffset": "",\n "bold": false,\n "fontSize": {\n "magnitude": "",\n "unit": ""\n },\n "foregroundColor": {},\n "italic": false,\n "link": {\n "bookmarkId": "",\n "headingId": "",\n "url": ""\n },\n "smallCaps": false,\n "strikethrough": false,\n "underline": false,\n "weightedFontFamily": {\n "fontFamily": "",\n "weight": 0\n }\n }\n },\n "elements": [\n {\n "autoText": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {},\n "type": ""\n },\n "columnBreak": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "endIndex": 0,\n "equation": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": []\n },\n "footnoteReference": {\n "footnoteId": "",\n "footnoteNumber": "",\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "horizontalRule": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "inlineObjectElement": {\n "inlineObjectId": "",\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "pageBreak": {\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "person": {\n "personId": "",\n "personProperties": {\n "email": "",\n "name": ""\n },\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "richLink": {\n "richLinkId": "",\n "richLinkProperties": {\n "mimeType": "",\n "title": "",\n "uri": ""\n },\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n },\n "startIndex": 0,\n "textRun": {\n "content": "",\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTextStyleChanges": {},\n "textStyle": {}\n }\n }\n ],\n "paragraphStyle": {\n "alignment": "",\n "avoidWidowAndOrphan": false,\n "borderBetween": {\n "color": {},\n "dashStyle": "",\n "padding": {},\n "width": {}\n },\n "borderBottom": {},\n "borderLeft": {},\n "borderRight": {},\n "borderTop": {},\n "direction": "",\n "headingId": "",\n "indentEnd": {},\n "indentFirstLine": {},\n "indentStart": {},\n "keepLinesTogether": false,\n "keepWithNext": false,\n "lineSpacing": "",\n "namedStyleType": "",\n "pageBreakBefore": false,\n "shading": {\n "backgroundColor": {}\n },\n "spaceAbove": {},\n "spaceBelow": {},\n "spacingMode": "",\n "tabStops": [\n {\n "alignment": "",\n "offset": {}\n }\n ]\n },\n "positionedObjectIds": [],\n "suggestedBulletChanges": {},\n "suggestedParagraphStyleChanges": {},\n "suggestedPositionedObjectIds": {}\n },\n "sectionBreak": {\n "sectionStyle": {\n "columnProperties": [\n {\n "paddingEnd": {},\n "width": {}\n }\n ],\n "columnSeparatorStyle": "",\n "contentDirection": "",\n "defaultFooterId": "",\n "defaultHeaderId": "",\n "evenPageFooterId": "",\n "evenPageHeaderId": "",\n "firstPageFooterId": "",\n "firstPageHeaderId": "",\n "marginBottom": {},\n "marginFooter": {},\n "marginHeader": {},\n "marginLeft": {},\n "marginRight": {},\n "marginTop": {},\n "pageNumberStart": 0,\n "sectionType": "",\n "useFirstPageHeaderFooter": false\n },\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": []\n },\n "startIndex": 0,\n "table": {\n "columns": 0,\n "rows": 0,\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "tableRows": [\n {\n "endIndex": 0,\n "startIndex": 0,\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTableRowStyleChanges": {},\n "tableCells": [\n {\n "content": [],\n "endIndex": 0,\n "startIndex": 0,\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": [],\n "suggestedTableCellStyleChanges": {},\n "tableCellStyle": {\n "backgroundColor": {},\n "borderBottom": {\n "color": {},\n "dashStyle": "",\n "width": {}\n },\n "borderLeft": {},\n "borderRight": {},\n "borderTop": {},\n "columnSpan": 0,\n "contentAlignment": "",\n "paddingBottom": {},\n "paddingLeft": {},\n "paddingRight": {},\n "paddingTop": {},\n "rowSpan": 0\n }\n }\n ],\n "tableRowStyle": {\n "minRowHeight": {},\n "preventOverflow": false,\n "tableHeader": false\n }\n }\n ],\n "tableStyle": {\n "tableColumnProperties": [\n {\n "width": {},\n "widthType": ""\n }\n ]\n }\n },\n "tableOfContents": {\n "content": [],\n "suggestedDeletionIds": [],\n "suggestedInsertionIds": []\n }\n }\n ]\n },\n "documentId": "",\n "documentStyle": {\n "background": {\n "color": {}\n },\n "defaultFooterId": "",\n "defaultHeaderId": "",\n "evenPageFooterId": "",\n "evenPageHeaderId": "",\n "firstPageFooterId": "",\n "firstPageHeaderId": "",\n "marginBottom": {},\n "marginFooter": {},\n "marginHeader": {},\n "marginLeft": {},\n "marginRight": {},\n "marginTop": {},\n "pageNumberStart": 0,\n "pageSize": {\n "height": {},\n "width": {}\n },\n "useCustomHeaderFooterMargins": false,\n "useEvenPageHeaderFooter": false,\n "useFirstPageHeaderFooter": false\n },\n "footers": {},\n "footnotes": {},\n "headers": {},\n "inlineObjects": {},\n "lists": {},\n "namedRanges": {},\n "namedStyles": {\n "styles": [\n {\n "namedStyleType": "",\n "paragraphStyle": {},\n "textStyle": {}\n }\n ]\n },\n "positionedObjects": {},\n "revisionId": "",\n "suggestedDocumentStyleChanges": {},\n "suggestedNamedStylesChanges": {},\n "suggestionsViewMode": "",\n "title": ""\n}' \
--output-document \
- {{baseUrl}}/v1/documents
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"body": ["content": [
[
"endIndex": 0,
"paragraph": [
"bullet": [
"listId": "",
"nestingLevel": 0,
"textStyle": [
"backgroundColor": ["color": ["rgbColor": [
"blue": "",
"green": "",
"red": ""
]]],
"baselineOffset": "",
"bold": false,
"fontSize": [
"magnitude": "",
"unit": ""
],
"foregroundColor": [],
"italic": false,
"link": [
"bookmarkId": "",
"headingId": "",
"url": ""
],
"smallCaps": false,
"strikethrough": false,
"underline": false,
"weightedFontFamily": [
"fontFamily": "",
"weight": 0
]
]
],
"elements": [
[
"autoText": [
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": [],
"textStyle": [],
"type": ""
],
"columnBreak": [
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": [],
"textStyle": []
],
"endIndex": 0,
"equation": [
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
],
"footnoteReference": [
"footnoteId": "",
"footnoteNumber": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": [],
"textStyle": []
],
"horizontalRule": [
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": [],
"textStyle": []
],
"inlineObjectElement": [
"inlineObjectId": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": [],
"textStyle": []
],
"pageBreak": [
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": [],
"textStyle": []
],
"person": [
"personId": "",
"personProperties": [
"email": "",
"name": ""
],
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": [],
"textStyle": []
],
"richLink": [
"richLinkId": "",
"richLinkProperties": [
"mimeType": "",
"title": "",
"uri": ""
],
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": [],
"textStyle": []
],
"startIndex": 0,
"textRun": [
"content": "",
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTextStyleChanges": [],
"textStyle": []
]
]
],
"paragraphStyle": [
"alignment": "",
"avoidWidowAndOrphan": false,
"borderBetween": [
"color": [],
"dashStyle": "",
"padding": [],
"width": []
],
"borderBottom": [],
"borderLeft": [],
"borderRight": [],
"borderTop": [],
"direction": "",
"headingId": "",
"indentEnd": [],
"indentFirstLine": [],
"indentStart": [],
"keepLinesTogether": false,
"keepWithNext": false,
"lineSpacing": "",
"namedStyleType": "",
"pageBreakBefore": false,
"shading": ["backgroundColor": []],
"spaceAbove": [],
"spaceBelow": [],
"spacingMode": "",
"tabStops": [
[
"alignment": "",
"offset": []
]
]
],
"positionedObjectIds": [],
"suggestedBulletChanges": [],
"suggestedParagraphStyleChanges": [],
"suggestedPositionedObjectIds": []
],
"sectionBreak": [
"sectionStyle": [
"columnProperties": [
[
"paddingEnd": [],
"width": []
]
],
"columnSeparatorStyle": "",
"contentDirection": "",
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": [],
"marginFooter": [],
"marginHeader": [],
"marginLeft": [],
"marginRight": [],
"marginTop": [],
"pageNumberStart": 0,
"sectionType": "",
"useFirstPageHeaderFooter": false
],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
],
"startIndex": 0,
"table": [
"columns": 0,
"rows": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"tableRows": [
[
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableRowStyleChanges": [],
"tableCells": [
[
"content": [],
"endIndex": 0,
"startIndex": 0,
"suggestedDeletionIds": [],
"suggestedInsertionIds": [],
"suggestedTableCellStyleChanges": [],
"tableCellStyle": [
"backgroundColor": [],
"borderBottom": [
"color": [],
"dashStyle": "",
"width": []
],
"borderLeft": [],
"borderRight": [],
"borderTop": [],
"columnSpan": 0,
"contentAlignment": "",
"paddingBottom": [],
"paddingLeft": [],
"paddingRight": [],
"paddingTop": [],
"rowSpan": 0
]
]
],
"tableRowStyle": [
"minRowHeight": [],
"preventOverflow": false,
"tableHeader": false
]
]
],
"tableStyle": ["tableColumnProperties": [
[
"width": [],
"widthType": ""
]
]]
],
"tableOfContents": [
"content": [],
"suggestedDeletionIds": [],
"suggestedInsertionIds": []
]
]
]],
"documentId": "",
"documentStyle": [
"background": ["color": []],
"defaultFooterId": "",
"defaultHeaderId": "",
"evenPageFooterId": "",
"evenPageHeaderId": "",
"firstPageFooterId": "",
"firstPageHeaderId": "",
"marginBottom": [],
"marginFooter": [],
"marginHeader": [],
"marginLeft": [],
"marginRight": [],
"marginTop": [],
"pageNumberStart": 0,
"pageSize": [
"height": [],
"width": []
],
"useCustomHeaderFooterMargins": false,
"useEvenPageHeaderFooter": false,
"useFirstPageHeaderFooter": false
],
"footers": [],
"footnotes": [],
"headers": [],
"inlineObjects": [],
"lists": [],
"namedRanges": [],
"namedStyles": ["styles": [
[
"namedStyleType": "",
"paragraphStyle": [],
"textStyle": []
]
]],
"positionedObjects": [],
"revisionId": "",
"suggestedDocumentStyleChanges": [],
"suggestedNamedStylesChanges": [],
"suggestionsViewMode": "",
"title": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/documents")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
docs.documents.get
{{baseUrl}}/v1/documents/:documentId
QUERY PARAMS
documentId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/documents/:documentId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/documents/:documentId")
require "http/client"
url = "{{baseUrl}}/v1/documents/:documentId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/documents/:documentId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/documents/:documentId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/documents/:documentId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/documents/:documentId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/documents/:documentId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/documents/:documentId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/documents/:documentId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/documents/:documentId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/documents/:documentId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/documents/:documentId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/documents/:documentId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/documents/:documentId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/documents/:documentId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/documents/:documentId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/documents/:documentId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/documents/:documentId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/documents/:documentId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/documents/:documentId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/documents/:documentId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/documents/:documentId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/documents/:documentId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/documents/:documentId');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/documents/:documentId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/documents/:documentId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/documents/:documentId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/documents/:documentId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/documents/:documentId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/documents/:documentId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/documents/:documentId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/documents/:documentId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/documents/:documentId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/documents/:documentId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/documents/:documentId
http GET {{baseUrl}}/v1/documents/:documentId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/documents/:documentId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/documents/:documentId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()