⚠️ This documentation pertains to a preview endpoint. This feature is not yet ready for API consumption and may change.
For inquiries or feedback, please contact us at Glean.

Preview draft Announcement

post/previewannouncementdraft

Generates a preview for a user-generated Announcement from a draft.

SecurityBearerAuth
Request
header Parameters
X-Glean-Auth-Type
string

Auth type being used to access the endpoint (should be non-empty only for global tokens).

X-Scio-Actas
string <email>

Email address of a user on whose behalf the request is intended to be made (should be non-empty only for global tokens).

Request Body schema: application/json
required

preview announcement request

object (UgcDraft)
object or object or object (DocumentSpec)
type
any (UgcType)
Enum: "ANNOUNCEMENTS_TYPE" "ANSWERS_TYPE" "COLLECTIONS_TYPE" "SHORTCUTS_TYPE" "WORKFLOWS_TYPE" "PROMPT_TEMPLATES_TYPE"
Responses
200

OK

Response Schema: application/json
object (Announcement)
object (Answer)
400

Invalid request

401

Not Authorized

429

Too Many Requests

Request samples
application/json
{
  • "draft": {
    • "announcement": {
      • "startTime": "2019-08-24T14:15:22Z",
      • "endTime": "2019-08-24T14:15:22Z",
      • "title": "string",
      • "body": {
        • "text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
        • "structuredList": [
          • {
            • "document": {
              • "id": "string",
              • "datasource": "string",
              • "connectorType": "API_CRAWL",
              • "docType": "string",
              • "content": {
                • "fullTextList": [ ]
                },
              • "containerDocument": { },
              • "parentDocument": { },
              • "title": "string",
              • "url": "string",
              • "metadata": {
                • "container": "container",
                • "parentId": "JIRA_EN-1337",
                • "createTime": "2000-01-23T04:56:07.000Z",
                • "datasource": "datasource",
                • "author": {
                  • "name": "name"
                  },
                • "documentId": "documentId",
                • "updateTime": "2000-01-23T04:56:07.000Z",
                • "mimeType": "mimeType",
                • "objectType": "Feature Request",
                • "components": [
                  • "Backend",
                  • "Networking"
                  ],
                • "status": [
                  • "Done"
                  ],
                • "customData": {
                  • "someCustomField": "someCustomValue"
                  }
                },
              • "sections": [
                • null
                ]
              },
            • "text": "Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."
            }
          ]
        },
      • "emoji": "string",
      • "thumbnail": {
        • "photoId": "string",
        • "url": "string"
        },
      • "banner": {
        • "photoId": "string",
        • "url": "string"
        },
      • "audienceFilters": [
        • {
          • "fieldName": "type",
          • "values": [
            • {
              • "value": "Spreadsheet",
              • "relationType": "EQUALS"
              },
            • {
              • "value": "Presentation",
              • "relationType": "EQUALS"
              }
            ]
          }
        ],
      • "sourceDocumentId": "string",
      • "hideAttribution": true,
      • "channel": "MAIN",
      • "postType": "TEXT",
      • "isPrioritized": true,
      • "viewUrl": "string"
      },
    • "answer": {
      • "question": "Why is the sky blue?",
      • "questionVariations": [
        • "string"
        ],
      • "bodyText": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
      • "boardId": 0,
      • "audienceFilters": [
        • {
          • "fieldName": "type",
          • "values": [
            • {
              • "value": "Spreadsheet",
              • "relationType": "EQUALS"
              },
            • {
              • "value": "Presentation",
              • "relationType": "EQUALS"
              }
            ]
          }
        ],
      • "addedRoles": [
        • {
          • "sourceDocumentSpec": {
            • "url": "string"
            },
          • "person": {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            },
          • "group": {
            • "type": "DEPARTMENT",
            • "id": "string",
            • "name": "string"
            },
          • "role": "OWNER"
          }
        ],
      • "removedRoles": [
        • {
          • "sourceDocumentSpec": {
            • "url": "string"
            },
          • "person": {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            },
          • "group": {
            • "type": "DEPARTMENT",
            • "id": "string",
            • "name": "string"
            },
          • "role": "OWNER"
          }
        ],
      • "roles": [
        • {
          • "sourceDocumentSpec": {
            • "url": "string"
            },
          • "person": {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            },
          • "group": {
            • "type": "DEPARTMENT",
            • "id": "string",
            • "name": "string"
            },
          • "role": "OWNER"
          }
        ],
      • "sourceDocumentSpec": {
        • "url": "string"
        },
      • "sourceType": "DOCUMENT"
      }
    },
  • "draftSpec": {
    • "url": "string"
    },
  • "type": "ANNOUNCEMENTS_TYPE"
}
Response samples
application/json
{
  • "announcement": {
    • "startTime": "2019-08-24T14:15:22Z",
    • "endTime": "2019-08-24T14:15:22Z",
    • "title": "string",
    • "body": {
      • "text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
      • "structuredList": [
        • {
          • "document": {
            • "id": "string",
            • "datasource": "string",
            • "connectorType": "API_CRAWL",
            • "docType": "string",
            • "content": {
              • "fullTextList": [
                • null
                ]
              },
            • "containerDocument": { },
            • "parentDocument": { },
            • "title": "string",
            • "url": "string",
            • "metadata": {
              • "container": "container",
              • "parentId": "JIRA_EN-1337",
              • "createTime": "2000-01-23T04:56:07.000Z",
              • "datasource": "datasource",
              • "author": {
                • "name": "name"
                },
              • "documentId": "documentId",
              • "updateTime": "2000-01-23T04:56:07.000Z",
              • "mimeType": "mimeType",
              • "objectType": "Feature Request",
              • "components": [
                • "Backend",
                • "Networking"
                ],
              • "status": [
                • "Done"
                ],
              • "customData": {
                • "someCustomField": "someCustomValue"
                }
              },
            • "sections": [
              • {
                • "title": null,
                • "url": null
                }
              ]
            },
          • "text": "Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."
          }
        ]
      },
    • "emoji": "string",
    • "thumbnail": {
      • "photoId": "string",
      • "url": "string"
      },
    • "banner": {
      • "photoId": "string",
      • "url": "string"
      },
    • "audienceFilters": [
      • {
        • "fieldName": "type",
        • "values": [
          • {
            • "value": "Spreadsheet",
            • "relationType": "EQUALS"
            },
          • {
            • "value": "Presentation",
            • "relationType": "EQUALS"
            }
          ]
        }
      ],
    • "sourceDocumentId": "string",
    • "hideAttribution": true,
    • "channel": "MAIN",
    • "postType": "TEXT",
    • "isPrioritized": true,
    • "viewUrl": "string",
    • "draftId": 342,
    • "permissions": {
      • "write": {
        • "scopeType": "GLOBAL",
        • "create": true,
        • "update": true,
        • "delete": true
        }
      },
    • "id": 0,
    • "author": {
      • "name": "George Clooney",
      • "obfuscatedId": "abc123"
      },
    • "createTimestamp": 0,
    • "lastUpdateTimestamp": 0,
    • "updatedBy": {
      • "name": "George Clooney",
      • "obfuscatedId": "abc123"
      },
    • "viewerInfo": {
      • "isDismissed": true,
      • "isRead": true
      },
    • "sourceDocument": {
      • "id": "string",
      • "datasource": "string",
      • "connectorType": "API_CRAWL",
      • "docType": "string",
      • "content": {
        • "fullTextList": [
          • "string"
          ]
        },
      • "containerDocument": { },
      • "parentDocument": { },
      • "title": "string",
      • "url": "string",
      • "metadata": {
        • "container": "container",
        • "parentId": "JIRA_EN-1337",
        • "createTime": "2000-01-23T04:56:07.000Z",
        • "datasource": "datasource",
        • "author": {
          • "name": "name"
          },
        • "documentId": "documentId",
        • "updateTime": "2000-01-23T04:56:07.000Z",
        • "mimeType": "mimeType",
        • "objectType": "Feature Request",
        • "components": [
          • "Backend",
          • "Networking"
          ],
        • "status": [
          • "Done"
          ],
        • "customData": {
          • "someCustomField": "someCustomValue"
          }
        },
      • "sections": [
        • {
          • "title": "string",
          • "url": "string"
          }
        ]
      },
    • "isPublished": true
    },
  • "answer": {
    • "id": 3,
    • "docId": "ANSWERS_answer_3",
    • "question": "Why is the sky blue?",
    • "questionVariations": [
      • "string"
      ],
    • "bodyText": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
    • "boardId": 0,
    • "audienceFilters": [
      • {
        • "fieldName": "type",
        • "values": [
          • {
            • "value": "Spreadsheet",
            • "relationType": "EQUALS"
            },
          • {
            • "value": "Presentation",
            • "relationType": "EQUALS"
            }
          ]
        }
      ],
    • "addedRoles": [
      • {
        • "sourceDocumentSpec": {
          • "url": "string"
          },
        • "person": {
          • "name": "George Clooney",
          • "obfuscatedId": "abc123"
          },
        • "group": {
          • "type": "DEPARTMENT",
          • "id": "string",
          • "name": "string"
          },
        • "role": "OWNER"
        }
      ],
    • "removedRoles": [
      • {
        • "sourceDocumentSpec": {
          • "url": "string"
          },
        • "person": {
          • "name": "George Clooney",
          • "obfuscatedId": "abc123"
          },
        • "group": {
          • "type": "DEPARTMENT",
          • "id": "string",
          • "name": "string"
          },
        • "role": "OWNER"
        }
      ],
    • "roles": [
      • {
        • "sourceDocumentSpec": {
          • "url": "string"
          },
        • "person": {
          • "name": "George Clooney",
          • "obfuscatedId": "abc123"
          },
        • "group": {
          • "type": "DEPARTMENT",
          • "id": "string",
          • "name": "string"
          },
        • "role": "OWNER"
        }
      ],
    • "sourceDocumentSpec": {
      • "url": "string"
      },
    • "sourceType": "DOCUMENT",
    • "permissions": {
      • "write": {
        • "scopeType": "GLOBAL",
        • "create": true,
        • "update": true,
        • "delete": true
        }
      },
    • "combinedAnswerText": {
      • "text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
      • "structuredList": [
        • {
          • "document": {
            • "id": "string",
            • "datasource": "string",
            • "connectorType": "API_CRAWL",
            • "docType": "string",
            • "content": {
              • "fullTextList": [
                • null
                ]
              },
            • "containerDocument": { },
            • "parentDocument": { },
            • "title": "string",
            • "url": "string",
            • "metadata": {
              • "container": "container",
              • "parentId": "JIRA_EN-1337",
              • "createTime": "2000-01-23T04:56:07.000Z",
              • "datasource": "datasource",
              • "author": {
                • "name": "name"
                },
              • "documentId": "documentId",
              • "updateTime": "2000-01-23T04:56:07.000Z",
              • "mimeType": "mimeType",
              • "objectType": "Feature Request",
              • "components": [
                • "Backend",
                • "Networking"
                ],
              • "status": [
                • "Done"
                ],
              • "customData": {
                • "someCustomField": "someCustomValue"
                }
              },
            • "sections": [
              • {
                • "title": null,
                • "url": null
                }
              ]
            },
          • "text": "Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."
          }
        ]
      },
    • "likes": {
      • "likedBy": [
        • {
          • "user": {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            },
          • "createTime": "2019-08-24T14:15:22Z"
          }
        ],
      • "likedByUser": true,
      • "numLikes": 0
      },
    • "author": {
      • "name": "George Clooney",
      • "obfuscatedId": "abc123"
      },
    • "createTime": "2019-08-24T14:15:22Z",
    • "updateTime": "2019-08-24T14:15:22Z",
    • "updatedBy": {
      • "name": "George Clooney",
      • "obfuscatedId": "abc123"
      },
    • "verification": {
      • "state": "UNVERIFIED",
      • "metadata": {
        • "lastVerifier": {
          • "name": "George Clooney",
          • "obfuscatedId": "abc123"
          },
        • "lastVerificationTs": 0,
        • "expirationTs": 0,
        • "document": {
          • "id": "string",
          • "datasource": "string",
          • "connectorType": "API_CRAWL",
          • "docType": "string",
          • "content": {
            • "fullTextList": [
              • "string"
              ]
            },
          • "containerDocument": { },
          • "parentDocument": { },
          • "title": "string",
          • "url": "string",
          • "metadata": {
            • "container": "container",
            • "parentId": "JIRA_EN-1337",
            • "createTime": "2000-01-23T04:56:07.000Z",
            • "datasource": "datasource",
            • "author": {
              • "name": "name"
              },
            • "documentId": "documentId",
            • "updateTime": "2000-01-23T04:56:07.000Z",
            • "mimeType": "mimeType",
            • "objectType": "Feature Request",
            • "components": [
              • "Backend",
              • "Networking"
              ],
            • "status": [
              • "Done"
              ],
            • "customData": {
              • "someCustomField": "someCustomValue"
              }
            },
          • "sections": [
            • {
              • "title": "string",
              • "url": "string"
              }
            ]
          },
        • "reminders": [
          • {
            • "assignee": {
              • "name": "George Clooney",
              • "obfuscatedId": "abc123"
              },
            • "requestor": {
              • "name": "George Clooney",
              • "obfuscatedId": "abc123"
              },
            • "remindAt": 0,
            • "createdAt": 0,
            • "reason": "string"
            }
          ],
        • "lastReminder": {
          • "assignee": {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            },
          • "requestor": {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            },
          • "remindAt": 0,
          • "createdAt": 0,
          • "reason": "string"
          },
        • "visitorCount": [
          • {
            • "count": 0,
            • "period": {
              • "minDaysFromNow": 0,
              • "maxDaysFromNow": 0,
              • "start": {
                • "epochSeconds": null,
                • "daysFromNow": null
                },
              • "end": {
                • "epochSeconds": null,
                • "daysFromNow": null
                }
              },
            • "org": "string"
            }
          ],
        • "candidateVerifiers": [
          • {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            }
          ]
        }
      },
    • "board": {
      • "name": "string",
      • "description": "string",
      • "addedRoles": [
        • {
          • "sourceDocumentSpec": {
            • "url": "string"
            },
          • "person": {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            },
          • "group": {
            • "type": "DEPARTMENT",
            • "id": "string",
            • "name": "string"
            },
          • "role": "OWNER"
          }
        ],
      • "removedRoles": [
        • {
          • "sourceDocumentSpec": {
            • "url": "string"
            },
          • "person": {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            },
          • "group": {
            • "type": "DEPARTMENT",
            • "id": "string",
            • "name": "string"
            },
          • "role": "OWNER"
          }
        ],
      • "audienceFilters": [
        • {
          • "fieldName": "type",
          • "values": [
            • {
              • "value": "Spreadsheet",
              • "relationType": "EQUALS"
              },
            • {
              • "value": "Presentation",
              • "relationType": "EQUALS"
              }
            ]
          }
        ],
      • "permissions": {
        • "write": {
          • "scopeType": "GLOBAL",
          • "create": true,
          • "update": true,
          • "delete": true
          }
        },
      • "id": 0,
      • "createTime": "2019-08-24T14:15:22Z",
      • "updateTime": "2019-08-24T14:15:22Z",
      • "creator": {
        • "name": "George Clooney",
        • "obfuscatedId": "abc123"
        },
      • "updatedBy": {
        • "name": "George Clooney",
        • "obfuscatedId": "abc123"
        },
      • "itemCount": 0,
      • "roles": [
        • {
          • "sourceDocumentSpec": {
            • "url": "string"
            },
          • "person": {
            • "name": "George Clooney",
            • "obfuscatedId": "abc123"
            },
          • "group": {
            • "type": "DEPARTMENT",
            • "id": "string",
            • "name": "string"
            },
          • "role": "OWNER"
          }
        ]
      },
    • "collections": [
      • {
        • "name": "string",
        • "description": "string",
        • "addedRoles": [
          • {
            • "sourceDocumentSpec": {
              • "url": "string"
              },
            • "person": {
              • "name": "George Clooney",
              • "obfuscatedId": "abc123"
              },
            • "group": {
              • "type": "DEPARTMENT",
              • "id": "string",
              • "name": "string"
              },
            • "role": "OWNER"
            }
          ],
        • "removedRoles": [
          • {
            • "sourceDocumentSpec": {
              • "url": "string"
              },
            • "person": {
              • "name": "George Clooney",
              • "obfuscatedId": "abc123"
              },
            • "group": {
              • "type": "DEPARTMENT",
              • "id": "string",
              • "name": "string"
              },
            • "role": "OWNER"
            }
          ],
        • "audienceFilters": [
          • {
            • "fieldName": "type",
            • "values": [
              • {
                • "value": "Spreadsheet",
                • "relationType": "EQUALS"
                },
              • {
                • "value": "Presentation",
                • "relationType": "EQUALS"
                }
              ]
            }
          ],
        • "icon": "string",
        • "adminLocked": true,
        • "parentId": 0,
        • "thumbnail": {
          • "photoId": "string",
          • "url": "string"
          },
        • "allowedDatasource": "string",
        • "permissions": {
          • "write": {
            • "scopeType": "GLOBAL",
            • "create": true,
            • "update": true,
            • "delete": true
            }
          },
        • "id": 0,
        • "createTime": "2019-08-24T14:15:22Z",
        • "updateTime": "2019-08-24T14:15:22Z",
        • "creator": {
          • "name": "George Clooney",
          • "obfuscatedId": "abc123"
          },
        • "updatedBy": {
          • "name": "George Clooney",
          • "obfuscatedId": "abc123"
          },
        • "itemCount": 0,
        • "childCount": 0,
        • "items": [
          • {
            • "name": "string",
            • "description": "string",
            • "icon": "string",
            • "collectionId": 0,
            • "documentId": "string",
            • "url": "string",
            • "itemId": "string",
            • "createdBy": {
              • "name": "George Clooney",
              • "obfuscatedId": "abc123"
              },
            • "createdAt": "2019-08-24T14:15:22Z",
            • "document": {
              • "id": "string",
              • "datasource": "string",
              • "connectorType": "API_CRAWL",
              • "docType": "string",
              • "content": {
                • "fullTextList": [ ]
                },
              • "containerDocument": { },
              • "parentDocument": { },
              • "title": "string",
              • "url": "string",
              • "metadata": {
                • "container": "container",
                • "parentId": "JIRA_EN-1337",
                • "createTime": "2000-01-23T04:56:07.000Z",
                • "datasource": "datasource",
                • "author": {
                  • "name": "name"
                  },
                • "documentId": "documentId",
                • "updateTime": "2000-01-23T04:56:07.000Z",
                • "mimeType": "mimeType",
                • "objectType": "Feature Request",
                • "components": [
                  • "Backend",
                  • "Networking"
                  ],
                • "status": [
                  • "Done"
                  ],
                • "customData": {
                  • "someCustomField": "someCustomValue"
                  }
                },
              • "sections": [
                • null
                ]
              },
            • "shortcut": {
              • "id": 0,
              • "inputAlias": "string",
              • "destinationUrl": "string",
              • "destinationDocumentId": "string",
              • "description": "string",
              • "unlisted": true,
              • "urlTemplate": "string",
              • "addedRoles": [
                • null
                ],
              • "removedRoles": [
                • null
                ],
              • "permissions": {
                • "write": null
                },
              • "createdBy": {
                • "name": "George Clooney",
                • "obfuscatedId": "abc123"
                },
              • "createTime": "2019-08-24T14:15:22Z",
              • "updatedBy": {
                • "name": "George Clooney",
                • "obfuscatedId": "abc123"
                },
              • "updateTime": "2019-08-24T14:15:22Z",
              • "destinationDocument": {
                • "id": null,
                • "datasource": null,
                • "connectorType": null,
                • "docType": null,
                • "content": null,
                • "containerDocument": null,
                • "parentDocument": null,
                • "title": null,
                • "url": null,
                • "metadata": null,
                • "sections": [ ]
                },
              • "intermediateUrl": "string",
              • "viewPrefix": "string",
              • "isExternal": true,
              • "editUrl": "string",
              • "alias": "string",
              • "title": "string",
              • "roles": [
                • null
                ]
              },
            • "collection": null,
            • "itemType": "DOCUMENT"
            }
          ],
        • "pinMetadata": {
          • "existingPins": [
            • {
              • "category": "COMPANY_RESOURCE",
              • "value": "string",
              • "target": "RESOURCE_CARD"
              }
            ],
          • "eligiblePins": [
            • {
              • "id": 0,
              • "target": {
                • "category": null,
                • "value": null,
                • "target": null
                }
              }
            ]
          },
        • "shortcuts": [
          • "string"
          ],
        • "children": [
          • null
          ],
        • "roles": [
          • {
            • "sourceDocumentSpec": {
              • "url": "string"
              },
            • "person": {
              • "name": "George Clooney",
              • "obfuscatedId": "abc123"
              },
            • "group": {
              • "type": "DEPARTMENT",
              • "id": "string",
              • "name": "string"
              },
            • "role": "OWNER"
            }
          ]
        }
      ],
    • "documentCategory": "string",
    • "sourceDocument": {
      • "id": "string",
      • "datasource": "string",
      • "connectorType": "API_CRAWL",
      • "docType": "string",
      • "content": {
        • "fullTextList": [
          • "string"
          ]
        },
      • "containerDocument": { },
      • "parentDocument": { },
      • "title": "string",
      • "url": "string",
      • "metadata": {
        • "container": "container",
        • "parentId": "JIRA_EN-1337",
        • "createTime": "2000-01-23T04:56:07.000Z",
        • "datasource": "datasource",
        • "author": {
          • "name": "name"
          },
        • "documentId": "documentId",
        • "updateTime": "2000-01-23T04:56:07.000Z",
        • "mimeType": "mimeType",
        • "objectType": "Feature Request",
        • "components": [
          • "Backend",
          • "Networking"
          ],
        • "status": [
          • "Done"
          ],
        • "customData": {
          • "someCustomField": "someCustomValue"
          }
        },
      • "sections": [
        • {
          • "title": "string",
          • "url": "string"
          }
        ]
      }
    }
}