Warning!
This is a legacy document. The features described below are only usable within the classic-generation environment.
Currently, Betty Blocks offers faster and more advanced options that are available in next-gen. Before you start working on some new features in your application, consider doing it using the next-gen version. In particular, you might find it useful to check out Using the HTTPS action step and Setting your remote data source articles.
Good luck!
Endpoints contain the information that is needed for interacting with a URL and consist of a template and an action. A template can be used to define custom HTML segments while actions can be used for setting up a process (workflow) around how data is organized. You can use Endpoints as a post or as a Webservice endpoint. In addition, you can also include authentication settings for ensuring that a page is only available for authenticated users.
You can access the webservice endpoint form from the webservices form. How you navigate to the form is explained below as well as the fields that you need to complete in the form for setting up an endpoint.
Note: We are constantly updating the Betty Blocks platform to increase the ease-of-use of our platform. Certain functionality is currently still managed in our previous IDE but works seamlessly with our updated environment. This article explains how you access the webservice endpoint functionality that is managed in our previous environment. As you work with our previous IDE, information is presented in separate panels/form. You need to press the Save button to save any details entered and you can use the Close button to close individual panels. You can also refer to the Product changes for a list of updates to the platform. |
Setting up webservices for endpoints
You can access webservices by opening the Tools (A) menu and selecting Webservices (B). Where you are working in our current environment, our previous platform is opened on the Webservices (C) page.
Note: If you are already working in our previous platform, you can also access the Webservices by opening the Tools (A) menu and selecting Webservices (B).
|
Click on the webservice in the list (A) to open the form details (B). Click on the Edit (C) button details to display the webservice form. Note: More detail on the individual fields is provided in Completing the details in a Webservice form. |
You can view the details for webservice endpoints by clicking on the Endpoints (A) button. Where any endpoints have been defined, they are displayed in the panel that is opened (B). The details are presented in columns in the panel displayed. To create a new webservice, press the New (C) button. The Webservice Endpoint (D) form is displayed that you can use for specifying the endpoint details. |
Note: When you create a New the Endpoints panel, you also are provided with a video and links to additional documentation on webservices. |
Applying settings for an Endpoints
The different fields in the endpoint form are described in the following.
Name | Specify a name for the webservice endpoint. |
Http method
| Specify the communications protocol for responding to the webservice. Open the pull-down menu to display the options available: - DELETE - GET - PATCH - POST - PUT See Different Http methods for more information. |
Path | You can extend the path name details. For example, You can use the Insert variable button to use a variable associated with a specific resource/page in your application. |
Parameter encoder | Open the menu (C) to choose from either: - - |
Request Content-Type
| Choose the format type from the menu (D) for sending the request based on the format expected by the host. Select either:
- Inherit: The endpoint inherits the Request Content-Type based on the format expected by the host.
- JSON: The request is configured as JSON.
- Multi-Part: The request is transmitted as a Multi-Part type. This option should only be selected where the host accepts this content type and you want to send a file without additional body values.
- Other: Select this option when your host requires a request content type other than Inherit, JSON or Multi-Part.
|
Response Content-Type | Choose the format type from the menu (E) for the response. Select either:
- Inherit: The endpoint inherits the Response Content-Type based on the format as directed by the host.
- JSON: The request is configured as JSON.
- Other: Select this option when your host requires a request content type other than JSON or XML.
- XML: Using XML you can translate data by setting up a text expression or an endpoint template. See HowTo setup a XML webservice for more details.
- Other: Select this option when your host requires a request content type other than JSON or Multi-Part. |
Custom model
| You can select a custom model that is used for storing data. Where you are using JSON Request and Response methods, you can also generate custom models for data.
Response returns is either: Single - A single custom model that is then used to store the data for the webservice call Multiple -A collection of custom models is created for storing your data.
|
Response code | You can define the response codes that the webservice accepts as successful. You can set a single response code or a range by specifying trailing dots. The value |
Adding variables to an Endpoint
The details specified in these options
The options are included in the request and also specify the variables for adding dynamic values: Header variables (A) - Using Header variables, you can add dynamic values in the request headers that are specific to the endpoint. Path variables (B): Using Path variables, you can add dynamic values to the Path setting. You'll have to add them manually though, by selecting them through the variable browser. Query variables (C) - Using Query variables you can add dynamic values that are automatically appended (in alphabetical order) to the Path setting. For example, query variables 1https://webservice.com/path?age=*value*&name=*value* Body variables (D) - Using Body variables, you can include variables as your request content. These variables are automatically parsed in JSON format in the requests body. For this reason, you need to ensure that you set JSON as the Request Content-Type.
See Adding variables below for
|
Note: The variables that you create become visible in the variable table for that variable type. Variables can be created, edited and removed in the table. |
Template (E) | You can add a template for the body of your data. You can select to use an existing template or to create a new template. Note: A template should not be used if you are using body variables. |
Adding variables
When you click on the Add (A), the new variable dialog is opened. You can add the name (B) for the variable and use the available checkboxes to indicate:
Filter value from logs: To assign a variable based on value from the application logs. |
|
Editing and deleting variables
You can edit variables that have been added by clicking on the button (A) in the variable row. The Edit variable (B) dialog is displayed. You can change the details or use the Delete (C) button to delete a variable that you no longer require. |
|
Editing custom models in an Endpoint
Once you save an endpoint, the summary of its contents is displayed. An additional button for any custom model (A) is also displayed. Click on the button to open the summary of the custom model (B). Press the Edit (C) button to display additional details on dependent items. Press the Attributes (D) button to display the details for the attributes associated with the model. |
|
Managing changes
Any changes on webservice files are logged. You can display the details of changes by clicking on the Changes (A) button as shown below. The details of the changes are displayed in the table displayed based on the columns: When (B) - date and time showing when the change was applied. User (C) - details of which user applied the change. Action (D) - details the action that was logged. Type (E) - details the type of change applied. Path (F) - details the path that is impacted. Data (G) - explains the data that was impacted by the action. |
Testing an endpoint
You can use the Run Test (A) button to test the values you have added to an endpoint. Once you have saved the webservice endpoint with all the required values, click the Run test button. You may be request to apply values for any input variables. The button changes to show Testing (B) is taking place and when completed, a dialog showing the response body code (C) is displayed. You can click on the Generate custom model (D) button that is now displayed. When completed successfully, a Success message is displayed |
The file created is now displayed in the list of Webservices (F) file. |
|
Different Http methods available
HTTP* methods on Endpoints handle requests between your web browser and the Betty Blocks web server. When creating a new endpoint, you can specify the Request method. These methods determine how a webpage interacts with the web server. The HTTP methods are:
Method | Description | Results in: |
DELETE | Using the DELETE method you can delete data over the Betty Blocks API. | Removes targeted data. |
GET | Using the GET you can obtain data from the web server. It is the most common method used for most Endpoints. | Normally returns a webpage. |
PATCH | Using the PATCH method you can apply a partial modifications to a resource. | Specific updates, for example, to a single field in a resource. |
POST | Using the POST method, you can post data to the target web server. Data is sent to a server for creating/updating a resource. | Combine this method with Actions to alter or delete data from the Back Office. |
PUT | Using the PUT method you can update data over the Betty Blocks API. | Sends data to a server to create/update a resource. Similar to PATCH but used normally for updating an entire resource. |
*Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. See https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol for details.
Hypertext Transfer Protocol (HTTP) | HTTP is a protocol defining the order and syntax for information transferred over a network. Requests and responses are the two main kinds of HTTP messages. All requests and responses can be read by anyone monitoring the session. |
Hypertext Transfer Protocol Secure (HTTPS) | HTTPS protocol is an extension of HTTP for providing an encrypted connection between a web server and a browser over Transport Layer Security (TLS). TLS uses a public key encryption technology based on a public and a private key. Requests and response are encrypted with session keys so that any intercepted communication is displayed as a random string of characters and not the plaintext. |