- Create a template in project
List all templates in project
List all templates for a specific name
Delete template by name
Get template in project
Delete template by name and language
Update a template in project
Lists activities on project template
Creates a comment for a template
Compare two templates
Synchronize templates for project
Create a template in proj...
Creates a new template with the request data. If the status field is set to submit the template will be created immediately, otherwise it will be saved as a draft.
Security
BasicAuth and BearerAuth and OAuth2Production
The unique ID of the project. You can find this on the Sinch Dashboard.
Template data
'Template input details and information.' Not required for draft.
Create as draft or submit. Defaults to submit.
Default:"SUBMIT"
Enum:"DRAFT""SUBMIT"
Flag to save template as draft if submission fails. Defaults to false.
Default:false
- Production serverhttps://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates
Full body to create a Marketing or Utility template.
curl -i -X POST \
-u '<username>:<password>' \
'https://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"name": "my_template",
"category": "MARKETING",
"language": "EN",
"details": {
"components": [
{
"type": "HEADER",
"format": "LOCATION"
},
{
"type": "HEADER",
"format": "TEXT",
"text": "Save {{1}}% on your next purchase!",
"example": "20"
},
{
"type": "HEADER",
"format": "DOCUMENT",
"example": {
"url": "https://example.com/photos/1.png"
}
},
{
"type": "BODY",
"text": "Good morning {{1}}, your package has arrived.",
"examples": [
"Mr. Smith"
],
"addSecurityRecommendation": true
},
{
"type": "FOOTER",
"text": "To track your order please click the '\''Track Your Order'\'' button",
"codeExpirationMinutes": 5
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "PHONE_NUMBER",
"text": "Example text.",
"phoneNumber": "+48 777 777777"
},
{
"type": "URL",
"text": "Example test",
"url": "https://www.my-website.com?name={{1}}",
"example": "https://www.my-website.com?name=john"
},
{
"type": "QUICK_REPLY",
"text": "Track Your Order"
},
{
"type": "OTP",
"otpType": "COPY_CODE",
"text": "Example text."
},
{
"type": "FLOW",
"text": "Start Flow",
"flowId": "flow-id",
"navigateScreen": "QUESTION_ONE",
"flowAction": "NAVIGATE"
},
{
"type": "REQUEST_CONTACT_INFO"
}
]
},
{
"type": "CAROUSEL",
"cards": [
{
"components": [
{
"type": "HEADER",
"format": "IMAGE",
"example": {
"url": "https://example.com/photos/1.png"
}
},
{
"type": "BODY",
"text": "Good morning {{1}}, your package has arrived.",
"examples": [
"Mr. Smith"
]
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Example test",
"url": "https://www.my-website.com?name={{1}}",
"example": "https://www.my-website.com?name=john"
},
{
"type": "QUICK_REPLY",
"text": "Track Your Order"
},
{
"type": "PHONE_NUMBER",
"text": "Example text.",
"phoneNumber": "+48 777 777777"
}
]
}
]
}
]
}
]
}
}'Created template
Enum:"AUTHENTICATION""MARKETING""UTILITY""UNRECOGNIZED"
Rejection code if template is in status 'REJECTED'
Enum:"ABUSIVE_CONTENT""INCORRECT_CATEGORY""INVALID_FORMAT""NONE""SCAM""UNRECOGNIZED"
Quality score of the HSM.
Enum:"QUALITY_SCORE_GREEN""QUALITY_SCORE_RED""QUALITY_SCORE_YELLOW""QUALITY_SCORE_UNKNOWN""UNRECOGNIZED"
Object containing changes on the template. If empty the changes has been approved and applied to the template.
Response
Response when successfully creating a template.
{ "name": "My WhatsApp Template", "category": "UTILITY", "language": "EN_US", "qualityScore": "QUALITY_SCORE_GREEN", "changes": { "status": "DRAFT", "details": { … } }, "analytics": [], "isMetaGenerated": false }
We'd love to hear from you!
Rate this content: