-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add conversations example #63
base: main
Are you sure you want to change the base?
Conversation
I used the following code to try and reproduce the error message we see in terraform, but the following produces no error: package main
import (
"encoding/json"
"fmt"
"os"
twilio "github.com/twilio/twilio-go"
conversations "github.com/twilio/twilio-go/rest/conversations/v1"
)
func main() {
accountSid := os.Getenv("TWILIO_ACCOUNT_SID")
authToken := os.Getenv("TWILIO_AUTH_TOKEN")
client := twilio.NewRestClient(accountSid, authToken)
conversation_params := &conversations.CreateConversationParams{}
conversation_params.SetFriendlyName("Conversation 00")
resp0, err := client.ConversationsV1.CreateConversation(conversation_params)
if err != nil {
fmt.Println(err.Error())
err = nil
} else {
response, _ := json.Marshal(*resp0)
fmt.Println("Response: " + string(response))
}
participant_00_params := &conversations.CreateConversationParticipantParams{}
participant_00_params.SetMessagingBindingAddress(<User 00 Personal Mobile Number>)
participant_00_params.SetMessagingBindingProxyAddress(<Your purchased Twilio Phone Number>)
resp1, err := client.ConversationsV1.CreateConversationParticipant(*resp0.Sid, participant_00_params)
if err != nil {
fmt.Println(err.Error())
err = nil
} else {
response, _ := json.Marshal(*resp1)
fmt.Println("Response: " + string(response))
}
participant_01_params := &conversations.CreateConversationParticipantParams{}
participant_01_params.SetMessagingBindingAddress(<User 01 Personal Mobile Number>)
participant_01_params.SetMessagingBindingProxyAddress(<Your purchased Twilio Phone Number>)
resp2, err := client.ConversationsV1.CreateConversationParticipant(*resp0.Sid, participant_01_params)
if err != nil {
fmt.Println(err.Error())
err = nil
} else {
response, _ := json.Marshal(*resp2)
fmt.Println("Response: " + string(response))
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm able to produce the same error using your example code. Did the conversations team say what a 50441
error means?
No, I was asked to try and reproduce with cURL. I did that and also with |
Circling back with the conversations team for additional guidance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the same error but I also see that the channel and the participants in fact do get created. Probably a bug in our tf provider.
hi 👋 I was looking through the provider and the team has done a really good job on the provider. After you add/ create a participant to a conversation you immediately call the updateConversationsParticipants function as seen here. The update participant API call is returning the error I'm not 100% clear on why the update participant call is returning this error but if you don't call the
then no error is thrown and the provider continues executing successfully. Although, if you modify the This is also reproducible using the Go SDK with the following code. The code below has been slightly adapted from the example you shared. Now it only configures 1 participant and uses the updated
Hope this helps |
Thank you for taking a look and providing awesome feedback @RJPearson94! With respect to "Although, if you modify the |
Hi @thinkingserious. I have included the steps to reproduce this issue below. Apologies, I should have included it in my original message. When I said, "Although, if you modify the messaging_binding_proxy_address argument to use another Twilio phone number" I meant that once you have provisioned your conversation and 1 or more participants using Terraform. If you make a change to one of your Steps to ReproduceThese steps assume that there is no pre-existing Terraform state and resources deployed.
Note: this is not limited to just modifying the Figure 1
Figure 2
Figure 3
|
Thank you @RJPearson94, fantastic explanation! Very much appreciated!! I'm circling back with the conversations API team to help determine the best path forward. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Checklist
When running the
terraform apply
you will receive the following error; however, the error is not correct. Meaning, the demo works as expected.