Skip to content
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

Issue in go import #166

Closed
Vikram-ksingh opened this issue May 25, 2022 · 8 comments
Closed

Issue in go import #166

Vikram-ksingh opened this issue May 25, 2022 · 8 comments
Labels
status: help wanted requesting help from the community type: docs update documentation change not affecting the code

Comments

@Vikram-ksingh
Copy link

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
@avstrong
Copy link

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)

@beebzz
Copy link

beebzz commented May 27, 2022

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 beebzz added status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels May 27, 2022
@encryptblockr
Copy link

@beebzz

can you also please update "official" documentation guides? thanks

https://www.twilio.com/docs/libraries/go

https://www.twilio.com/blog/send-sms-30-seconds-golang

@encryptblockr
Copy link

encryptblockr commented Jun 9, 2022

@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

@encryptblockr
Copy link

encryptblockr commented Jun 9, 2022

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

@rakatyal
Copy link
Contributor

rakatyal commented Jun 9, 2022

@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.

@rakatyal rakatyal added the type: docs update documentation change not affecting the code label Jun 9, 2022
@JenniferMah JenniferMah added status: work in progress Twilio or the community is in the process of implementing and removed status: waiting for feedback waiting for feedback from the submitter labels Jul 12, 2022
@JenniferMah
Copy link
Contributor

This work is captured in the internal ticket DI-2157

@childish-sambino childish-sambino added status: help wanted requesting help from the community and removed status: work in progress Twilio or the community is in the process of implementing type: question question directed at the library labels Jul 21, 2022
@rakatyal
Copy link
Contributor

The documentation should be updated now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: docs update documentation change not affecting the code
Projects
None yet
Development

No branches or pull requests

7 participants