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

Error response when sending SMS messages #130

Open
cbrake opened this issue Dec 11, 2021 · 9 comments
Open

Error response when sending SMS messages #130

cbrake opened this issue Dec 11, 2021 · 9 comments
Labels
type: twilio enhancement feature request on Twilio's roadmap

Comments

@cbrake
Copy link

cbrake commented Dec 11, 2021

Issue Summary

Yesterday when trying to send SMS messages, I got the following error:

Error sending SMS: error decoding the response for an HTTP error code: 503: invalid character '<' looking for beginning of value

This happened perhaps 6 or so times,, so I instrumented the Twilio code to get more information, but I've not been able to reproduce the issue since.

I think the error is being created here:

https://github.com/twilio/twilio-go/blob/main/client/client.go#L80

Technical details:

  • twilio-go version: v0.18.2
  • go version: 17.2

I'm in the processing of switching from github.com/kevinburke/twilio-go to this package, so would like to know if anyone else has seen this, or if its just a transient problem.

@shwetha-manvinkurke
Copy link
Contributor

Sounds like an issue on the backend but we could probably make the logging better on the helper library side. 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.

@shwetha-manvinkurke shwetha-manvinkurke added the type: twilio enhancement feature request on Twilio's roadmap label Dec 14, 2021
@fostemi
Copy link

fostemi commented Jun 20, 2024

I am receiving the same error when I'm running the tutorial. What was the solution to this error? I've been trying to get more verbose error from twilio but the best I can visualize is the parameters are incorrect because there are many values.

@cmy235
Copy link

cmy235 commented Jul 1, 2024

I had a similar issue, which was resolved once I removed the message service SID param from CreateMessageParams in the CreateMessage call. In my case it wasn't actually necessary. If you are using a messaging service SID, perhaps confirm the number you're sending from is part of that service.

@SWFullPotential
Copy link

SWFullPotential commented Jul 1, 2024

I am also experiencing this issue. Was there any fix?

creating client like so:

twilioClient := twiliogo.NewRestClientWithParams(twiliogo.ClientParams{
			Username:   cfg.Twilio.APIKey,
			Password:   cfg.Twilio.Auth,
			AccountSid: cfg.Twilio.AccountSID,
		})

followed example like so

	params := &twilioApi.CreateMessageParams{}
	params.SetTo(myphoneNumber)
	params.SetFrom(n.fromSMS)
	params.SetBody("Hello from Go!")

	resp, err := twilioClient.Api.CreateMessage(params)
	if err != nil {
		fmt.Println("Error sending SMS message: " + err.Error())
	} else {
		response, _ := json.Marshal(*resp)
		fmt.Println("Response: " + string(response))
	}

and getting that Error sending SMS message: error decoding the response for an HTTP error code: 400: invalid character '<' looking for beginning of value

@SWFullPotential
Copy link

@shwetha-manvinkurke has this been looked at ? this issue was created back in 2021 and so far i don't see a resolution.

@kevinburkesegment
Copy link

kevinburkesegment commented Jul 1, 2024

Hi all - if you can share any information about what version of the library you are running, and how you downloaded it, that would help a lot - we'd like to fix this.

import "github.com/twilio/twilio-go/client"
import "fmt"
import "runtime"

func main() {
    fmt.Println(client.LibraryVersion)
    fmt.Println(runtime.Version())
}

@SWFullPotential
Copy link

SWFullPotential commented Jul 1, 2024 via email

@kevinburkesegment
Copy link

Hi @SWFullPotential version 1.22.0 had an error and has since been retracted. Please try v1.22.2 and see if you are still experiencing problems. Thanks!

@SWFullPotential
Copy link

omg thank you.. I thought i tried that already whoops. thank you.. it's working now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: twilio enhancement feature request on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

6 participants