This article explains how to create an API for a Custom Content Connector integration between your internal Digital Asset Management system and Templafy's Library. In other words, such content integration will make it possible to surface images, slides, slide elements, text elements, email elements, and PDFs directly within Templafy Library.
This will make it possible for the images to be widely available right where they are needed when working on your documents, presentations, or emails.
More in-depth instructions and code examples can be found here: https://github.com/templafy/CustomContentConnector
Prerequisites
|
ImportantAll the names and values in this article are case sensitive. |
Required Endpoints
To create a Custom Content Integration, the following three simple endpoints must be implemented. The base URL and authentication information are configured in the admin panel, instructions here.
The Templafy Custom Content Connector allows you to use SSO through an external IdP for authentication. This integration also allows you implement authentication yourself using 3 available authentication types:
The Token Endpoint can be defined as needed. The standard https://example.com/oauth/token is the default.
More information about Authentication Endpoints and options can be found in the Templafy GitHub documentation.
Header value:
- Authorization: Will contain the access_token retrieved during authentication in the format: “Bearer ACCESS_TOKEN”
Query Parameters:
- contentType (string): Will specify what type of content is being requested. Possible values are image / textElement / slide / slideElement / pdf / emailElement
- limit (integer): Limits the amount of items to return.
- skip (integer): Skip the first x items, used for paging.
- parentId (string, optional): Id of the parent folder to be used to filter results.
- search (string, optional): Content to search for, contains the users search string.
Response:
- contentCount (integer): Total number of results
- offset (integer): Current offset
-
content: Array of objects containing:
- id (string): ID of the image
-
mimeType (string): Mime type of the content. Can be of type
- application/vnd.templafy.folder
- image/jpeg
- image/jpg
- image/png
- image/bmp
- image/tif
- image/tiff
- image/x-ms-bmp
- image/svg+xml
- image/gif
- application/pdf
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- application/vnd.openxmlformats-officedocument.presentationml.presentation
- previewUrl (string): Link to a thumbnail size image signed with short life signature. Should be publicly accessible
- name (string): Name of the asset
- tags (string): Tags of the asset. Separated by a comma “,”
{
"contentCount": "32",
"offset": "12",
"content": [
{
"mimeType": "application/vnd.templafy.folder",
"name": "Test folder",
"id": "efjh23j4hjk23h4234"
},
{
"id": "472364786327468723",
"mimeType": "image/png",
"name": "Templafy logo.png",
"previewUrl": "Public SAS link",
"tags": "Tag1, tag2",
}
]
}
Header value:
- Authorization: Will contain the access_token retrieved previously in this format: “Bearer ACCESS_TOKEN”
URL Path parameter:
- contentId (string): Id of the content
Response:
- downloadUrl (string): Generated shared access link to the full size content.
{
"downloadUrl": "https://linktocontent.com/?token=shortlivedsecuretoken"
}
ImportantOnce the API is ready, in order to finalize the linkage between Templafy and the external DAM, the final configuration must be made in the Templafy Admin center. |
Comments
Article is closed for comments.