| POST | /unsubscribe | Unsubscribe an email from onboarding and similar campaign messages. | No authentication required. |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class UnsubscribeEmailTopic
{
/**
* The email address to unsubscribe.
*/
@ApiMember(Description="The email address to unsubscribe.", IsRequired=true)
public String Email = null;
/**
* Configuration set identifier used when sending the email.
*/
@ApiMember(Description="Configuration set identifier used when sending the email.", IsRequired=true)
public String ConfigurationSet = null;
/**
* Topic identifier used when sending the email.
*/
@ApiMember(Description="Topic identifier used when sending the email.", IsRequired=true)
public String Topic = null;
/**
* Verification token from the unsubscribe link.
*/
@ApiMember(Description="Verification token from the unsubscribe link.", IsRequired=true)
public String Token = null;
public String getEmail() { return Email; }
public UnsubscribeEmailTopic setEmail(String value) { this.Email = value; return this; }
public String getConfigurationSet() { return ConfigurationSet; }
public UnsubscribeEmailTopic setConfigurationSet(String value) { this.ConfigurationSet = value; return this; }
public String getTopic() { return Topic; }
public UnsubscribeEmailTopic setTopic(String value) { this.Topic = value; return this; }
public String getToken() { return Token; }
public UnsubscribeEmailTopic setToken(String value) { this.Token = value; return this; }
}
public static class UnsubscribeEmailTopicResponse
{
public String Email = null;
public String ConfigurationSet = null;
public String Topic = null;
public Boolean Unsubscribed = null;
public String getEmail() { return Email; }
public UnsubscribeEmailTopicResponse setEmail(String value) { this.Email = value; return this; }
public String getConfigurationSet() { return ConfigurationSet; }
public UnsubscribeEmailTopicResponse setConfigurationSet(String value) { this.ConfigurationSet = value; return this; }
public String getTopic() { return Topic; }
public UnsubscribeEmailTopicResponse setTopic(String value) { this.Topic = value; return this; }
public Boolean isUnsubscribed() { return Unsubscribed; }
public UnsubscribeEmailTopicResponse setUnsubscribed(Boolean value) { this.Unsubscribed = value; return this; }
}
}
Java UnsubscribeEmailTopic DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /unsubscribe HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UnsubscribeEmailTopic xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<ConfigurationSet>String</ConfigurationSet>
<Email>String</Email>
<Token>String</Token>
<Topic>String</Topic>
</UnsubscribeEmailTopic>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <UnsubscribeEmailTopicResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <ConfigurationSet>String</ConfigurationSet> <Email>String</Email> <Topic>String</Topic> <Unsubscribed>false</Unsubscribed> </UnsubscribeEmailTopicResponse>