| 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 | Yes | The message template sender (an email for message types with sendmethod 1, for SMS this cannot be set). |
| Language | body | string | Yes | Template Language sv / en |
| Services | body | int[] | Yes | 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 | Yes | The message template name. |
| Title | form | string | Yes | The message template title. |
| Body | form | string | Yes | The message template title. |
| Sender | form | string | Yes | 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 | Yes | If the message type information. |
| Language | form | string | Yes | Template language. |
| Services | form | List<MessageServices> | Yes | 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 | Yes | The message type name. |
| Description | form | string | Yes | The message type description. |
| MaxCharacters | form | int | No | The maximum number of characters that can be entered into message body using this type. |
| DefaultText | form | string | Yes | 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 | Yes | Name of the service |
| ImageUrl | form | Uri | Yes | The image url of the service |
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","TypeId":0,"Name":"String","Title":"String","Body":"String","Sender":"String","Language":"String","Services":[0]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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"}]}