Closed mauricioklein closed 5 years ago
Hello! I'll start by saying there's definitely some work to be done on this library - a lot of these structs were autogenerated by a script to get things up and running.
I think in this case (and your error message seems to agree) that the problem isn't being caused by your To
value, it's being caused by your From
value.
To
should be an array of PhoneCallEndpoint
s in this case, and From
should be a single PhoneCallEndpoint
. Something more like:
callReq := nexmo.CreateCallRequest{
To: []interface{}{
nexmo.PhoneCallEndpoint{
Type: "phone",
Number: myPhoneNumber,
},
},
From: nexmo.PhoneCallEndpoint{
Type: "phone",
Number: "1234567890",
},
AnswerURL: []string{"https://nexmo-community.github.io/ncco-examples/first_call_talk.json"},
}
Hello!
Thanks for your work on this library 😄
I'm having problems setting up a voice call using the library. The problem is in the
To
attribute, which I don't understand why is a[]interface{}
.Here's what I've currently:
Already tried the phone number directly:
But always get an error related to marshaling the
To
attribute:Could you post an example of a voice call, please?
Thanks in advance for your support!