Logo Site EngageLab Mark Colored TransparentDocument
Search

Get Template Detail

Request URL

GET https://otp.api.engagelab.cc/v1/template-configs/{templateId}

Authentication

Please refer to Authentication to learn how to perform API authentication.

Request

Request Parameters

{templateId} in the URL represents the template ID to be obtained, which is defined by the caller when calling the create template interface.

Request Example

Request Header

GET /v1/template-configs/{templateId} HTTP/1.1 Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0
              
              GET /v1/template-configs/{templateId}  HTTP/1.1
Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0

            
This code block in the floating window

Request Body

None

Response

Response Parameters

Returns a JSON object containing detailed configuration information of the template.

Response Example

Success Response

{ "template_id": "test-template-1", // Custom template id, unique within the application "description": "Test template 1", // Description of the template "send_channel_strategy": "whatsapp|sms",// Template delivery strategy, supports whatsapp/sms/voice/email. Combined strategies use the | character to indicate fallback on failure "brand_name": "Brand Name", // Brand name, used for signatures in template content in some countries/regions (e.g., some countries require registered signatures in the SMS channel) "verify_code_config": { // Verification code configuration, used to configure automatically generated verification codes, returned when the template contains a verification code type "verify_code_type": 1, // Verification code type, value range [1,7] "verify_code_len": 6, // Verification code length, value range [4,10] "verify_code_ttl": 1 // Verification code validity period, value range [1,10], note that when the strategy includes whatsapp, the value can only be 1, 5, 10 }, "whatsapp_config": { // whatsapp strategy configuration, returned when the delivery strategy includes whatsapp "template_type": 1 // whatsapp template type, currently only supports default template, fixed value is 1 }, "sms_config": { // sms strategy configuration, returned when the delivery strategy includes sms "template_type": 2, // sms template type, values: 1-default template/2-custom template "template_parts": 1, // Estimated billing parts for sms template, if the template is too long, the specific price = billing parts * billing unit price "template_custom_config": { // sms custom template configuration, valid when sms template type is custom template "custom_sub_type": "authentication", // Custom template type, values: authentication/marketing/utility "custom_content": "xxx" // Custom template content, note that if the sub-type is authentication, it must contain the {{code}} variable } }, "voice_config": { // voice strategy configuration, returned when the delivery strategy includes voice "template_type": 1 // voice template type, currently only supports default template, fixed value is 1 }, "email_config": { // email strategy configuration, returned when the delivery strategy includes email "template_name": "email template name", // email template name "template_custom_configs": [{ // email custom template configuration, valid when email template type is custom template, note this is an object array, mainly used to configure multiple languages via language "language": "default", // Language, default is default, different template content can be matched according to the language parameter during message delivery "pre_from_name": "test", // Preset sender name "pre_from_mail": "test@test.com",// Preset sender email "pre_subject": "test", // Preset email subject "template_content": "Preset email template content, required, custom variables like {{self}}, verification code is {{code}}", // Email content, supports html, variables need to be enclosed in double braces {{}} "pre_param_map": { // Default values for variables in email content, i.e., if variable values are not specified during delivery, the following default values will be used to replace variables, declared as key-value pairs "self": "Here is the preset value for the self variable" } }] }, "pwa_config": { // pwa related configuration, returned only when there is pwa configuration "pwa_platform": "xx", // pwa platform used "pwa_code": "xx" // code in the pwa platform used }, "created_time": 1234567890, // Creation time of the template, timestamp format, accurate to seconds "status": 1, // Template status, values: 1-pending review/2-approved/3-rejected "audit_remark": "xx" // Audit remark, generally when the audit is rejected, you can check this field for the rejection reason }
              
              {
    "template_id": "test-template-1",       // Custom template id, unique within the application
    "description": "Test template 1",       // Description of the template
    "send_channel_strategy": "whatsapp|sms",// Template delivery strategy, supports whatsapp/sms/voice/email. Combined strategies use the | character to indicate fallback on failure
    "brand_name": "Brand Name",             // Brand name, used for signatures in template content in some countries/regions (e.g., some countries require registered signatures in the SMS channel)
    "verify_code_config": {                 // Verification code configuration, used to configure automatically generated verification codes, returned when the template contains a verification code type
        "verify_code_type": 1,              // Verification code type, value range [1,7]
        "verify_code_len": 6,               // Verification code length, value range [4,10]
        "verify_code_ttl": 1                // Verification code validity period, value range [1,10], note that when the strategy includes whatsapp, the value can only be 1, 5, 10
    },
    "whatsapp_config": {                    // whatsapp strategy configuration, returned when the delivery strategy includes whatsapp
        "template_type": 1                  // whatsapp template type, currently only supports default template, fixed value is 1
    },
    "sms_config": {                         // sms strategy configuration, returned when the delivery strategy includes sms
        "template_type": 2,                 // sms template type, values: 1-default template/2-custom template
        "template_parts": 1,                // Estimated billing parts for sms template, if the template is too long, the specific price = billing parts * billing unit price
        "template_custom_config": {         // sms custom template configuration, valid when sms template type is custom template
            "custom_sub_type": "authentication", // Custom template type, values: authentication/marketing/utility
            "custom_content": "xxx"         // Custom template content, note that if the sub-type is authentication, it must contain the {{code}} variable
        }
    },
    "voice_config": {                       // voice strategy configuration, returned when the delivery strategy includes voice
        "template_type": 1                  // voice template type, currently only supports default template, fixed value is 1
    },
    "email_config": {                       // email strategy configuration, returned when the delivery strategy includes email
        "template_name": "email template name", // email template name
        "template_custom_configs": [{       // email custom template configuration, valid when email template type is custom template, note this is an object array, mainly used to configure multiple languages via language
            "language": "default",          // Language, default is default, different template content can be matched according to the language parameter during message delivery
            "pre_from_name": "test",        // Preset sender name
            "pre_from_mail": "test@test.com",// Preset sender email
            "pre_subject": "test",          // Preset email subject
            "template_content": "Preset email template content, required, custom variables like {{self}}, verification code is {{code}}", // Email content, supports html, variables need to be enclosed in double braces {{}}
            "pre_param_map": {              // Default values for variables in email content, i.e., if variable values are not specified during delivery, the following default values will be used to replace variables, declared as key-value pairs
                "self": "Here is the preset value for the self variable"
            }
        }]
    },
    "pwa_config": {                         // pwa related configuration, returned only when there is pwa configuration
        "pwa_platform": "xx",               // pwa platform used
        "pwa_code": "xx"                    // code in the pwa platform used
    },
    "created_time": 1234567890,             // Creation time of the template, timestamp format, accurate to seconds
    "status": 1,                            // Template status, values: 1-pending review/2-approved/3-rejected
    "audit_remark": "xx"                    // Audit remark, generally when the audit is rejected, you can check this field for the rejection reason
}

            
This code block in the floating window

Failure Response

{ "code": 4001, "message": "config not exist" }
              
              {
    "code": 4001,
    "message": "config not exist"
}

            
This code block in the floating window

Error Codes

Error Code HTTP Code Description
1000 500 Internal error
2001 401 Authentication failed, incorrect token carried
2002 401 Authentication failed, token has expired or been disabled
2004 403 No permission to call this API
4001 400 Template does not exist
Icon Solid Transparent White Qiyu
Contact Sales