I try to send message to Bot Connector service. First of all I have successfully log in to the MSA/AAD v2 service and retrieve a token.
For example I received: {"token_type":"Bearer","expires_in":3599,"ext_expires_in":0,"access_token":"eyJ0eXAi...}
so my next step is send this token to the Bot Connector service and I try to send message use next url and header
POST /v3/conversations/12345/activities/67890
Authorization: Bearer eyJ0eXAi...
but, I received next response
{"code":"InvalidContent","message":"Invalid JSON: Unexpected token
in JSON at position 77"}
with status code 400.
My code sample
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
if err != nil {
fmt.Println(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", token)
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
resp, err := client.Do(req)
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close()
What I am doing wrong?