Reputation: 671
I get the "Mailing list member not found" when I call a DELETE, I then tested a PUT, to try an update the subscription setting, and I get the same message.
But when I try to add someone with a POST to the list with the same email address I get a "Address already exists" message....using same API, and structure:
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
Upvotes: 0
Views: 680
Reputation: 330
On the member parameter the parameter type needs to be specified as UrlSegment:
request.AddParameter("member", EmailAddress, ParameterType.UrlSegment)
Upvotes: 1