BokaMera.API.Host

<back to all web services

UpdateMessageTemplate

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/messages/templates/{Id}Updates an existing company message templatesUpdate an existing company message templates.
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 UpdateMessageTemplate implements ICompany
    {
        /**
        * 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 message template id.
        */
        @ApiMember(Description="The message template id.", IsRequired=true, ParameterType="path")
        public Integer Id = null;

        /**
        * The message type id. See GET /messages/templates/types 
        */
        @ApiMember(Description="The message type id. See GET /messages/templates/types ")
        public Integer TypeId = null;

        /**
        * The message should be default and the one to be used. All other messages for the same message type will be set to Default = false
        */
        @ApiMember(Description="The message should be default and the one to be used. All other messages for the same message type will be set to Default = false")
        public Boolean Default = null;

        /**
        * The message template name.
        */
        @ApiMember(Description="The message template name.")
        public String Name = null;

        /**
        * The message template title.
        */
        @ApiMember(Description="The message template title.")
        public String Title = null;

        /**
        * The message template title.
        */
        @ApiMember(Description="The message template title.")
        public String Body = null;

        /**
        * The message template sender (an email for message types with sendmethod 1, for SMS this cannot be set).
        */
        @ApiMember(Description="The message template sender (an email for message types with sendmethod 1, for SMS this cannot be set).")
        public String Sender = null;

        /**
        * Message template lanugage
        */
        @ApiMember(Description="Message template lanugage", IsRequired=true)
        public String Language = null;

        /**
        * The services that is connected to the template. If null it will be connected to all services.
        */
        @ApiMember(Description="The services that is connected to the template. If null it will be connected to all services.")
        public ArrayList<Integer> Services = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public UpdateMessageTemplate setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getId() { return Id; }
        public UpdateMessageTemplate setId(Integer value) { this.Id = value; return this; }
        public Integer getTypeId() { return TypeId; }
        public UpdateMessageTemplate setTypeId(Integer value) { this.TypeId = value; return this; }
        public Boolean isDefault() { return Default; }
        public UpdateMessageTemplate setDefault(Boolean value) { this.Default = value; return this; }
        public String getName() { return Name; }
        public UpdateMessageTemplate setName(String value) { this.Name = value; return this; }
        public String getTitle() { return Title; }
        public UpdateMessageTemplate setTitle(String value) { this.Title = value; return this; }
        public String getBody() { return Body; }
        public UpdateMessageTemplate setBody(String value) { this.Body = value; return this; }
        public String getSender() { return Sender; }
        public UpdateMessageTemplate setSender(String value) { this.Sender = value; return this; }
        public String getLanguage() { return Language; }
        public UpdateMessageTemplate setLanguage(String value) { this.Language = value; return this; }
        public ArrayList<Integer> getServices() { return Services; }
        public UpdateMessageTemplate setServices(ArrayList<Integer> value) { this.Services = value; return this; }
    }

    public static class MessageTemplatesQueryResponse
    {
        /**
        * The message template id
        */
        @ApiMember(Description="The message template id")
        public Integer Id = null;

        /**
        * The message template name.
        */
        @ApiMember(Description="The message template name.")
        public String Name = null;

        /**
        * The message template title.
        */
        @ApiMember(Description="The message template title.")
        public String Title = null;

        /**
        * The message template title.
        */
        @ApiMember(Description="The message template title.")
        public String Body = null;

        /**
        * The message template sender (an email for message types with sendmethod 1, for SMS this cannot be set).
        */
        @ApiMember(Description="The message template sender (an email for message types with sendmethod 1, for SMS this cannot be set).")
        public String Sender = null;

        /**
        * If the message template is the default message currently in use.
        */
        @ApiMember(Description="If the message template is the default message currently in use.")
        public Boolean Default = null;

        /**
        * If the message type information.
        */
        @ApiMember(Description="If the message type information.")
        public MessageTypeQueryResponse MessageType = null;

        /**
        * Template language.
        */
        @ApiMember(Description="Template language.")
        public String Language = null;

        /**
        * The connected services which the template is valid for. If empty then it's valid for all services.
        */
        @ApiMember(Description="The connected services which the template is valid for. If empty then it's valid for all services.")
        public ArrayList<MessageServices> Services = null;
        
        public Integer getId() { return Id; }
        public MessageTemplatesQueryResponse setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public MessageTemplatesQueryResponse setName(String value) { this.Name = value; return this; }
        public String getTitle() { return Title; }
        public MessageTemplatesQueryResponse setTitle(String value) { this.Title = value; return this; }
        public String getBody() { return Body; }
        public MessageTemplatesQueryResponse setBody(String value) { this.Body = value; return this; }
        public String getSender() { return Sender; }
        public MessageTemplatesQueryResponse setSender(String value) { this.Sender = value; return this; }
        public Boolean isDefault() { return Default; }
        public MessageTemplatesQueryResponse setDefault(Boolean value) { this.Default = value; return this; }
        public MessageTypeQueryResponse getMessageType() { return MessageType; }
        public MessageTemplatesQueryResponse setMessageType(MessageTypeQueryResponse value) { this.MessageType = value; return this; }
        public String getLanguage() { return Language; }
        public MessageTemplatesQueryResponse setLanguage(String value) { this.Language = value; return this; }
        public ArrayList<MessageServices> getServices() { return Services; }
        public MessageTemplatesQueryResponse setServices(ArrayList<MessageServices> value) { this.Services = value; return this; }
    }

    public static class MessageTypeQueryResponse
    {
        /**
        * The message type id
        */
        @ApiMember(Description="The message type id")
        public Integer Id = null;

        /**
        * The message type name.
        */
        @ApiMember(Description="The message type name.")
        public String Name = null;

        /**
        * The message type description.
        */
        @ApiMember(Description="The message type description.")
        public String Description = null;

        /**
        * The maximum number of charachters that can be entered into message body using this type.
        */
        @ApiMember(Description="The maximum number of charachters that can be entered into message body using this type.")
        public Integer MaxCharacters = null;

        /**
        * The default text that is always included when sending messages of this type.
        */
        @ApiMember(Description="The default text that is always included when sending messages of this type.")
        public String DefaultText = null;

        /**
        * The send method for this type. 1 = Email, 2 = SMS.
        */
        @ApiMember(Description="The send method for this type. 1 = Email, 2 = SMS.")
        public Integer SendMethodId = null;
        
        public Integer getId() { return Id; }
        public MessageTypeQueryResponse setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public MessageTypeQueryResponse setName(String value) { this.Name = value; return this; }
        public String getDescription() { return Description; }
        public MessageTypeQueryResponse setDescription(String value) { this.Description = value; return this; }
        public Integer getMaxCharacters() { return MaxCharacters; }
        public MessageTypeQueryResponse setMaxCharacters(Integer value) { this.MaxCharacters = value; return this; }
        public String getDefaultText() { return DefaultText; }
        public MessageTypeQueryResponse setDefaultText(String value) { this.DefaultText = value; return this; }
        public Integer getSendMethodId() { return SendMethodId; }
        public MessageTypeQueryResponse setSendMethodId(Integer value) { this.SendMethodId = value; return this; }
    }

    public static class MessageServices
    {
        public Integer Id = null;
        /**
        * Name of the service
        */
        @ApiMember(Description="Name of the service")
        public String Name = null;

        /**
        * The image url of the service
        */
        @ApiMember(Description="The image url of the service")
        public Uri ImageUrl = null;
        
        public Integer getId() { return Id; }
        public MessageServices setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public MessageServices setName(String value) { this.Name = value; return this; }
        public Uri getImageUrl() { return ImageUrl; }
        public MessageServices setImageUrl(Uri value) { this.ImageUrl = value; return this; }
    }

}

Java UpdateMessageTemplate DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

PUT /messages/templates/{Id} HTTP/1.1 
Host: api.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Id":0,"TypeId":0,"Default":false,"Name":"String","Title":"String","Body":"String","Sender":"String","Language":"String","Services":[0]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Id":0,"Name":"String","Title":"String","Body":"String","Sender":"String","Default":false,"MessageType":{"Id":0,"Name":"String","Description":"String","MaxCharacters":0,"DefaultText":"String","SendMethodId":0},"Language":"String","Services":[{"Id":0,"Name":"String"}]}