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

json: cannot unmarshal number into Go struct field Segment.segments.id of type string #62

Open
alexflint opened this issue Apr 24, 2024 · 0 comments

Comments

@alexflint
Copy link

Looks like mailchimp API is serving integer tag IDs, and gochimp3 is using strings to represent tag IDs. To reproduce:

	mailchimp := gochimp3.New(os.Getenv("MAILCHIMP_API_KEY"))

	list, err := mailchimp.GetList(mailchimpAudienceID, nil)
	if err != nil {
		return err
	}

	segments, err := list.GetSegments(&gochimp3.SegmentQueryParams{})
	if err != nil {
		return err
	}

	for _, seg := range segments.Segments {
		log.Println(seg.ID, seg.Name)
	}
	return nil

Output is:

json: cannot unmarshal number into Go struct field Segment.segments.id of type string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant