Connecting to Contentful
To authenticate to Contentful, you can use API Key authentication to connect to your Contentful space and access your content.
Authentication
To authenticate to Contentful, you can use API Key authentication to connect to your Contentful space and access your content.
Using API Key Authentication
To authenticate using an API Key, you need to obtain your Content Delivery API access token from your Contentful space settings.
You can then connect by setting the AuthScheme to APIKey and providing your API key along with your Space ID:
- AuthScheme: Set this to APIKey.
- APIKey: Set this to your Content Delivery API access token from Contentful.
- SpaceId: Set this to your Contentful Space ID.
- EnvironmentId: Set this to your environment ID (defaults to "master").
Connection String Example
Profile=C:\path\to\Contentful.apip;AuthScheme=APIKey;ProfileSettings="APIKey=your_api_key;EnvironmentId=env_id;SpaceId=your_space_id;";;
Available Tables
The Contentful API Profile provides access to comprehensive content management data across 12 specialized tables:
- Entries - Access content entries with all fields and relationships in your Contentful space.
- Assets - Query media assets with file details and metadata from your Contentful space.
- ContentTypes - Access content type definitions with field schemas for Contentful entries.
- Spaces - Query space information and configuration details.
- Locales - Access locale definitions and language configuration.
- Tags - Query tag definitions and metadata for content organization.
- Concepts - Access concept definitions for content classification.
- ConceptSchemes - Query concept scheme definitions and hierarchies.
- EntryTags - Access relationships between entries and tags.
- EntryConcepts - Query relationships between entries and concepts.
- EntryLinks - Access link relationships between entries.
- SyncChanges - Query synchronization changes and content updates.
Usage Examples
Query entries created after specific date:
SELECT * FROM Entries WHERE CreatedAt >= '2024-01-01T00:00:00Z'
Query assets larger than specific size:
SELECT * FROM Assets WHERE Size >= 1000000
Query all content types:
SELECT * FROM ContentTypes
Query all spaces:
SELECT * FROM Spaces
Query all locales:
SELECT * FROM Locales
Query tags by name:
SELECT * FROM Tags WHERE Name = 'technology'
Query concepts by preferred label:
SELECT * FROM Concepts WHERE Id = '1JqMcRJZkqGWqGqowaUO4a'
Query specific concept scheme by ID:
SELECT * FROM ConceptSchemes WHERE Id = '1JqMcRJZkqGWqGqowaUO4a'
Query entries with specific tag:
SELECT * FROM EntryTags WHERE TagId = 'nyancat'
Query entries with specific concept:
SELECT * FROM EntryConcepts WHERE ContentType = 'image'
Query entries linking to specific target:
SELECT * FROM EntryLinks WHERE ContentType = 'image'
Query synchronization changes:
SELECT * FROM SyncChanges WHERE Type = 'Entry'
Connection Properties
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.
| Property | Description |
| APIKey | Your Contentful Content Delivery API access token. |
| AuthScheme | The scheme used for authentication. Accepted entries are APIKey or None. Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT |
| EnvironmentId | The Environment ID for your Contentful environment. |
| SpaceId | The Space ID for your Contentful space. |