Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /messages/templates | Create a new company message templates | Create a new company message templates. |
---|
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
CompanyId | body | Guid? | No | The company id, if empty will use the company id for the user you are logged in with. |
TypeId | body | int | Yes | The message type id. See GET /messages/templates/types |
Name | body | string | Yes | The message template name. |
Title | body | string | Yes | The message template title. |
Body | body | string | Yes | The message template title. |
Sender | body | string | No | The message template sender (an email for message types with sendmethod 1, for SMS this cannot be set). |
Language | body | string | No | Template Language sv / en |
Services | body | int[] | No | The services that is connected to the template. If null it will be connected to all services. |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | The message template id |
Name | form | string | No | The message template name. |
Title | form | string | No | The message template title. |
Body | form | string | No | The message template title. |
Sender | form | string | No | The message template sender (an email for message types with sendmethod 1, for SMS this cannot be set). |
Default | form | bool | No | If the message template is the default message currently in use. |
MessageType | form | MessageTypeQueryResponse | No | If the message type information. |
Language | form | string | No | Template language. |
Services | form | List<MessageServices> | No | The connected services which the template is valid for. If empty then it's valid for all services. |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | The message type id |
Name | form | string | No | The message type name. |
Description | form | string | No | The message type description. |
MaxCharacters | form | int | No | The maximum number of charachters that can be entered into message body using this type. |
DefaultText | form | string | No | The default text that is always included when sending messages of this type. |
SendMethodId | form | int | No | The send method for this type. 1 = Email, 2 = SMS. |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | |
Name | form | string | No | Name of the service |
ImageUrl | form | Uri | No | The image url of the service |
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 /messages/templates HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateMessageTemplate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<Body>String</Body>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<Language>String</Language>
<Name>String</Name>
<Sender>String</Sender>
<Services xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>0</d2p1:int>
</Services>
<Title>String</Title>
<TypeId>0</TypeId>
</CreateMessageTemplate>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <MessageTemplatesQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Body>String</Body> <Default>false</Default> <Id>0</Id> <Language>String</Language> <MessageType> <DefaultText>String</DefaultText> <Description>String</Description> <Id>0</Id> <MaxCharacters>0</MaxCharacters> <Name>String</Name> <SendMethodId>0</SendMethodId> </MessageType> <Name>String</Name> <Sender>String</Sender> <Services> <MessageServices> <Id>0</Id> <ImageUrl i:nil="true" /> <Name>String</Name> </MessageServices> </Services> <Title>String</Title> </MessageTemplatesQueryResponse>