Configuring the messengers API Chain Server
After selecting the chain template, you need to start configuring the server. All responses from the selected instance will be returned to the server. You can specify your server for receiving and processing data or use our Docker hosting. If both options are not suitable for you, then you can specify the Url of the web hack with WebHook.site for data processing.
Server setup consists of optional and non-optional information. If the required fields are filled in incorrectly, the chain will give an error, so you should pay attention to the fields being filled in.
Name of the server
This is the name of your server. Accordingly, in the future it will be displayed when working with the chain and selecting the server settings card.
Specifies the method by which your server expects access. In other words, the method indicates the action that will be performed by the server. There are only a few of them:
- GET - getting a resource;
- POST - creating a resource;
- PUT - resource update;
- DELETE - deleting a resource;
- OPTIONS - defining parameters;
- PATCH - resource update option.
Url is a uniform resource identifier. Accordingly, we specify at which address the server will be available. We remind you that to specify the Url, you can use our Docker hosting or take the Url from the Webhook. site.
They are Headers or Headers. Various service information is transmitted in the headers, for example, the encoding of the message. In this field, you need to specify which headers your server will expect. If there are several of them, then you can add them using the appropriate button. By default, the headers will have a setting for a json request.
All subsequent settings fields (headers and dates) include 3 inputs and one checkbox.
In the name of the key, we write the name of the key that is expected in the response.
In the type - the type of value. It is important that the destination type matches the actual data that the server will receive. If you state a number, the server will give an error when receiving a string. If the field may be missing, just make it optional. If, for some reason, the field may have different values, process these values using JS code before requesting to your server, and reduce these values to a single value.
The "default" input specifies what the default value of this field will be. You can not specify anything, but if the field was not optional, then you will have to configure it manually.
Choosing "static" or "dynamic" will determine which data this field belongs to. If you need to work with data that should remain unchanged, for example, API KEY, then choose static, if not, then dynamic. The characteristic of the field can always be changed.
For example, if you need an authorized token, then the header configuration option takes the following form:
Data is also the body of the request or the transmitted data itself. Data is always sent in the Json version. In this field, you must specify which parameters the user expects to see in the response from the server, at least one parameter must be specified, otherwise the chain will not be active.
If you want to get everything contained in the body, then use this setting and enter "..." in the "Default" section.
If, for example, you only need an answer comparable to the webhack's answer, you can add all the keys that you expect on an optional date: