go-rest-api icon indicating copy to clipboard operation
go-rest-api copied to clipboard

HSM can not include components

Open ymmooot opened this issue 2 years ago • 1 comments

Hi, I would like to send HSM having components. The raw json is like below.

{
  "to": "{number}",
  "from": "{channel}",
  "type": "hsm",
  "content": {
    "hsm": {
      "namespace": "{namespace},
      "templateName": "{template_name}",
      "language": {
        "code": "id"
      },
      "components": [
        {
          "type": "body",
          "parameters": [
            {
              "type": "text",
              "text": "some text here"
            },
            {
              "type": "button",
              "sub_type": "url",
              "index": 0,
              "parameters": [
                {
                  "type": "text",
                  "text": "button text"
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

However, conversation.HSM type does not seem to have a way to set the components. How to do it?

ymmooot avatar Jun 30 '23 02:06 ymmooot

I have created my own HSM type and used Request of messagebird.DefaultClient to send components as a workaround. I still want the HSM containing the components to send it with conversation.SendMessage.

ymmooot avatar Jul 04 '23 02:07 ymmooot