GithubHelp home page GithubHelp logo

Issue in go import about twilio-go HOT 8 CLOSED

twilio avatar twilio commented on September 8, 2024
Issue in go import

from twilio-go.

Comments (8)

avstrong avatar avstrong commented on September 8, 2024

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)

from twilio-go.

beebzz avatar beebzz commented on September 8, 2024

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.

from twilio-go.

encryptblockr avatar encryptblockr commented on September 8, 2024

@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

from twilio-go.

encryptblockr avatar encryptblockr commented on September 8, 2024

@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

from twilio-go.

encryptblockr avatar encryptblockr commented on September 8, 2024

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

from twilio-go.

rakatyal avatar rakatyal commented on September 8, 2024

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

from twilio-go.

JenniferMah avatar JenniferMah commented on September 8, 2024

This work is captured in the internal ticket DI-2157

from twilio-go.

rakatyal avatar rakatyal commented on September 8, 2024

The documentation should be updated now.

from twilio-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.