Publisher Documents

Post Document Template

post/api/v1/entities/workspaces/{workspaceId}/documentTemplates

Request

  • Base URL
    https://www.gooddata.ai
  • Auth
    none declared

Path parameters

workspaceIdstring required

Query parameters

includestring[]

Array of included collections or individual relationships. Includes are separated by commas (e.g. include=entity1s,entity2s). Collection include represents the inclusion of every relationship between this entity and the given collection. Relationship include represents the inclusion of the particular relationships only. If single parameter "ALL" is present, all possible includes are used (include=ALL).

WARNING: Individual include types (collection, relationship or ALL) cannot be combined together.

metaIncludestring[]

Included meta objects

Include Meta objects.

Request body

Example request

{
  "data": {
    "attributes": {
      "content": {
        "defaults": {
          "pageSize": "widescreen",
          "takeaway": {
            "generation": {
              "instructions": "Write for executives. Lead with the change."
            }
          }
        },
        "filters": [
          {
            "attributeFilter": {
              "attributeElements": {
                "uris": []
              },
              "displayForm": {
                "identifier": "brand.name",
                "type": "displayForm"
              },
              "localIdentifier": "document_filter_brand_name",
              "negativeSelection": true,
              "title": "Brand"
            }
          }
        ],
        "pages": [
          {
            "id": "page_7f3a91c4",
            "kind": "cover",
            "layout": {
              "children": [
                {
                  "id": "coverTitle",
                  "markdown": "{documentName}",
                  "proportion": 2,
                  "style": {
                    "textColor": "{theme.colors.texts.inverse}"
                  },
                  "type": "title"
                },
                {
                  "id": "coverSubtitle",
                  "markdown": "{documentDateRange}",
                  "style": {
                    "textColor": "{theme.colors.texts.inverse}",
                    "textStyle": "h3"
                  },
                  "type": "text"
                }
              ],
              "type": "column"
            },
            "style": {
              "backgroundColor": "{theme.colors.backgrounds.inverse}",
              "backgroundImage": "{theme.coverImage}",
              "backgroundImageOpacity": 0.35
            }
          },
          {
            "id": "page_c41d9a07",
            "kind": "content",
            "layout": {
              "children": [
                {
                  "id": "pageTitle",
                  "markdown": "Revenue grew **12 %** in {documentDateRange}",
                  "proportion": 2,
                  "type": "title"
                },
                {
                  "children": [
                    {
                      "dateDataSet": {
                        "identifier": "date",
                        "type": "dataSet"
                      },
                      "id": "widget1",
                      "proportion": 2,
                      "style": {
                        "backgroundColor": "{theme.colors.backgrounds.surface}",
                        "borderRadius": "{theme.corners.medium}",
                        "padding": 24
                      },
                      "title": {
                        "visible": true
                      },
                      "type": "visualization",
                      "visualization": {
                        "identifier": "revenue_by_month",
                        "type": "insight"
                      }
                    },
                    {
                      "generation": {
                        "context": {
                          "widgets": [
                            "widget1"
                          ]
                        }
                      },
                      "id": "takeaway",
                      "markdown": "Revenue grew in every region, led by EMEA at +18 %.",
                      "style": {
                        "backgroundColor": "{theme.colors.backgrounds.accent}",
                        "backgroundOpacity": 0.08,
                        "borderLeftColor": "{theme.colors.lines.accent}",
                        "borderLeftWidth": 8,
                        "padding": 32
                      },
                      "title": {
                        "text": "Key takeaway"
                      },
                      "type": "takeaway"
                    }
                  ],
                  "proportion": 9,
                  "type": "row"
                }
              ],
              "style": {
                "gap": "{theme.spacing.gap.normal}"
              },
              "type": "column"
            },
            "notes": "Mention the EMEA promotion."
          },
          {
            "id": "page_3c19e0b7",
            "kind": "content",
            "layout": {
              "id": "appendix",
              "markdown": "Methodology notes for reviewers.",
              "type": "text"
            },
            "visible": false
          }
        ],
        "style": {
          "backgroundColor": "{theme.colors.backgrounds.surface}",
          "gap": 28
        }
      },
      "version": "2"
    },
    "id": "id1",
    "type": "documentTemplate"
  }
}

Response

Request successfully processed

Example response

{
  "data": {
    "attributes": {
      "content": {
        "defaults": {
          "pageSize": "widescreen",
          "takeaway": {
            "generation": {
              "instructions": "Write for executives. Lead with the change."
            }
          }
        },
        "filters": [
          {
            "attributeFilter": {
              "attributeElements": {
                "uris": []
              },
              "displayForm": {
                "identifier": "brand.name",
                "type": "displayForm"
              },
              "localIdentifier": "document_filter_brand_name",
              "negativeSelection": true,
              "title": "Brand"
            }
          }
        ],
        "pages": [
          {
            "id": "page_7f3a91c4",
            "kind": "cover",
            "layout": {
              "children": [
                {
                  "id": "coverTitle",
                  "markdown": "{documentName}",
                  "proportion": 2,
                  "style": {
                    "textColor": "{theme.colors.texts.inverse}"
                  },
                  "type": "title"
                },
                {
                  "id": "coverSubtitle",
                  "markdown": "{documentDateRange}",
                  "style": {
                    "textColor": "{theme.colors.texts.inverse}",
                    "textStyle": "h3"
                  },
                  "type": "text"
                }
              ],
              "type": "column"
            },
            "style": {
              "backgroundColor": "{theme.colors.backgrounds.inverse}",
              "backgroundImage": "{theme.coverImage}",
              "backgroundImageOpacity": 0.35
            }
          },
          {
            "id": "page_c41d9a07",
            "kind": "content",
            "layout": {
              "children": [
                {
                  "id": "pageTitle",
                  "markdown": "Revenue grew **12 %** in {documentDateRange}",
                  "proportion": 2,
                  "type": "title"
                },
                {
                  "children": [
                    {
                      "dateDataSet": {
                        "identifier": "date",
                        "type": "dataSet"
                      },
                      "id": "widget1",
                      "proportion": 2,
                      "style": {
                        "backgroundColor": "{theme.colors.backgrounds.surface}",
                        "borderRadius": "{theme.corners.medium}",
                        "padding": 24
                      },
                      "title": {
                        "visible": true
                      },
                      "type": "visualization",
                      "visualization": {
                        "identifier": "revenue_by_month",
                        "type": "insight"
                      }
                    },
                    {
                      "generation": {
                        "context": {
                          "widgets": [
                            "widget1"
                          ]
                        }
                      },
                      "id": "takeaway",
                      "markdown": "Revenue grew in every region, led by EMEA at +18 %.",
                      "style": {
                        "backgroundColor": "{theme.colors.backgrounds.accent}",
                        "backgroundOpacity": 0.08,
                        "borderLeftColor": "{theme.colors.lines.accent}",
                        "borderLeftWidth": 8,
                        "padding": 32
                      },
                      "title": {
                        "text": "Key takeaway"
                      },
                      "type": "takeaway"
                    }
                  ],
                  "proportion": 9,
                  "type": "row"
                }
              ],
              "style": {
                "gap": "{theme.spacing.gap.normal}"
              },
              "type": "column"
            },
            "notes": "Mention the EMEA promotion."
          },
          {
            "id": "page_3c19e0b7",
            "kind": "content",
            "layout": {
              "id": "appendix",
              "markdown": "Methodology notes for reviewers.",
              "type": "text"
            },
            "visible": false
          }
        ],
        "style": {
          "backgroundColor": "{theme.colors.backgrounds.surface}",
          "gap": 28
        }
      },
      "createdAt": "2023-07-20 12:30",
      "modifiedAt": "2023-07-20 12:30",
      "version": "2"
    },
    "id": "id1",
    "type": "documentTemplate"
  },
  "included": [
    {
      "id": "id1",
      "type": "userIdentifier"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.