# Get template in project

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

Endpoint: GET /v1/projects/{projectId}/whatsapp/templates/{templateName}/languages/{languageCode}
Version: 1.2.91
Security: BasicAuth, BearerAuth, OAuth2Production

## Security:

  - `BasicAuth` (unknown)
    http basic

  - `BearerAuth` (unknown)
    http bearer JWT

  - `OAuth2Production` (unknown)
    oauth2

## Path parameters:

  - `projectId` (string, required)
    The unique ID of the project. You can find this on the <a href="https://dashboard.sinch.com/">Sinch Dashboard</a>.

  - `templateName` (string, required)
    The unique name of the template.

  - `languageCode` (string, required)
    The language code of the specific template.

## Query parameters:

  - `fieldMask` (array)
    Field masks are a way for API callers to list the fields that a request should return.

  - `templateAnalyticsDateRange` (string)
    The date range to retrieve template analytics for. Fallback to DAY if none is set.

## Response 200:

  - `200` (unknown)
    Template

## Response 200 fields (application/json):

  - `whatsappId` (string)

  - `state` (string)
    Enum: "APPROVED", "DISABLED", "PAUSED", "REJECTED"

  - `name` (string, required)

  - `language` (string, required)
    Enum: "AF", "AR", "AZ", "BG", "BN", "CA", "CS", "DA", "DE", "EL", "EN", "EN_GB", "EN_US", "ES", "ES_AR", "ES_ES", "ES_MX", "ES_UY", "ET", "FA", "FI", "FIL", "FR", "GA", "GU", "HA", "HE", "HI", "HR", "HU", "ID", "IT", "JA", "KA", "KK", "KN", "KO", "KY_KG", "LO", "LT", "LV", "MK", "ML", "MR", "MS", "NB", "NL", "PA", "PL", "PT_BR", "PT_PT", "RO", "RU", "RW_RW", "SK", "SL", "SQ", "SR", "SV", "SW", "TA", "TE", "TH", "TR", "UK", "UR", "UZ", "VI", "ZH_CN", "ZH_HK", "ZH_TW", "ZU", "UNRECOGNIZED"

  - `category` (string, required)
    Enum: "AUTHENTICATION", "MARKETING", "UTILITY", "UNRECOGNIZED"

  - `rejectionCode` (string)
    Rejection code if template is in status 'REJECTED'
    Enum: "ABUSIVE_CONTENT", "INCORRECT_CATEGORY", "INVALID_FORMAT", "NONE", "SCAM", "UNRECOGNIZED"

  - `qualityScore` (string)
    Quality score of the HSM.
    Enum: "QUALITY_SCORE_GREEN", "QUALITY_SCORE_RED", "QUALITY_SCORE_YELLOW", "QUALITY_SCORE_UNKNOWN", "UNRECOGNIZED"

  - `changes` (object)
    Object containing changes on the template. If empty the changes has been approved and applied to the template.

  - `changes.status` (string, required)
    The current status of the changes.
`DRAFT`: The changes has not been submitted.
`IN_PROGRESS`: The changes has been submitted.
    Enum: "DRAFT", "IN_PROGRESS", "REJECTED"

  - `changes.allowCategoryChange` (boolean)
    True if Meta should be allowed to change the category if they determine the category is wrong. If false, Meta might reject the template if they determine the category is wrong based on the template contents. Defaults to false.

  - `changes.details` (any)
    Template details and information.

  - `changes.details.components` (array, required)
    List of components in the template. Must contain a BODY component and can only have one entry of each type.

  - `changes.details.components.type` (string, required)
    Enum: "HEADER"

  - `changes.details.components.format` (string, required)
    Enum: "TEXT"

  - `changes.details.components.text` (string)
    Text to show in the header

  - `changes.details.components.example` (string)
    Example for the header variable.

  - `changes.details.components.format` (string, required)
    Enum: "DOCUMENT", "IMAGE", "VIDEO"

  - `changes.details.components.example` (object)

  - `changes.details.components.example.url` (string)

  - `changes.details.components.type` (string, required)
    Enum: "BODY"

  - `changes.details.components.text` (string)

  - `changes.details.components.examples` (array)
    Examples for the body variables.

  - `changes.details.components.addSecurityRecommendation` (boolean)

  - `changes.details.components.type` (string, required)
    Enum: "FOOTER"

  - `changes.details.components.codeExpirationMinutes` (number)

  - `changes.details.components.type` (string, required)
    Enum: "BUTTONS"

  - `changes.details.components.buttons` (array, required)

  - `changes.details.components.buttons.type` (string, required)
    Enum: "PHONE_NUMBER"

  - `changes.details.components.buttons.text` (string)

  - `changes.details.components.buttons.phoneNumber` (string)

  - `changes.details.components.buttons.type` (string, required)
    Enum: "URL"

  - `changes.details.components.buttons.url` (string)

  - `changes.details.components.buttons.example` (string)

  - `changes.details.components.buttons.type` (string, required)
    Enum: "QUICK_REPLY"

  - `changes.details.components.buttons.type` (string, required)
    Enum: "OTP"

  - `changes.details.components.buttons.otpType` (string, required)
    Enum: "COPY_CODE", "ONE_TAP", "ZERO_TAP", "UNRECOGNIZED"

  - `changes.details.components.buttons.autofillText` (string)

  - `changes.details.components.buttons.packageName` (string)

  - `changes.details.components.buttons.signatureHash` (string)

  - `changes.details.components.buttons.supportedApps` (array)

  - `changes.details.components.buttons.zeroTapTermsAccepted` (boolean)

  - `changes.details.components.buttons.type` (string, required)
    Enum: "FLOW"

  - `changes.details.components.buttons.text` (string)
    Text to display on the Flow button

  - `changes.details.components.buttons.flowId` (string)
    Flow ID to launch when button is pressed

  - `changes.details.components.buttons.flowAction` (string)
    Flow action
    Enum: "DATA_EXCHANGE", "NAVIGATE", "UNKNOWN", "UNRECOGNIZED"

  - `changes.details.components.buttons.navigateScreen` (string)
    The unique ID of the first screen. Required for Navigate action.

  - `changes.details.components.buttons.type` (string, required)
    Enum: "REQUEST_CONTACT_INFO"

  - `changes.details.components.format` (string, required)
    Enum: "LOCATION"

  - `changes.details.components.type` (string, required)
    Enum: "CAROUSEL"

  - `changes.details.components.cards` (array, required)
    Media cards.

  - `changes.details.components.cards.components` (array, required)
    List of components in the cards.

  - `changes.details.messageSendTtlSeconds` (number)
    Template message delivery retry time-to-live (TTL) override value. If unable to deliver the template message, it will be periodically retry for this period of time. If it is unable to deliver the message for this period of time, the message will be dropped.
|  | AUTHENTICATION | MARKETING | UTILITY |
|  --- | --- | --- | --- |
| Default | 10 minutes | 30 days | 30 days |
| Customizable range | 10 seconds to 15 minutes | 12 hours to 30 days | 30 seconds to 12 hours |
| Valid values | 10 to 900 seconds | 43200 to 2592000 seconds | 30 to 43200 seconds |

Please note that authentication templates created before October 23, 2024, have a default TTL of 30 days.

  - `changes.details.components` (array)
    The current status of the changes.
`DRAFT`: The changes has not been submitted.
`IN_PROGRESS`: The changes has been submitted.

  - `details` (object)
    Template details and information.

  - `analytics` (array, required)
    Template analytics.

  - `analytics.sent` (number, required)
    Number of times template has been sent.

  - `analytics.delivered` (number, required)
    Number of times template has been delivered.

  - `analytics.read` (number, required)
    Number of times template has been read.

  - `analytics.start` (string, required)
    The UTC Date Time in ISO 8601 for start of date range.

  - `analytics.end` (string, required)
    The UTC Date Time in ISO 8601 for end of date range.

  - `analytics.buttons` (array, required)
    Number of times buttons in the template has been clicked.

  - `analytics.buttons.type` (string, required)
    Type of button.
    Enum: "QUICK_REPLY", "UNIQUE_URL", "URL", "UNRECOGNIZED"

  - `analytics.buttons.content` (string, required)
    Content of the button.

  - `analytics.buttons.clicks` (number, required)
    Number of times the button has been clicked.

  - `isMetaGenerated` (boolean, required)
    Indicates if the template was auto-generated by Meta.

## Response 400:

  - `400` (unknown)
    BadRequest

## Response 400 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: project_not_initialized

  - `message` (string)
    Human readable message.
    Example: Project not initialized for WhatsApp.

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: Verify that the project ID is correct and that it has been onboarded for WhatsApp.

  - `additionalInformation` (object)
    Additional information for error.
    Example: {"supportedCodes":"AF, AR, AZ, BG, BN, CA, CS, DA, DE, EL, EN, EN_GB, EN_US, ES, ES_AR, ES_ES, ES_MX, ES_UY, ET, FA, FI, FIL, FR, GA, GU, HA, HE, HI, HR, HU, ID, IT, JA, KA, KK, KN, KO, KY_KG, LO, LT,…

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: unauthorized_error

  - `message` (string)
    Human readable message.
    Example: Unauthorized error.

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: Verify that projectId is correct.

## Response 404:

  - `404` (unknown)
    NotFound

## Response 404 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: template_not_found

  - `message` (string)
    Human readable message.
    Example: Template not found.

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: Verify that the parameters are correct.

## Response 500:

  - `500` (unknown)
    InternalServerError

## Response 500 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: internal_error

  - `message` (string)
    Human readable message.
    Example: Internal server error.

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: Please wait and try again, if the error persist please contact support.

