RCS Templates

Create an RCS template

post/rcs/template

Request

  • Base URL
    https://rcs-api.in.kaleyra.io/v1/XXXXX6913850XXXX
  • URL
    https://rcs-api.in.kaleyra.io/v1/XXXXX6913850XXXX/rcs/template
  • Auth
    none declared. Required headers: Content-Type, api-key

Headers

Content-Type'application/json' required

Indicates the format of the content the API will process. The documented value is application/json.

api-keystring required

API key generated from the Kaleyra account.

Request body

agent_numberstring required

Agent Number of the agent under which the template is created.

template_type'1' | '3' | '4' | '5' required

Template type. 1 is Text, 3 is File, 4 is Rich Card Standalone, and 5 is Rich Card Carousel.

template_namestring required

Unique template name. Maximum 20 characters including alphanumeric characters and underscore. Space is not allowed.

textstring

Text message to send to end users. Maximum 2000 characters. Conditional when template_type is 1.

status'DRAFT' | 'CREATED' | 'SUBMITTEDFORAPPROVAL' | 'ACTIVE' | 'FAILED' | 'DELETED' required

Template status. DRAFT can be edited. CREATED can be edited until ACTIVE. SUBMITTEDFORAPPROVAL indicates submission to the carrier. ACTIVE templates can be used for messaging and cannot be edited. FAILED and DELETED are documented workflow states.

Example request

{
  "agent_number": "116XX2",
  "template_name": "doc_test_demo",
  "contentMessage": {
    "suggestions": [
      {
        "action": {
          "text": "Contact",
          "postback_data": "Contact",
          "dial_action": {
            "phone_number": "+9177XXXXXX77"
          },
          "open_url_action": {
            "url": "https://demo.test.in/en/homepage-quick-bill-payment/",
            "application": "WEBVIEW",
            "webview_view_mode": "FULL"
          }
        },
        "reply": {
          "text": "Test reply text11",
          "postback_data": "Test postback data11"
        }
      }
    ]
  },
  "file": {
    "file_url": "https://example.com/document.pdf",
    "thumbnail_url": "https://example.com/thumb.jpg",
    "content_description": "File description"
  },
  "rich_card_standalone": {
    "card_orientation": "VERTICAL",
    "thumbnail_image_alignment": "LEFT",
    "content": {
      "title": "Card Title",
      "description": "Card description text",
      "media": {
        "height": "MEDIUM",
        "file": {
          "file_url": "https://example.com/document.pdf",
          "thumbnail_url": "https://example.com/thumb.jpg",
          "content_description": "File description"
        }
      },
      "suggestions": [
        {
          "action": {
            "text": "Contact",
            "postback_data": "Contact",
            "dial_action": {
              "phone_number": "+9177XXXXXX77"
            },
            "open_url_action": {
              "url": "https://demo.test.in/en/homepage-quick-bill-payment/",
              "application": "WEBVIEW",
              "webview_view_mode": "FULL"
            }
          },
          "reply": {
            "text": "Test reply text11",
            "postback_data": "Test postback data11"
          }
        }
      ]
    }
  },
  "rich_card_carousel": {
    "card_width": "MEDIUM",
    "card_contents": [
      {
        "title": "Sample Title1",
        "description": "Sample Description1",
        "media": {
          "height": "MEDIUM",
          "file": {
            "file_url": "https://example.com/document.pdf",
            "thumbnail_url": "https://example.com/thumb.jpg",
            "content_description": "File description"
          }
        },
        "suggestions": [
          {
            "reply": {
              "text": "Test reply text11",
              "postback_data": "Test postback data11"
            }
          }
        ]
      }
    ]
  }
}

Response

RCS Template created successfully.

codestring
messagestring
errorobject

Example response

{
  "code": "RCS1102",
  "message": "RCS Template created successfully",
  "data": {
    "contentMessage": {
      "suggestions": [
        {
          "action": {
            "text": "Contact",
            "postback_data": "Contact",
            "dial_action": {
              "phone_number": "+9177XXXXXX77"
            },
            "open_url_action": {
              "url": "https://demo.test.in/en/homepage-quick-bill-payment/",
              "application": "WEBVIEW",
              "webview_view_mode": "FULL"
            }
          },
          "reply": {
            "text": "Test reply text11",
            "postback_data": "Test postback data11"
          }
        }
      ]
    },
    "file": {
      "file_url": "https://example.com/document.pdf",
      "thumbnail_url": "https://example.com/thumb.jpg",
      "content_description": "File description"
    },
    "rich_card_standalone": {
      "card_orientation": "VERTICAL",
      "thumbnail_image_alignment": "LEFT",
      "content": {
        "title": "Card Title",
        "description": "Card description text",
        "media": {
          "height": "MEDIUM",
          "file": {
            "file_url": "https://example.com/document.pdf",
            "thumbnail_url": "https://example.com/thumb.jpg",
            "content_description": "File description"
          }
        },
        "suggestions": [
          {
            "action": {
              "text": "Contact",
              "postback_data": "Contact",
              "dial_action": {
                "phone_number": "+9177XXXXXX77"
              },
              "open_url_action": {
                "url": "https://demo.test.in/en/homepage-quick-bill-payment/",
                "application": "WEBVIEW",
                "webview_view_mode": "FULL"
              }
            },
            "reply": {
              "text": "Test reply text11",
              "postback_data": "Test postback data11"
            }
          }
        ]
      }
    },
    "rich_card_carousel": {
      "card_width": "MEDIUM",
      "card_contents": [
        {
          "title": "Sample Title1",
          "description": "Sample Description1",
          "media": {
            "height": "MEDIUM",
            "file": {
              "file_url": "https://example.com/document.pdf",
              "thumbnail_url": "https://example.com/thumb.jpg",
              "content_description": "File description"
            }
          },
          "suggestions": [
            {
              "reply": {
                "text": "Test reply text11",
                "postback_data": "Test postback data11"
              }
            }
          ]
        }
      ]
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.