Logo Site EngageLab Mark Colored TransparentDokumentation
Suchen

Vorlagendetails abrufen

Anfrage-URL

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

Authentifizierung

Bitte lesen Sie Authentifizierung, um zu erfahren, wie Sie die API-Authentifizierung durchführen.

Anfrage

Anfrageparameter

{templateId} in der URL steht für die abzurufende Vorlagen-ID, die vom Aufrufer beim Aufruf der Schnittstelle zum Erstellen einer Vorlage definiert wurde.

Anfragebeispiel

Anfrage-Header

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

            
Diesen Codeblock im schwebenden Fenster anzeigen

Anfragetext

Keiner

Antwort

Antwortparameter

Gibt ein JSON-Objekt zurück, das die detaillierten Konfigurationsinformationen der Vorlage enthält.

Antwortbeispiel

Erfolgsantwort

{ "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
}

            
Diesen Codeblock im schwebenden Fenster anzeigen

Fehlerantwort

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

            
Diesen Codeblock im schwebenden Fenster anzeigen

Fehlercodes

Fehlercode HTTP-Code Beschreibung
1000 500 Interner Fehler
2001 401 Authentifizierung fehlgeschlagen, falsches Token übermittelt
2002 401 Authentifizierung fehlgeschlagen, Token ist abgelaufen oder deaktiviert
2004 403 Keine Berechtigung zum Aufruf dieser API
4001 400 Vorlage existiert nicht
Icon Solid Transparent White Qiyu
Vertrieb kontaktieren