Skip to main content

Content Studio integration overview

This page provides an overview of how to integrate Content Studio with your existing content workflow and how you can manage content generated using the Content Studio API.

Visit the Content Studio API page for more information about creating a content generation request using the GraphQL API.

Integration using webhooks
Link copied!

One approach to integrate with Content Studio is to use webhooks. You can set up a webhook to notify your integration that content that you've generated using the Content Studio APIs is available. The content can then be reviewed as part of your approval flow.

When integrating with Content Studio using webhooks:

  • Your application calls the Content Studio APIs to generate content.
  • Content Studio processes these requests asynchronously.
  • When a content generation job is complete, a webhook will be triggered and a webhook request, containing the completed job text in the webhook body, will be sent to the URL you specified.
  • The generated content can then be reviewed within your app and subject to your approval workflow.

Content Studio can integrate with your own service using webhooks

Setting up and viewing a webhook
Link copied!

Currently a content generation complete webhook must be set up by Amplience support. Visit the content generation webhook section of the Amplience support service catalog or contact your Customer Success Manager.

In order to set up the webhook you will need to provide the following information:

  • The hub name (eg "Documentation")
  • The CMS hub id. This is the id of the hub within Content Studio that you will be using. You can find the CMS hub id using the Content Studio APIs.
  • The webhook label. This is the friendly name that will be displayed in the webhook list in Dynamic Content.
  • The webhook URL. This is the URL to which the webhook request will be sent when a content generation job is complete. Note this is the URL on which your integration listens for webhook requests and is part of your integration.
  • Whether the webhook request should be sent as a POST or a GET.
  • Whether to include any custom headers in the webhook request.
  • An email address to be notified if the content generation has failed.

Viewing the webhook in Dynamic Content
Link copied!

If you have access to Dynamic Content, you can view webhook information by choosing "Webhooks" from the Development menu.

Once set up, the content generation complete webhook is shown in the list. Double click to open it.

The webhook generation complete webhook is shown in the webhook list

Included in the webhook details is a webhook secret. The webhook secret is used to validate the authenticity of incoming webhook requests so you know the request is valid and coming from Amplience. The secret will also be provided to you when the webhook is set up.

The webhook secret can be used to authenticate the webhook request

Updating a webhook- restrictions

Currently you can only view a content generation webhook in Dynamic Content and you cannot update its settings.

Viewing webhook deliveries
Link copied!

When you make a content generation request using the Content Studio API, the webhook will be triggered when the request is complete. You can find webhook deliveries in the activity log.

Note If you include multiple content generation requests in one API call, then the webhook will be invoked multiple times.

Each completed content generated request will trigger a webhook request. These requests are shown in the webhook deliveries window

Example webhook request
Link copied!

You can open a webhook delivery to see the body of the request. The body includes the content that was generated in JSON format. You can then extract the content and start your approval process.

An example webhook request, including the generated content

The body of a sample webhook request for a blog is shown below.

{
"sequenceId": 3,
"id": "93bb2c86-c8d4-495b-b84d-26bc62028633",
"name": "dynamic-content.content-generation-job.completed",
"requestId": "7426e2af-b593-4f70-bd78-b0e5f4328b99",
"resource": "5cf679244cedfd000109d2ef",
"payload": {
"id": "Q29udGVudEdlbmVyYXRpb25Kb2I6MTc5YTZmYzEtNDdjYy00OTM4LWE0ODktMGVhMTU0ODc1OGU2",
"content": {
"body": "# Whiskers Through Time: The Role of Mice in History\n\nIn the hushed corners of ancient civilizations and the bustling heart of modern metropolises, mice have scurried their way through history, leaving tiny paw prints on the pages of time. These small, often overlooked creatures have played surprisingly significant roles across cultures and epochs. Join us on a journey as we delve into the intriguing and multifaceted history of mice.\n\n## Ancient Companions and Symbolic Icons\n\nMice have long been silent witnesses to human history. In ancient Egypt, they were seen as symbols of abundance and were even associated with the god Horus. The Egyptians, ever the observers of nature, noted the mice’s ability to thrive and adapt, qualities they revered. Meanwhile, across the Mediterranean, the Greeks and Romans were captivated by their agility and resilience, often depicting mice in their art and literature.\n\nIn the rich tapestries of Chinese folklore, mice are revered as one of the revered 12 zodiac animals. According to legend, the mouse won its esteemed place by cunningly hitching a ride on the back of the ox during the Jade Emperor’s great race. This tale of resourcefulness and intelligence reflects the values attributed to the mouse in Chinese culture.\n\n## Mice in Science: Tiny Pioneers\n\nFast forward to the age of scientific enlightenment, and mice take on a new mantle: pioneers in the world of research. Their small size, rapid breeding, and genetic similarities to humans make them ideal candidates for scientific study. From unraveling the mysteries of genetics to developing life-saving medicines, these tiny creatures have been pivotal in advancing our understanding of biology and medicine.\n\nThe humble mouse was at the heart of the revolutionary development of penicillin during World War II. Scientists Florey and Chain used mice to test the antibiotic properties of penicillin, paving the way for its mass production and saving countless lives.\n\n## Cultural Narratives and Modern Media\n\nMice have not only occupied scientific texts but have also scampered into the heart of storytelling. From the cunning Jerry in \"Tom and Jerry\" to the heroic adventures of Stuart Little, mice have captured our imagination and entertained generations. Their depiction in literature and film often emphasizes their cleverness and ability to overcome obstacles, resonating with audiences worldwide.\n\nIn contemporary culture, Mickey Mouse reigns supreme as the quintessential symbol of joy, imagination, and innovation. Since his creation by Walt Disney in 1928, Mickey has become a global icon, embodying the spirit of adventure and creativity that defines the human experience.\n\n## Conclusion: A Legacy in Miniature\n\nFrom ancient mythologies to modern laboratories, mice have played roles far beyond their size. Their legacy is a testament to their enduring place in our collective consciousness. As we look to the future, these tiny creatures will undoubtedly continue to be both companions and collaborators in our ever-evolving story.\n\nSo, the next time you catch a glimpse of a mouse darting across a room or peeking from a nook, remember: these small creatures have been silent witnesses to our history, and their story is intricately woven with our own."
},
"status": {
"code": "COMPLETE"
}
}
}
  • payload.id is the job id for the content generation request. If you include multiple requests in the same API call, then each request will have its own job id and will be sent in a separate webhook delivery.

Note We recommend that you keep a record of the job id returned by a content generation request, so that when you receive the webhook request containing the job id, you can mark the job as complete.

  • payload.content.body contains the generated content as a string of encoded JSON.

Note payload.content will vary according to the template used. For example, when generating content using product description templates, the content will be in payload.content.description.

  • payload.status contains the status of the request: COMPLETE, ERROR or INSUFFICIENT_CREDITS.

Webhook response
Link copied!

You should return a 200 OK response to a webhook request.

Integration using polling
Link copied!

Another integration approach is to use polling. A content generation request will return a job id. You can then use the job id to poll the status of the job until the generated content is returned in the response.

When integrating with Content Studio using the polling approach:

  • Your integration will send a content generation request to the Content Studio API.
  • For each successful request the API will return a job id.
  • Your integration should poll the status of the content generation job using the job id until the job is complete.
  • When the job is complete the generated content will be returned in the response.
  • The generated content can then be reviewed within your app and subject to your approval workflow.

Content Studio can integrate with your own service by polling for generated content using job ids

Content Studio API

Graph QL Management API

GraphQL API playground

GraphQL Management API- limits

Content Studio

Content Studio custom templates user guide