# Contentful

## Authentication methods

#### CMA Token

To generate a token:

1. Log in to Contentful, access "CMA tokens" from the Settings menu:![](https://2119005510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FedNbhp7XNeTdK7we4Ka5%2Fuploads%2Fgit-blob-266f2ff2d7949895006ee55002a23db74b1ec904%2Fimage.png?alt=media)
2. Give the token any name
3. Set the Expiration date - consider choosing "No expiration" to ensure syncs are not disrupted

## Inbound Syncs

The following streams are supported, with Full Refresh and Incremental strategies:

* [Assets](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/assets)
* [Content Types](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types)
* [Entries](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/entries)
* [Environments](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/environments)
* [Locales](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/locales)
* [Memberships](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/space-memberships)
* [Spaces](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/spaces)
* [Tags](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/tags)

## Outbound Syncs

There is currently no outbound sync functionality for Contentful. If you have a use case, please let us know!

## Functions

### FETCH\_ORGANIZATIONS

Fetches a list of Contentful organizations.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection to query

Examples:

```sql
select *
from table(OMNATA_CONTENTFUL_PLUGIN.UDFS.FETCH_ORGANIZATIONS(
                'my-contentful-connection'
));
```

### FETCH\_SPACES

Fetches a list of Contentful spaces

Parameters

* CONNECTION\_SLUG (VARCHAR): The slug of the connection to query
* ORGANISATION\_ID: If using the Content Management API, an organization filter to use

Examples:

```sql
select *
from table(OMNATA_CONTENTFUL_PLUGIN.UDFS.FETCH_SPACES(
                'my-contentful-connection',
                '2ZpZ4abFMgULJGHyVFpKU8'
));
```

### FETCH\_ASSETS

Fetches Contentful assets

Parameters

* CONNECTION\_SLUG (VARCHAR): The slug of the connection to query
* ORGANISATION\_ID: If using the Content Management API, an organization filter to use
* ENVIRONMENT\_ID: The environment ID
* SPACE\_ID: The space ID
