BokaMera.API.Host

<back to all web services

SendNewsLetter

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/newsletter/sendSend a newsletter to a customers.
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
    @ValidateRequest(Validator="IsAuthenticated")
    public static class SendNewsLetter implements ICompany
    {
        /**
        * The newsletter template id.
        */
        @ApiMember(Description="The newsletter template id.", IsRequired=true)
        public Integer Id = null;

        /**
        * The company id, if empty will use the company id for the user you are logged in with.
        */
        @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
        public UUID CompanyId = null;

        /**
        * The datetime when the newsletters should be sent.
        */
        @ApiMember(Description="The datetime when the newsletters should be sent.", IsRequired=true)
        public Date SendDate = null;

        /**
        * The customer ids to send newsletters to.
        */
        @ApiMember(Description="The customer ids to send newsletters to.", IsRequired=true)
        public ArrayList<UUID> Customers = null;
        
        public Integer getId() { return Id; }
        public SendNewsLetter setId(Integer value) { this.Id = value; return this; }
        public UUID getCompanyId() { return CompanyId; }
        public SendNewsLetter setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Date getSendDate() { return SendDate; }
        public SendNewsLetter setSendDate(Date value) { this.SendDate = value; return this; }
        public ArrayList<UUID> getCustomers() { return Customers; }
        public SendNewsLetter setCustomers(ArrayList<UUID> value) { this.Customers = value; return this; }
    }

    public static class SendNewslettersResponse
    {
        /**
        * The number of messages that are added into queue.
        */
        @ApiMember(Description="The number of messages that are added into queue.")
        public Integer Total = null;

        /**
        * Send Method. 1 = Email, 2 = SMS
        */
        @ApiMember(Description="Send Method. 1 = Email, 2 = SMS")
        public Integer SendMethodId = null;

        /**
        * Message example sent (in HTML format)
        */
        @ApiMember(Description="Message example sent (in HTML format)")
        public String MessageExample = null;
        
        public Integer getTotal() { return Total; }
        public SendNewslettersResponse setTotal(Integer value) { this.Total = value; return this; }
        public Integer getSendMethodId() { return SendMethodId; }
        public SendNewslettersResponse setSendMethodId(Integer value) { this.SendMethodId = value; return this; }
        public String getMessageExample() { return MessageExample; }
        public SendNewslettersResponse setMessageExample(String value) { this.MessageExample = value; return this; }
    }

}

Java SendNewsLetter DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /newsletter/send HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Id":0,"CompanyId":"00000000-0000-0000-0000-000000000000","Customers":["00000000-0000-0000-0000-000000000000"]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Total":0,"SendMethodId":0,"MessageExample":"String"}