Amplience
Amplience is a shopping experience platform that helps businesses deliver personalized and connected experiences to their customers. The platform brings together data, performance insights, and generative AI to help businesses create truly personalized experiences.
Connecting Constructor API using Amplience’s webhooks is a straightforward process. Amplience provides a customizable webhook feature that allows developers to integrate their software with Dynamic Content.
If you have any questions, feel free to reach out to us at [email protected]
.
Creating your Amplience webhook
Amplience provides a powerful and customizable webhook framework that allows for easy integrations. Check out the official documentation to learn more.
To setup your Amplience integration, you'll need to setup webhooks to transfer data between Amplience and Constructor.
Start by logging into your Amplience account and navigating to the Development and then Webhooks section.
From that page, click the Add Webhook button to create a new webhook. On the modal, select the From scratch option.
Fill in the following fields:
- URL should be
https://ac.cnstrc.com/v2/items?key=YOUR_API_KEY§ion=Content&on_missing=CREATE
- Method should be
PATCH
- Status should be
Active
- On Webhook triggers, select
Created
andUpdated
fromContent item
It should look like this:
Make sure to replace `YOUR_API_KEY` with your Constructor API key.
Make sure to replace `Content` with the name of your section in Constructor. Contact our support team to setup a new section if you need to.
Authentication
On Headers
, make sure to properly configure the credentials to authenticate with the Constructor API. Refer to our documentation to learn more about authentication.
Make sure that you have the following headers:
Content-Type
with the valueapplication/json
Authorization
with your basic auth credentials
Payload
Finally, we need to transform the payload to make sure the webhook will properly insert the data into Constructor with our expected data format.
Select Custom
to customize the payload and use the following template:
{
"items": [
{
"id": {{{JSONstringify payload.id}}},
"name": {{{JSONstringify payload.body.snippet.title}}},
"data": {
"active": true,
"keywords": [],
"image_url": "https://{{{payload.body.snippet.image.image.defaultHost}}}/i/{{{payload.body.snippet.image.image.endpoint}}}/{{{payload.body.snippet.image.image.name}}}",
"url": {{{JSONstringify payload.body.snippet.cta.value}}},
"description": {{{JSONstringify payload.body.snippet.description}}},
"body": {{{JSONstringify payload.body.content.text}}}
}
}
]
}
Note that the payload above maps the Amplience content type for `Blog Posts`. If you're using a different content type, you'll need to adjust the payload accordingly.
Testing
Create or edit any content items and in a few minutes they should be available in Constructor.
You can review the data received in the Catalog Uploads page.
Updated 2 months ago