Skip to content

Get template in project
GA

Request

Returns a template for a project, with the specified name and language.

Security
BasicAuth and BearerAuth and OAuth2Production
Path
projectIdstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

templateNamestringrequired

The unique name of the template.

languageCodestring(WhatsappTemplateLanguagesEnum)required

The language code of the specific template.

Enum:"AF""AR""AZ""BG""BN""CA""CS""DA""DE""EL"
Query
fieldMaskArray of strings(WhatsappTemplateDtoFieldMaskPathsEnum)

Field masks are a way for API callers to list the fields that a request should return.

Items Enum:"whatsappId""state""name""language""category""rejectionCode""qualityScore""changes""changes.status""changes.allowCategoryChange"
templateAnalyticsDateRangestring(WhatsappTemplateAnalyticsDateRangesEnum)

The date range to retrieve template analytics for. Fallback to DAY if none is set.

Enum:"DAY""MONTH""QUARTER""WEEK"
curl -i -X GET \
  -u '<username>:<password>' \
  'https://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates/{templateName}/languages/{languageCode}?fieldMask=whatsappId&templateAnalyticsDateRange=DAY' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Template

Bodyapplication/json
One of:
namestringrequired
languagestring(WhatsappTemplateLanguages)required
Enum:"AF""AR""AZ""BG""BN""CA""CS""DA""DE""EL"
categorystring(WhatsappTemplateCategory)required
Enum:"AUTHENTICATION""MARKETING""UTILITY""UNRECOGNIZED"
analyticsArray of objects(WhatsappTemplateAnalyticsDto)required

Template analytics.

isMetaGeneratedbooleanrequired

Indicates if the template was auto-generated by Meta.

whatsappIdstring
statestring(WhatsappTemplateStates)
Enum:"APPROVED""DISABLED""PAUSED""REJECTED"
rejectionCodestring(WhatsappTemplateRejectionCode)

Rejection code if template is in status 'REJECTED'

Enum:"ABUSIVE_CONTENT""INCORRECT_CATEGORY""INVALID_FORMAT""NONE""SCAM""UNRECOGNIZED"
qualityScorestring(WhatsappTemplateQualityScore)

Quality score of the HSM.

Enum:"QUALITY_SCORE_GREEN""QUALITY_SCORE_RED""QUALITY_SCORE_YELLOW""QUALITY_SCORE_UNKNOWN""UNRECOGNIZED"
changesobject(WhatsappTemplateChangesDto)

Object containing changes on the template. If empty the changes has been approved and applied to the template.

detailsobject(WhatsappTemplateDetailsDto)

Template details and information.

Response
{ "whatsappId": "string", "state": "APPROVED", "name": "string", "language": "AF", "category": "AUTHENTICATION", "rejectionCode": "ABUSIVE_CONTENT", "qualityScore": "QUALITY_SCORE_GREEN", "changes": { "status": "DRAFT", "allowCategoryChange": true, "details": { … } }, "details": { "components": [ … ], "messageSendTtlSeconds": 0 }, "analytics": [ { … } ], "isMetaGenerated": true }