Mailgun API调用“未找到邮件列表成员”

时间:2014-02-07 14:51:09

标签: vb.net api mailgun

当我调用DELETE时,我收到“找不到邮件列表成员”,然后测试了PUT,尝试更新订阅设置,我收到相同的消息。

但是当我尝试将带有POST的人添加到具有相同电子邮件地址的列表时,我得到了“地址已存在”消息....使用相同的API和结构:

Public Function RemoveMember(ListEmail As String, EmailAddress As String) As RestResponse
    Dim client As New RestClient()
    client.BaseUrl = "https://api.mailgun.net/v2"
    client.Authenticator = New HttpBasicAuthenticator("api", MailGunAPI)
    Dim request As New RestRequest()
    request.Resource = "lists/{list}/members/{member}"
    request.AddParameter("list", ListEmail, ParameterType.UrlSegment)
    request.AddParameter("member", EmailAddress)
    request.Method = Method.DELETE
    Return client.Execute(request)
End Function

1 个答案:

答案 0 :(得分:1)

在member参数上,需要将参数类型指定为UrlSegment:

request.AddParameter("member", EmailAddress, ParameterType.UrlSegment)