Closed Vikram-ksingh closed 1 year ago
I have integrated the package but getting following error on go get
twilioClient.ApiV2010 undefined (type *twilio.RestClient has no field or method ApiV2010)
Technical details:
- twilio-go version:
- go version: 1.18.2
try to use Api instead of ApiV2010
client.Api.CreateMessage(params)
instead of
client.ApiV2010.CreateMessage(params)
Hi @Vikram-ksingh, @avstrong is correct. We recently changed the prefix for V2010 APIs to Api
from ApiV2010
in v0.26.0. Try that and let us know if you have any other questions.
@beebzz
can you also please update "official" documentation guides? thanks
@beebzz @Vikram-ksingh @avstrong
there is also this error undefined: twilio.RestClientParams
how do we fix this also?
code (following this official guide https://www.twilio.com/docs/libraries/go)
import (
...
twilio "github.com/twilio/twilio-go"
openapi "github.com/twilio/twilio-go/rest/api/v2010"
)
...
accountSid := os.Getenv("TWILIO_ACCOUNT_SID")
authToken := os.Getenv("TWILIO_AUTH_TOKEN")
client := twilio.NewRestClientWithParams(twilio.RestClientParams{
Username: accountSid,
Password: authToken,
})
error
undefined: twilio.RestClientParams
ok fixed..here are the following fix for the errors
error
#1
twilioClient.ApiV2010 undefined (type *twilio.RestClient has no field or method ApiV2010)
fix for error
#1
change ApiV2010
to Api
#####################
error
#2
undefined: twilio.RestClientParams
fix for error
#2
change twilio.RestClientParams
to twilio.ClientParams
@encryptblockr: Thanks for bringing the docs to our attention. This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog. Please let us know if we can help with anything else.
This work is captured in the internal ticket DI-2157
The documentation should be updated now.
I have integrated the package but getting following error on go get
twilioClient.ApiV2010 undefined (type *twilio.RestClient has no field or method ApiV2010)
Technical details: