Optional
lastIf a function fails, this property will contain the last error as a string message, otherwise it will be undefined
.
If a function succeeds, this property will contain the last response returned by Notion. The JSON returned by Notion will be parsed to an object and placed in this property. Refer to Notion API documentation for details on the contents of this object based on call made.
Release version of the Notion API to target. Default is "2022-02-22". If you need capabilities not available in a particular version, you can override the value. See Notion's versioning docs for details.
Execute a request against the Notion API. For successful requests, the HTTPResponse object will contain an object or array or objects decoded from the JSON returned by Notion as appropriate to the request made. Refer to Notion's API documentation for details about the expected parameters and responses. Drafts will handle wrapping the request in the appropriate OAuth authentication flow.
an object configuring the request.
Optional
data?: { A JavaScript object containing data to be encoded into the HTTP body of the request. Refer to API documentation for appropriate information to include.
Optional
headers?: { An object contain key-values to be added as custom headers in the request. There is no need to provide authorization headers, Drafts will add those. Drafts will automatically include required authentication and versioning headers.
The HTTP method, like "GET", "POST", etc.
Optional
parameters?: { An object containing key-values to be added to the request as URL parameters.
The full URL to the endpoint in the Notion REST API.
Static
createCreates a new Notion object.
Optional string value used to identify a Notion account. Typically this can be omitted if you only work with one Notion account in Drafts. Each unique identifier used for Notion accounts will share credentials - across both action steps and scripts.
Script integration with Notion. This object handles OAuth authentication and request signing. The entire Notion REST API can be used with the
request
method.Example