# notion-ti
Hello and welcome!

To make use of this API collection collection as it's written, please duplicate [this database template](https://www.notion.so/8e2c2b769e1d47d287b9ed3035d607ae?v=dc1b92875fb94f10834ba8d36549bd2a).

﻿Under the `Variables` tab, add your environment variables to start making requests. You will need to [create an integration](https://www.notion.so/my-integrations) to retrieve an API token. You will also need additional values, such as a database ID and page ID, which can be found in your Notion workspace or from the database template mentioned above.

For our full documentation, including sample integrations and guides, visit [developers.notion.com](https://developers.notion.com/)﻿.

Please note: Pages that are parented by a database _must_ have the same properties as the parent database. If you are not using the database template provided, the request `body` for the page endpoints included in this collection should be updated to match the properties in the parent database being used. See documentation for [Creating a page](https://developers.notion.com/reference/post-page) for more information.

To learn more about creating an access token, see our [official documentation](https://developers.notion.com/reference/create-a-token) and read our [Authorization](https://developers.notion.com/docs/authorization#step-3-send-the-code-in-a-post-request-to-the-notion-api) guide.

Need more help? Join our [developer community on Slack](https://join.slack.com/t/notiondevs/shared_invite/zt-20b5996xv-DzJdLiympy6jP0GGzu3AMg)﻿.

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 0.0.1
- Generator version: 7.9.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python 3.7+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import notion_ti
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import notion_ti
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import notion_ti
from notion_ti.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notion.com
# See configuration.py for a list of all supported configuration parameters.
configuration = notion_ti.Configuration(
    host = "https://api.notion.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = notion_ti.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with notion_ti.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notion_ti.BlocksApi(api_client)
    id = '{{PAGE_ID}}' # str | 
    notion_version = '{{NOTION_VERSION}}' # str |  (optional)
    page_size = 100 # int |  (optional)

    try:
        # Retrieve block children
        api_response = api_instance.v1_blocks_id_children_get(id, notion_version=notion_version, page_size=page_size)
        print("The response of BlocksApi->v1_blocks_id_children_get:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling BlocksApi->v1_blocks_id_children_get: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *https://api.notion.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BlocksApi* | [**v1_blocks_id_children_get**](docs/BlocksApi.md#v1_blocks_id_children_get) | **GET** /v1/blocks/{id}/children | Retrieve block children
*BlocksApi* | [**v1_blocks_id_children_patch**](docs/BlocksApi.md#v1_blocks_id_children_patch) | **PATCH** /v1/blocks/{id}/children | Append block children
*BlocksApi* | [**v1_blocks_id_delete**](docs/BlocksApi.md#v1_blocks_id_delete) | **DELETE** /v1/blocks/{id} | Delete a block
*BlocksApi* | [**v1_blocks_id_get**](docs/BlocksApi.md#v1_blocks_id_get) | **GET** /v1/blocks/{id} | Retrieve a block
*BlocksApi* | [**v1_blocks_id_patch**](docs/BlocksApi.md#v1_blocks_id_patch) | **PATCH** /v1/blocks/{id} | Update a block
*CommentsApi* | [**v1_comments_get**](docs/CommentsApi.md#v1_comments_get) | **GET** /v1/comments | Retrieve comments
*CommentsApi* | [**v1_comments_post**](docs/CommentsApi.md#v1_comments_post) | **POST** /v1/comments | Add comment to discussion
*DatabasesApi* | [**v1_databases_id_get**](docs/DatabasesApi.md#v1_databases_id_get) | **GET** /v1/databases/{id} | Retrieve a database
*DatabasesApi* | [**v1_databases_id_patch**](docs/DatabasesApi.md#v1_databases_id_patch) | **PATCH** /v1/databases/{id} | Update database properties
*DatabasesApi* | [**v1_databases_id_query_post**](docs/DatabasesApi.md#v1_databases_id_query_post) | **POST** /v1/databases/{id}/query | Filter a database
*DatabasesApi* | [**v1_databases_post**](docs/DatabasesApi.md#v1_databases_post) | **POST** /v1/databases/ | Create a database
*PagesApi* | [**v1_pages_id_get**](docs/PagesApi.md#v1_pages_id_get) | **GET** /v1/pages/{id} | Retrieve a page
*PagesApi* | [**v1_pages_id_patch**](docs/PagesApi.md#v1_pages_id_patch) | **PATCH** /v1/pages/{id} | Archive a page
*PagesApi* | [**v1_pages_page_id_properties_property_id_get**](docs/PagesApi.md#v1_pages_page_id_properties_property_id_get) | **GET** /v1/pages/{page_id}/properties/{property_id} | Retrieve a page property item
*PagesApi* | [**v1_pages_post**](docs/PagesApi.md#v1_pages_post) | **POST** /v1/pages/ | Create a page with content
*SearchApi* | [**v1_search_post**](docs/SearchApi.md#v1_search_post) | **POST** /v1/search | Search
*UsersApi* | [**v1_users_get**](docs/UsersApi.md#v1_users_get) | **GET** /v1/users | List all users
*UsersApi* | [**v1_users_id_get**](docs/UsersApi.md#v1_users_id_get) | **GET** /v1/users/{id} | Retrieve a user
*UsersApi* | [**v1_users_me_get**](docs/UsersApi.md#v1_users_me_get) | **GET** /v1/users/me | Retrieve your token’s bot user


## Documentation For Models



<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="bearerAuth"></a>
### bearerAuth

- **Type**: Bearer authentication


## Author




