Contentful integration
In short
Read, create, update and publish entries. Connect it on the Integrations page; your app then calls Contentful through Sapilon without ever holding a Contentful credential.
Lets your app read content types and entries in a Contentful space and create, update and publish entries, with a content management token.
Connecting
On the Integrations page choose Connect on Contentful and fill in:
- Personal access token — Contentful → Settings → CMA tokens → Create personal access token.
Sapilon checks the key with the provider before it saves it, and stores it encrypted; it is never shown again.
- The token has the access of the person who made it, in every space they belong to.
What your app can do
Only these requests are available; anything else is refused.
GET /spacesGET /spaces/*/environments/*/content_typesGET|POST /spaces/*/environments/*/entriesGET|PUT /spaces/*/environments/*/entries/*PUT /spaces/*/environments/*/entries/*/published
How the agent uses it
Use integrations.request('contentful', …); paths are relative to https://api.contentful.com (the Content Management API). Use master as the environment unless the space has others.
GET /spaces— spaces the token can see.GET /spaces/{spaceId}/environments/{env}/content_types— field ids per type.GET /spaces/{spaceId}/environments/{env}/entries— Example:{ method: 'GET', path: '/spaces/s1/environments/master/entries', query: { content_type: 'blogPost', limit: '20' } }.POST …/entries— create; name the type in a header. Example:{ method: 'POST', path: '/spaces/s1/environments/master/entries', headers: { 'X-Contentful-Content-Type': 'blogPost' }, body: { fields: { title: { 'en-US': 'Hello' } } } }.GET|PUT …/entries/{entryId}— update with the entry’s current version:headers: { 'X-Contentful-Version': '3' }.PUT …/entries/{entryId}/published— publish, with the same version header.
Deleting is not allowed.
More from Contentful: https://www.contentful.com/developers/docs/references/content-management-api/