Authorization

Contentful
Prerequisites
The Contentful connector authenticates using an API access token together with a space ID and an environment ID. Before creating a credential, gather the following from your Contentful account.
Choose the Appropriate API and Access Token
Contentful exposes three content APIs, and the type of access token you generate determines which API the token can call:
-
Content Management API (CMA): A read/write API at
https://api.contentful.comused to programmatically create, update, and manage content types, entries, and assets. The CMA requires a Content management token (personal access token) and is required for any destination (sink) operation, such as creating or updating entries and assets. -
Content Delivery API (CDA): A read-only API at
https://cdn.contentful.comthat serves published content optimized for production delivery. The CDA uses a Content Delivery API access token (a delivery API key). -
Content Preview API (CPA): A read-only API at
https://preview.contentful.comthat returns both published and draft content for in-context previews. The CPA uses a Content Preview API access token (a preview API key).
The endpoint templates included with this connector call different APIs. Management, environment, content type, entry, and asset endpoints call the CMA; "Search Entries (CDA)" calls the CDA; and "Preview Entries (CPA)" and "Get Space" call the CPA. Use an access token that has access to the API(s) required by the endpoints you intend to configure.
Generate a Content Management Token (CMA)
To create content or perform any destination (write) operation, generate a personal access token for the Content Management API.
-
Sign in to the Contentful web app.
-
Navigate to Settings > API keys.
-
Open the Content management tokens tab, and click Generate personal token.
-
Enter a descriptive name for the token (e.g., "Nexla Integration"), optionally set an expiration date, and click Generate.
Setting an expiration date is recommended as a security best practice. When the expiration date is reached, the token is automatically revoked, limiting the risk if the token is ever exposed.
-
Copy the generated token immediately and store it securely. The token cannot be viewed again after the dialog is closed.
Treat tokens like passwordsA Content Management token can read and modify content on your behalf. Store it securely, avoid committing it to version control, and rotate it if you suspect it has been exposed.
For complete information, see the Contentful Personal Access Tokens guide.
Generate a Delivery or Preview API Key (CDA / CPA)
To read published content (CDA) or preview published and draft content (CPA), generate the corresponding API key.
-
In the Contentful web app, navigate to Settings > API keys.
-
On the Content delivery / preview tokens tab, click Add API key (or select an existing key).
-
Enter a name and optional description for the key.
-
Copy the Content Delivery API - access token for read-only delivery access, or the Content Preview API - access token for preview access.
Locate Your Space ID and Environment ID
-
Open the relevant space in the Contentful web app.
-
Navigate to Settings > General settings to find the Space ID.
-
Identify the Environment ID you want to connect to (for example,
masterfor your production content). Environments behave like branches of your content, allowing you to develop and test changes in isolation. If no environment is specified, Contentful defaults tomaster.
For reference, see Find space ID and the Contentful Authentication documentation.
Create a Contentful Credential
- To create a new Contentful credential, after selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.
Credential Name & Description
-
Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.
Resource descriptions are recommended but are not required. They should be used to provide information about the resource purpose, data freshness, etc. that can help the owner and other users efficiently understand and utilize the resource.
API Key Authentication
Contentful authenticates each API request using a bearer token, which Nexla sends in the Authorization header as Bearer <access token>. Provide the access token along with the space and environment identifiers that scope your requests.
-
Enter your Contentful access token in the Access Token field. Use a Content Management token for write (destination) operations and CMA read operations, or a Delivery/Preview API key for CDA/CPA read operations, as described in the prerequisites.
The access token is stored securely and is never displayed after the credential is saved.
-
Enter your Contentful space identifier in the Space ID field. This value is found in Settings > General settings for your space.
-
Enter the environment identifier in the Environment ID field. This defaults to
masterif left blank. Environments allow you to isolate content changes (for example,stagingordev) from your production content.
Advanced Credential Configuration
Contentful publishes its public APIs at standard base URLs, which are pre-filled for you. These advanced fields rarely need to be changed and are typically only adjusted for testing or for non-standard Contentful deployments.
-
The following base URL fields are available under the advanced settings and are pre-populated with Contentful's default endpoints:
-
Content Management API URL: The base URL for the CMA. Defaults to
https://api.contentful.com. -
Content Delivery API URL: The base URL for the CDA. Defaults to
https://cdn.contentful.com. -
Content Preview API URL: The base URL for the CPA. Defaults to
https://preview.contentful.com.
Leave these fields at their default values unless you have a specific reason to override them. The default URLs apply to all standard Contentful accounts.
-
Save the Credential
-
Once all of the relevant steps in the above sections have been completed, click the Save button at the bottom of the overlay to save the configured credential.
-
The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation and can be selected for use with a new data source or destination.