Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Erweitern
titlePage Summary and Index

You will learn about action buttons. How they enable a task-like-workflow with status updates between both systems and which different varriations exist.

Inhalt
stylenone

...

To process status changes in hotelkit the partner can attach actions to a request. Those actions will be presented to the customer as buttons.

As soon as the customer hits the button, the result will be sent back to the partner via the defined webhook, and new actions could can be sent . (For details see webhook -> send actions)

...

in the response.

Requirements

To attach actions to a request, the partner must be granted the functionality hasActions.

To confirm your functionalities you can use GET /setup/partner.

Definition

Attributes

Every action will be presented to the customer as a button. Therefore all information for displaying the button must be sent:

Attributes

Data type

Description

type*

string

Identifer of the action. Will be sent back to the partner to identify the hit action.

label*

string

Label of the button before the action will be triggered.

labelDone*

string

Label of the action, after it was triggered.

labelType*

enum [“string”, “text”, “number”, “boolean”, “date”, “time”, “dateTime”, “user”, “enum”]

Gives information about the style of the button. See Bootstrap Buttons

isDone*

boolean

Says whether a request can be closed after the action. This is the case whenever there is no further immediate action of the customer required.

information

information{}

Additional information the customer has to insert before sending the action. Those information will be sent to the partner and are giben in detail in the next section.

Information types

Whenever additional information is submitted, the customer will be presented with a form with all the requested information. Every information is given as one input. To define those inputs, these attrbiutes are available:

...

Given the type of information the presentation of the input is set:

string

The customer should insert a short text.

text

The input will be presented to the customer as a textbox. This is suitable whenever the customer should insert a longer string than a single sentence.

number

The customer should insert a number. To specify this number, the following meta information can be made:

...

If all meta information are given, the customer will be presented with a slider for assisting the input.

boolean

A checkbox will be presented to the customer.

date/time/dateTime

The customer will be presented with a datepicker. The value and defaultValue will be in the format “dd.mm.YYYY HH:ii” (or subsets)

user

The customer will be asked for a (or multiple) user of hotelkit. The valid values are all hotelkitIDs the partner gets with GET /users
The value and defaultValue will be an array of those hotelkitIDs.
For this option, the partner must be granted the functionality userList as otherwise there are no hotelkitIDs available.
See the example for an implementation.

enum

The customer will have a set of options to choose from.
Are there more than 3 options available, the customer will see a dropdown instead of a radio button.
The options will be given as an array via the meta attribute. Each option consist of:

Key

Description

value

The value that will be sent to the partner.

label

The string that will be presented to the customer.

Example

There will be be 2 buttons created, where the “Accept” button initiates a form with every available type of input.

Codeblock
{
  "actions":[
    {
      "type":"decline",
      "label":"Decline",
      "labelDone":"Declined",
      "labelType":"error"
    },
    {
      "type":"accept",
      "label":"Accept",
      "labelDone":"Accepted",
      "labelType":"success",
      "information":{
        "messageToGuest":{
          "required":false,
          "type":"text",
          "label":"Cover letter to guest",
          "defaultValue":"Thank you very much for your request, we are happy to accept the order"
        },
        "internalComment":{
          "required":false,
          "type":"string",
          "label":"Internal comment",
          "defaultValue":"Implement after the holiday"
        },
        "booleanValue":{
          "required":true,
          "type":"boolean",
          "label":"Send to guest",
          "defaultValue":true
        },
        "time":{
          "required":true,
          "type":"time",
          "label":"Time",
          "defaultValue":"12:00"
        },
        "date":{
          "required":true,
          "type":"date",
          "label":"Date",
          "defaultValue":"29.08.2018"
        },
        "dateTime":{
          "required":true,
          "type":"dateTime",
          "label":"Date/Time",
          "defaultValue":"29.08.2018 12:00"
        },
        "numberuser":{
          "required":true,
          "type":"numberuser",
          "label":"CostsResponsible",
          "defaultValue":12.4,[
            "meta":{7657"
          ]
    "min":10,    },
        "maxnumber":13,
 {
          "steprequired":0.1true,
          }"type":"number",
          },"label":"Costs",
          "select1defaultValue":{12.4,
          "requiredmeta":true,{
            "typemin":"enum"10,
            "labelmax":"small selection",13,
            "defaultValuestep":"0.1",
          "meta":{}
        },
   "options":[     "select1":{
         {
   "required":true,
             "valuetype":"1enum",
   
            "label":"Optionsmall 1selection",
          "defaultValue":"1",
   },       "meta":{
       {     "options":[
              {
                "value":"211",
                "label":"Option 211"
              },
              {
                "value":"3121",
                "label":"Option 3121"
              },
            ]  {
        }         }"value":"31",
        "select2": {       "label":"Option 31"
      "required": true,        }
        "type": "enum",   ]
          }
"label": "little selection",      },
        "defaultValueselect2": "1",{
              "metarequired": {
   true,
              "optionstype": ["enum",
              "label":        {
           "little selection",
              "valuedefaultValue": "111",
           
              "labelmeta": "Option{
11"                       },"options": [
                       {
                          "value": "21111",
                          "label": "Option 21111"
                      },
                      {
                          "value": "311211",
                          "label": "Option 311211"
                      },
                      {
                          "value": "1311",
                          "label": "Option 1311"
                      },
                      {
                          "value": "211",
                          "label": "Option 211"
                      },
                      {
                          "value": "3121",
                          "label": "Option 3121"
                      },
                      {
          ]               } "value": "31",
        }       }     }   ] }

This is how the buttons will be displayed to the customer:

image-20240529-144605.pngImage Removed

As soon as the customer triggers the action “Accept” a form with the information pops up:

image-20240529-144440.pngImage Removed

After clicking “Send”, a request is sent to the webhook of the partner:

Codeblock
{   "responseTypelabel": "acceptOption 31",
   "hotelkitID":"73014444213",
  "messageToGuest":"Thank you very much for your request, we are happy to accept the order",
  "internalComment":"Implement after the holiday",
  "booleanValue":true,
  "time":"12:00                   }
                  ]
              }
          }
      }
    }
  ]
}

This is how the buttons will be displayed to the customer:

image-20240529-144605.pngImage Added

As soon as the customer triggers the action “Accept” a form with the information pops up:

image-20240530-080901.pngImage Added

After clicking “Send”, a request is sent to the webhook of the partner:

Codeblock
{ "eventName": "requestStatusChange"
  "responseType":"accept",
  "datehotelkitID":"29.08.201873014444213",
  "dateTimemessageToGuest":"29.08.2018 12:00",
  "number":12.4,
  "select1":"1Thank you very much for your request, we are happy to accept the order",
  "select2internalComment":"1"
}

Not present in the screenshot and the example listed is the option that a user has to be chosen.

Codeblock
"user":{
       Implement after the holiday",
  "requiredbooleanValue":true,
 
        "type"time":"user12:00",
  
       "labeldate":"Responsible29.08.2018",
 
        "defaultValue":[
         "dateTime":"29.08.2018 12:00",
  "7657user":[
    7657
     ],
  "number":12.4,
  "select1":"1",
  }

The response will look like this:

Codeblock
"user":[
    7657
  ],"select2":"1"
}