Webservices in Betty Blocks are very versatile, as you can use them to access data but also to do API calls for services. Setting up a webservice can be difficult because there are many settings that have to be set up the right way. In this article, every setting within webservices will be explained.
+New: By clicking on this button the New webservice form will appear on the right side of the screen.
Question mark [
? ]: By clicking this button, a new panel pops-up. This panel will present an instruction video on “HowTo create a web service?”.
Searchbar: When you have many webservices, you may want to search for a specific service. By searching on the name of the webservices, you can easily find the one you need.
Row: Every row represents a webservice, by clicking on the row more information about the webservice will be shown.
Refresh: By clicking Refresh or pressing
R on your keyboard, your data will be updated, if recently altered.
< Close: Closes the form.
Changes: When clicking on the changes icon next to the
Save button a new tab will slide down, in this tab it is possible to see all changes made to the webservice.
Save: Saves the webservice you are creating.
Name: Here you can enter a name for your webservice.
Protocol: Enter what protocol the receiving end needs to use. You can choose between HTTP and HTTPS, which one you should use depends on your host.
Host: Enter the domain URL of the webservice that you want to use.
Authentication type: When your host requires you to authenticate before you can access the service you can choose the authentication type here. Betty Blocks supports 5 different types of authentication:
- HTTP basic
- OAuth 2 basic
- OAuth 2 JWT
- Client Certificate
Which authentication type you have to choose for your webservice, depends again on the host that you are using.
Authentication: If you have selected the authentication type this field will appear, with this field you can set your authentication. If you have already set an authentication in the configurations tab it is possible to select it here. If not then you can also create a new authentication one by clicking on
- New -. The chosen Authentication will be included as the
Authorization header when performing a request.
Request Content-Type: Choose in which format type you send the request to your host, this also depends on what type of format your host expects to receive. The chosen option will be included as the
content-type Header included in its requests. You can choose between 3 different formats:
- JSON: This option will send the request configured as JSON.
- Multi-Part: This option will send the request as Multi-Part type. You should only use this type of request when your host accepts this content type, and you want to send a file without further body values.
- Other: You can choose this option when your host requires any other type of request content type than listed above.
Response Content-Type: Choose which format type the host will send its response, this depends on your host. There are 3 types that you can choose from:
- JSON: It is very easy to set up a webservice with a JSON response, it is possible to quickly translate this data to your application with our awesome custom models functionality. More information about custom models can be found here: What are custom models?
- XML: With XML it is possible to translate data by setting up a text expression or an endpoint template. More information about XML webservices can be found here: HowTo setup a XML webservice.
- Other: When expecting any other type of response than JSON or XML then you should choose this option.
Headers: Sometimes you may need to pass some additional information in your request, this is possible by adding variables in your header. By clicking on the
Add button it is possible to add a variable.
Help text: Here you can enter a comment about what the webservice is for. This is handy for when someone else is working on the same application.
Input variables: You can set up variables that you want to use later with input variables. For instance, when using a webservice call in an action you can enter a value for an input variable inside of the action block. This variable will stay usable for the whole action.
Dependencies: are combinations of different functionalities and parts of your application the current group is dependent on. More information can be found here: What are Dependencies?
Endpoints: By clicking on the endpoints tab all the endpoints of the webservice will be shown. Everything about webservice endpoints can be found here
Delete: By clicking on the delete button the webservice will be removed.
Cancel: By clicking on this button the form will get out of edit mode without making changes to the webservice.