Articles in this section

How to build a Custom Content Connector API

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

  Important

All 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.

 

Authentication

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.

 

GET /content
API endpoint that Templafy will request to the external service in order to get the content of a specific folder (or the root), that should be shown in the Templafy interface. If the external service doesn’t have folders, it’s not needed to return any folders. Any folders should be returned first in the list.

 

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:

 

Response Schema Response Example
  • 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 “,”
GET /content/{contentId}/download-url
API endpoint that Templafy will request to the external service in order to get the download Url of a specific asset which will then be downloaded by Templafy and given to the user.

 

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:

 

Response Schema Response Example
  • downloadUrl (string): Generated shared access link to the full size content.

  Important

Once 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.

add-ins addins Salesforce add ins adaptive section tech_role
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.