Download OpenAPI specification:Download
The Template Management API offers a way to manage templates that can be used together with the Conversation API.
One can view a template as a pre-defined message that can optionally contain some parameters to facilitate some customization of the pre-defined message. This feature can, for instance, be used to construct a generic customer welcome message where the customer's name can be injected via a parameter. It's also possible to provide translations to different languages when creating a template to make it possible to reuse one template for different languages.
The first step towards interacting with the Template Management API is to create an account on the Sinch Portal. The next step is to create an Access Key under the Settings tab and note down the provided Key ID and Key Secret in a secure location. Also make sure to remember the Project ID since your template will be placed under the provided Project ID.
The Key ID and the Key Secret are then used in the following way to obtain a valid OAuth2 Access Token that will be used to authenticate towards the Template Management API.
curl https://us.auth.sinch.com/oauth2/token -d grant_type=client_credentials --user <key_id>:<key_secret>
The obtained Access Token is then used in the following way to interact with the Template Management API:
curl https://us.template.api.sinch.com/v1/projects/<Project ID>/templates -H "Authorization: Bearer <Access Token>"
Note that the obtained token above is only valid when interacting with the Template Management API in the US region. Another Access Token must be obtained from the FQDN eu.auth.sinch.com to interact with the Template Management API in the EU region(FQDN eu.template.api.sinch.com).