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

members.json request is not right #33

Closed
Icedroid opened this issue Feb 2, 2015 · 1 comment
Closed

members.json request is not right #33

Icedroid opened this issue Feb 2, 2015 · 1 comment
Assignees
Labels

Comments

@Icedroid
Copy link

Icedroid commented Feb 2, 2015

func (mg *MailgunImpl) CreateMemberList(s *bool, addr string, newMembers []interface{}) error {
    r := simplehttp.NewHTTPRequest(generateMemberApiUrl(listsEndpoint, addr) + ".json")
    r.SetBasicAuth(basicAuthUser, mg.ApiKey())
    p := simplehttp.NewFormDataPayload()
    if s != nil {
        p.AddValue("subscribed", yesNo(*s))
    }
    bs, err := json.Marshal(newMembers)
    if err != nil {
        return err
    }
    fmt.Println(string(bs))
    p.AddValue("members", string(bs))
    _, err = makePostRequest(r, p)
    return err
}

in the api document, no subscribed form value, you should change to same the api docuemnt. change subscribed to upsert。

p.AddValue("subscribed", yesNo(*s))
=>
p.AddValue("upsert", yesNo(s))

@mbanzon mbanzon added the bug label Feb 2, 2015
@mbanzon
Copy link
Collaborator

mbanzon commented Feb 2, 2015

It looks like this has changed in the API and the library should be updated accordingly.

@mbanzon mbanzon self-assigned this Jul 10, 2016
@mbanzon mbanzon modified the milestone: APIv3 Jul 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants