Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
visionx:rest_services [2022/03/31 09:17]
robot created
visionx:rest_services [2022/03/31 09:38] (current)
robot
Line 10: Line 10:
 The VisionX REST Add-on supports more than 50 REST services out of the box, and over 2,000 apps through Zapier. Our powerful CRUD REST support makes working with REST services as easy as working with database tables, with just a few clicks. The VisionX REST Add-on supports more than 50 REST services out of the box, and over 2,000 apps through Zapier. Our powerful CRUD REST support makes working with REST services as easy as working with database tables, with just a few clicks.
  
-====== ​Installing the VisionX REST Add-on ​======+====== ​Installation ​======
  
 Before you can use the REST services in VisionX, the REST add-on has to be installed. On the VisionX start screen, click on the "Ready Made Solutions"​ store at the bottom of the screen. Before you can use the REST services in VisionX, the REST add-on has to be installed. On the VisionX start screen, click on the "Ready Made Solutions"​ store at the bottom of the screen.
  
-[[images/​rest1-solutions-store.png|{{:images/rest1-solutions-store.png}}]]+{{:visionx:​rest_services:​rest1-solutions-store.png?nolink|}}
  
 The click on "​Add-ons"​ on the left menu. The click on "​Add-ons"​ on the left menu.
  
-[[images/​rest2-add-ons.png|{{:images/rest2-add-ons.png}}]]+{{:visionx:​rest_services:​rest2-add-ons.png?nolink|}}
  
 And click the "​+"​ icon next to the "REST Services"​ add-on. And click the "​+"​ icon next to the "REST Services"​ add-on.
  
-[[images/​rest3-add-rest-services.png|{{:images/rest3-add-rest-services.png}}]]+{{:visionx:​rest_services:​rest3-add-rest-services.png?nolink|}}
  
 VisionX must now be restarted for the add-on to be activated. VisionX must now be restarted for the add-on to be activated.
  
-====== Configuring ​REST Services ======+====== Configuring Services ======
  
 //Note: Every REST API is a little different.//​ //While we made it as easy as possible to configure connections,​ the exact steps and requirements will vary.// //Please consult the API documentation for the requested resource for details on URLs, authentication,​ and headers.// //Note: Every REST API is a little different.//​ //While we made it as easy as possible to configure connections,​ the exact steps and requirements will vary.// //Please consult the API documentation for the requested resource for details on URLs, authentication,​ and headers.//
Line 32: Line 32:
 On the VisionX start screen, click "Add Ons" on the menu at the top of the screen and then "REST Services"​. On the VisionX start screen, click "Add Ons" on the menu at the top of the screen and then "REST Services"​.
  
-[[images/​rest4-open-rest-config.png|{{:images/rest4-open-rest-config.png}}]]+{{:visionx:​rest_services:​rest4-open-rest-config.png?nolink|}}
  
 This takes us to the REST service configuration screen. Here you can see the preconfigured services for SaaS products such as Asana, Salesforce, Slack, Cronet and others. Please refer to the "​Description"​ section of each preconfigured service for more details on how to use the connection. This takes us to the REST service configuration screen. Here you can see the preconfigured services for SaaS products such as Asana, Salesforce, Slack, Cronet and others. Please refer to the "​Description"​ section of each preconfigured service for more details on how to use the connection.
  
-[[images/​rest5-rest-service-config.png|{{:images/rest5-rest-service-config.png}}]]+{{:visionx:​rest_services:​rest5-rest-service-config.png?nolink|}}
  
 To configure a new service, first click on "New Group" at the bottom of the screen and enter a name for the group. To configure a new service, first click on "New Group" at the bottom of the screen and enter a name for the group.
  
-[[images/​rest6-rest-new-group.png|{{:images/rest6-rest-new-group.png}}]]+{{:visionx:​rest_services:​rest6-rest-new-group.png?nolink|}}
  
 After creating a group, click on the "​+"​ icon at the top left of the screen. After creating a group, click on the "​+"​ icon at the top left of the screen.
Line 46: Line 46:
 //Please note that for configuring a new service, both a new group and a new service are required.// //Please note that for configuring a new service, both a new group and a new service are required.//
  
-[[images/​rest7-new-rest-service.png|{{:images/rest7-new-rest-service.png}}]]+{{:visionx:​rest_services:​rest7-new-rest-service.png?nolink|}}
  
 You can now enter a name and description for the service, and select from the following options: You can now enter a name and description for the service, and select from the following options:
Line 59: Line 59:
 Active: Displays the service’s status (active/​inactive). Inactive services cannot be used in VisionX applications. Active: Displays the service’s status (active/​inactive). Inactive services cannot be used in VisionX applications.
  
-[[images/​rest8-rest-service-description.png|{{:images/rest8-rest-service-description.png}}]]+{{:visionx:​rest_services:​rest8-rest-service-description.png?nolink|}}
  
 On the tabset in the middle of the screen, you can see the various available operations: FETCH, INSERT, UPDATE, DELETE, METADATA and AUTHORIZATION. On the tabset in the middle of the screen, you can see the various available operations: FETCH, INSERT, UPDATE, DELETE, METADATA and AUTHORIZATION.
Line 65: Line 65:
 You can select the relevant method from the dropdown, and enter the URL for the requested resource. You can select the relevant method from the dropdown, and enter the URL for the requested resource.
  
-[[images/​rest9-fetch.png|{{:images/rest9-fetch.png}}]]+{{:visionx:​rest_services:​rest9-fetch.png?nolink|}}
  
 If required, authorization credentials can be entered on the "​AUTHORIZATION"​ tab and enter the appropriate credentials. If required, authorization credentials can be entered on the "​AUTHORIZATION"​ tab and enter the appropriate credentials.
Line 77: Line 77:
 After entering the credentials we switch back to the "​FETCH"​ tab. After entering the credentials we switch back to the "​FETCH"​ tab.
  
-[[images/​rest11-rest-authorization.png|{{:images/rest11-rest-authorization.png}}]]+{{:visionx:​rest_services:​rest11-rest-authorization.png?nolink|}}
  
 If any headers are required, you can add them in the table below by clicking on the "​+"​ icon. Please check the API documentation for the requested resource for header information. If any headers are required, you can add them in the table below by clicking on the "​+"​ icon. Please check the API documentation for the requested resource for header information.
  
-[[images/​rest12-headers.png|{{:images/rest12-headers.png}}]]+{{:visionx:​rest_services:​rest12-headers.png?nolink|}}
  
 ====== Fetching test data ====== ====== Fetching test data ======
Line 91: Line 91:
 After selecting "​Get"​ as the method from the dropdown on the "​Fetch"​ tab and entering the URL and authorization details, click on the "Test FETCH" button on the top right. After selecting "​Get"​ as the method from the dropdown on the "​Fetch"​ tab and entering the URL and authorization details, click on the "Test FETCH" button on the top right.
  
-[[images/​rest13-fetch-url.png|{{:images/rest13-fetch-url.png}}]]+{{:visionx:​rest_services:​rest13-fetch-url.png?nolink|}}
  
 You will now see the results in the "Test result"​ table on the bottom right of the screen. You will now see the results in the "Test result"​ table on the bottom right of the screen.
Line 99: Line 99:
 The formatted results are displayed on the "Data (formatted)"​ tab: The formatted results are displayed on the "Data (formatted)"​ tab:
  
-[[images/​rest14-test-result.png|{{:images/rest14-test-result.png}}]]+{{:visionx:​rest_services:​rest14-test-result.png?nolink|}}
  
 The original JSON data is shown on the "Data (1:1)" tab: The original JSON data is shown on the "Data (1:1)" tab:
  
-[[images/​rest15-test-result-JSON.png|{{:images/rest15-test-result-JSON.png}}]]+{{:visionx:​rest_services:​rest15-test-result-json.png?nolink|}}
  
 In the column named "Use as column",​ we can now select the columns we want to use in the VisionX table. In this case, since we only have a total of two columns, we select them both. Once selected, they appear in the "​Columns"​ table at the bottom of the screen: In the column named "Use as column",​ we can now select the columns we want to use in the VisionX table. In this case, since we only have a total of two columns, we select them both. Once selected, they appear in the "​Columns"​ table at the bottom of the screen:
  
-[[images/​rest16-columns.png|{{:images/rest16-columns.png}}]]+{{:visionx:​rest_services:​rest16-columns.png?nolink|}}
  
 Path: The result of the REST call may not be returned at the highest level of the JSON response. For example, a result may be returned below the „details"​ level of the hierarchy, in which case the path has to be set to „details"​ for the results to be recongized accurately. Path: The result of the REST call may not be returned at the highest level of the JSON response. For example, a result may be returned below the „details"​ level of the hierarchy, in which case the path has to be set to „details"​ for the results to be recongized accurately.
Line 113: Line 113:
 In the "​Columns"​ table, we can now adjust the data type, length, precision, scale or format if necessary. We can also set one of the columns to be a primary key. These are relevant for the unique identification of data records, and are required for "​Update"​ or "​Delete"​ operations. In the "​Columns"​ table, we can now adjust the data type, length, precision, scale or format if necessary. We can also set one of the columns to be a primary key. These are relevant for the unique identification of data records, and are required for "​Update"​ or "​Delete"​ operations.
  
-[[images/​rest17-primary-key.png|{{:images/rest17-primary-key.png}}]]+{{:visionx:​rest_services:​rest17-primary-key.png?nolink|}}
  
 Our table is now ready to use in VisionX. Click "​Finish"​ to complete the configuration. Our table is now ready to use in VisionX. Click "​Finish"​ to complete the configuration.
  
-[[images/​rest18-finish.png|{{:images/rest18-finish.png}}]]+{{:visionx:​rest_services:​rest18-finish.png?nolink|}}
  
-====== Using Parameters ​in the Configuration ​======+====== Using Parameters ======
  
 Parameters can be used for any of the configuration data instead of hardcoded values. To create a parameter, simply enter its name ins square brackets. Parameters can be used for any of the configuration data instead of hardcoded values. To create a parameter, simply enter its name ins square brackets.
Line 125: Line 125:
 For example, the authorization credentials can be entered as parameters: For example, the authorization credentials can be entered as parameters:
  
-[[images/​rest18-parameters-1.png|{{:images/rest18-parameters-1.png}}]]+{{:visionx:​rest_services:​rest18-parameters-1.png?nolink|}}
  
 We can also use a parameter for parts of a URL: We can also use a parameter for parts of a URL:
  
-[[images/​rest18-parameters-2.png|{{:images/rest18-parameters-2.png}}]]+{{:visionx:​rest_services:​rest18-parameters-2.png?nolink|}}
  
 Once a parameter has been defined, it will show up in the "​Parameters"​ section on the right side of the screen: Once a parameter has been defined, it will show up in the "​Parameters"​ section on the right side of the screen:
  
-[[images/​rest18-parameters-3.png|{{:images/rest18-parameters-3.png}}]]+{{:visionx:​rest_services:​rest18-parameters-3.png?nolink|}}
  
 For each parameter, we can decide if it is a config parameter or if it is entered during runtime, by selecting from the dropdown. For each parameter, we can decide if it is a config parameter or if it is entered during runtime, by selecting from the dropdown.
  
-[[images/​rest18-parameters-4.png|{{:images/rest18-parameters-4.png}}]]+{{:visionx:​rest_services:​rest18-parameters-4.png?nolink|}}
  
   * **Config Parameters:​** these are parameters that are defined when the REST service is added to the application. They do not change when the application is running.\\   * **Config Parameters:​** these are parameters that are defined when the REST service is added to the application. They do not change when the application is running.\\
-Examples of common config parameters are usernames, passwords, and URLs. See also [[#using_data_from_a_rest_connection_in_a_visionx_application|Using Data from a REST Connection ​in a VisionX ​Application]]+Examples of common config parameters are usernames, passwords, and URLs. See also [[#using_data_in_an_application|Using Data in an Application]]
   * **Runtime Parameters:​** these are parameters that are used to retrieve values when the application is running. When can use them to modify REST calls based on values in the application data.   * **Runtime Parameters:​** these are parameters that are used to retrieve values when the application is running. When can use them to modify REST calls based on values in the application data.
  
Line 149: Line 149:
 To create a new record, click on the "​INSERT"​ tab and select the "​POST"​ method from the dropdown menu. To create a new record, click on the "​INSERT"​ tab and select the "​POST"​ method from the dropdown menu.
  
-[[images/​rest18-insert-select-method.png|{{:images/rest18-insert-select-method.png}}]]+{{:visionx:​rest_services:​rest18-insert-select-method.png?nolink|}}
  
 We now have to enter the URL. We are going to use the demo resource again: We now have to enter the URL. We are going to use the demo resource again:
Line 155: Line 155:
 https://​cloud.sibvisions.com/​heroes/​services/​rest/​Heroes/​HeroesWorkScreen/​data/​heroes https://​cloud.sibvisions.com/​heroes/​services/​rest/​Heroes/​HeroesWorkScreen/​data/​heroes
  
-[[images/​rest18-insert-enter-URL.png|{{:images/rest18-insert-enter-URL.png}}]]+{{:visionx:​rest_services:​rest18-insert-enter-url.png?nolink|}}
  
 Next, we have to define the parameters for the data that we want to insert. This is done in the "​Payload"​ section at the bottom of the screen. Next, we have to define the parameters for the data that we want to insert. This is done in the "​Payload"​ section at the bottom of the screen.
Line 167: Line 167:
 The payload format can be selected from the dropdown menu on the right. The following formats are available: Text, Javascript, JSON, HTML, XML, Binary, and Multipart. The payload format can be selected from the dropdown menu on the right. The following formats are available: Text, Javascript, JSON, HTML, XML, Binary, and Multipart.
  
-[[images/​rest18-define-payload.png|{{:images/rest18-define-payload.png}}]]+{{:visionx:​rest_services:​rest18-define-payload.png?nolink|}}
  
 We can now test inserting a record by entering a Name under "​Parameters"​ on the right side of the screen, and then pressing the "Test INSERT"​ button. We can now test inserting a record by entering a Name under "​Parameters"​ on the right side of the screen, and then pressing the "Test INSERT"​ button.
  
-[[images/​rest18-test-insert.png|{{:images/rest18-test-insert.png}}]]+{{:visionx:​rest_services:​rest18-test-insert.png?nolink|}}
  
 The 200 status code means that the record was successfully inserted. We can see the result in the "Test result"​ window. The 200 status code means that the record was successfully inserted. We can see the result in the "Test result"​ window.
  
-[[images/​rest18-insert-complete.png|{{:images/rest18-insert-complete.png}}]]+{{:visionx:​rest_services:​rest18-insert-complete.png?nolink|}}
  
 //Note: REST services vary in their requirements for specifying columns when sending// //an "​INSERT"​ request. Please refer to each service'​s REST documentation for details.// //Note: REST services vary in their requirements for specifying columns when sending// //an "​INSERT"​ request. Please refer to each service'​s REST documentation for details.//
Line 185: Line 185:
 To update a record, click on the "​UPDATE"​ tab and select the "​POST"​ method from the dropdown menu. To update a record, click on the "​UPDATE"​ tab and select the "​POST"​ method from the dropdown menu.
  
-[[images/​rest18-update-select-method.png|{{:images/rest18-update-select-method.png}}]]+{{:visionx:​rest_services:​rest18-update-select-method.png?nolink|}}
  
 We also have to enter the URL again. Let's use the demo resource one more time: We also have to enter the URL again. Let's use the demo resource one more time:
Line 195: Line 195:
 https://​cloud.sibvisions.com/​heroes/​services/​rest/​Heroes/​HeroesWorkScreen/​data/​heroes/​[ID] https://​cloud.sibvisions.com/​heroes/​services/​rest/​Heroes/​HeroesWorkScreen/​data/​heroes/​[ID]
  
-[[images/​rest18-update-URL.png|{{:images/rest18-update-URL.png}}]]+{{:visionx:​rest_services:​rest18-update-url.png?nolink|}}
  
 Next, we have to define the parameters for the data that we want to insert. This is done in the "​Payload"​ section at the bottom of the screen. Next, we have to define the parameters for the data that we want to insert. This is done in the "​Payload"​ section at the bottom of the screen.
Line 207: Line 207:
 The payload format can be selected from the dropdown menu on the right. The following formats are available: Text, Javascript, JSON, HTML, XML, Binary, and Multipart. The payload format can be selected from the dropdown menu on the right. The following formats are available: Text, Javascript, JSON, HTML, XML, Binary, and Multipart.
  
-[[images/​rest18-update-payload.png|{{:images/rest18-update-payload.png}}]]+{{:visionx:​rest_services:​rest18-update-payload.png?nolink|}}
  
 We can now test updating a record by entering an ID and Name under "​Parameters"​ on the right side of the screen, and then pressing the "Test UPDATE"​ button. We can now test updating a record by entering an ID and Name under "​Parameters"​ on the right side of the screen, and then pressing the "Test UPDATE"​ button.
  
-[[images/​rest18-test-update.png|{{:images/rest18-test-update.png}}]]+{{:visionx:​rest_services:​rest18-test-update.png?nolink|}}
  
 The 200 status code means that the record was successfully updated. We can see the result with the updated name in the "Test result"​ window. The 200 status code means that the record was successfully updated. We can see the result with the updated name in the "Test result"​ window.
  
-[[images/​rest18-update-complete.png|{{:images/rest18-update-complete.png}}]]+{{:visionx:​rest_services:​rest18-update-complete.png?nolink|}}
  
 //Note: REST services vary in their requirements for specifying columns when sending// //an "​UPDATE"​ request. Please refer to each service'​s REST documentation for details.// //Note: REST services vary in their requirements for specifying columns when sending// //an "​UPDATE"​ request. Please refer to each service'​s REST documentation for details.//
Line 225: Line 225:
 To delete a record, click on the "​Delete"​ tab and select the "​DELETE"​ method from the dropdown menu. To delete a record, click on the "​Delete"​ tab and select the "​DELETE"​ method from the dropdown menu.
  
-[[images/​rest18-delete-select-method.png|{{:images/rest18-delete-select-method.png}}]]+{{:visionx:​rest_services:​rest18-delete-select-method.png?nolink|}}
  
 We now have to enter the URL. We are going to use the demo resource again: We now have to enter the URL. We are going to use the demo resource again:
Line 235: Line 235:
 https://​cloud.sibvisions.com/​heroes/​services/​rest/​Heroes/​HeroesWorkScreen/​data/​heroes/​[ID] https://​cloud.sibvisions.com/​heroes/​services/​rest/​Heroes/​HeroesWorkScreen/​data/​heroes/​[ID]
  
-[[images/​rest18-delete-enter-URL.png|{{:images/rest18-delete-enter-URL.png}}]]+{{:visionx:​rest_services:​rest18-delete-enter-url.png?nolink|}}
  
 Next, we simply have to identify the record we want to delete by entering its ID under "​Parameters"​. Press "Test DELETE"​ to test the request. Next, we simply have to identify the record we want to delete by entering its ID under "​Parameters"​. Press "Test DELETE"​ to test the request.
Line 241: Line 241:
 The 200 status code means that the record was successfully deleted. The 200 status code means that the record was successfully deleted.
  
-[[images/​rest18-test-delete.png|{{:images/rest18-test-delete.png}}]]+{{:visionx:​rest_services:​rest18-test-delete.png?nolink|}}
  
 ===== METADATA ===== ===== METADATA =====
Line 247: Line 247:
 In addition, metadata can be defined on the "​METADATA"​ tab. In addition, metadata can be defined on the "​METADATA"​ tab.
  
-[[images/​rest10-rest-metadata.png|{{:images/rest10-rest-metadata.png}}]]+{{:visionx:​rest_services:​rest10-rest-metadata.png?nolink|}}
  
 ===== AUTHORIZATION ===== ===== AUTHORIZATION =====
Line 286: Line 286:
   * **Bearer Token**<​html><​br></​html>​ Bearer Token is a very common method. There are different interpretations for each vendor to create the initial Bearer Token. We support - **Google, Microsoft, Dropbox, Salesforce und Adobe Sign**.<​html><​br></​html>​ <​html><​br></​html>​If you check "​Generate",​ then you can choose the vendor. Then fill in the client ID of the registered app, the redirect URL, e.g.: the url of your installed app or localhost, and the scope, i.e. which functions you want to call. After that click on "Get authorization code" to generate the authorization code. This will be automatically filled in the "​Authorization code" field. Please enter the Client Secret and click on "​Generate Token" to generate the Bearer Token. <​html><​br></​html><​html><​br></​html>​**//​Note - If you use another vendor, you have to create the Bearer Token via the vendor interfaces and enter it here as Bearer Token.//**   * **Bearer Token**<​html><​br></​html>​ Bearer Token is a very common method. There are different interpretations for each vendor to create the initial Bearer Token. We support - **Google, Microsoft, Dropbox, Salesforce und Adobe Sign**.<​html><​br></​html>​ <​html><​br></​html>​If you check "​Generate",​ then you can choose the vendor. Then fill in the client ID of the registered app, the redirect URL, e.g.: the url of your installed app or localhost, and the scope, i.e. which functions you want to call. After that click on "Get authorization code" to generate the authorization code. This will be automatically filled in the "​Authorization code" field. Please enter the Client Secret and click on "​Generate Token" to generate the Bearer Token. <​html><​br></​html><​html><​br></​html>​**//​Note - If you use another vendor, you have to create the Bearer Token via the vendor interfaces and enter it here as Bearer Token.//**
  
-====== Using Data from a REST Connection ​in a VisionX ​Application ======+====== Using Data in an Application ======
  
 Once the connection has been configured, you can use the data in VisionX just like a database table. Let’s take a look at how that is done. Once the connection has been configured, you can use the data in VisionX just like a database table. Let’s take a look at how that is done.
Line 292: Line 292:
 First, we open the "​Contacts"​ application that is pre-installed in VisionX. First, we open the "​Contacts"​ application that is pre-installed in VisionX.
  
-[[images/​rest19-contacts-app.png|{{:images/rest19-contacts-app.png}}]]+{{:visionx:​rest_services:​rest19-contacts-app.png?nolink|}}
  
 We will then add a new screen and name it "REST Test". Click "​Next"​. We will then add a new screen and name it "REST Test". Click "​Next"​.
  
-[[images/​rest20-new-screen.png|{{:images/rest20-new-screen.png}}]]+{{:visionx:​rest_services:​rest20-new-screen.png?nolink|}}
  
 For the layout, we select "Table with detail form" and "​Universal layout"​ and click "​Next"​. For the layout, we select "Table with detail form" and "​Universal layout"​ and click "​Next"​.
  
-[[images/​rest21-table-with-detail-form.png|{{:images/rest21-table-with-detail-form.png}}]]+{{:visionx:​rest_services:​rest21-table-with-detail-form.png?nolink|}}
  
 For the data source, we select "REST Service"​ and click "​Next"​. For the data source, we select "REST Service"​ and click "​Next"​.
  
-[[images/​rest22-rest-service-screen-type.png|{{:images/rest22-rest-service-screen-type.png}}]]+{{:visionx:​rest_services:​rest22-rest-service-screen-type.png?nolink|}}
  
 On the next screen, we select the REST service we just configured (Rest service 1) and click "​Next"​. On the next screen, we select the REST service we just configured (Rest service 1) and click "​Next"​.
  
-[[images/​rest23-select-rest-service.png|{{:images/rest23-select-rest-service.png}}]]+{{:visionx:​rest_services:​rest23-select-rest-service.png?nolink|}}
  
 On the following screen, we can enter a name for the data source (optional). On the following screen, we can enter a name for the data source (optional).
Line 314: Line 314:
 Also, if any config parameters were defined during configuration,​ they can be entered here. Common config parameters are username, password and the resource URL (or parts of it), which are all shown in this example. Also, if any config parameters were defined during configuration,​ they can be entered here. Common config parameters are username, password and the resource URL (or parts of it), which are all shown in this example.
  
-[[images/​rest24-datasource.png|{{:images/rest24-datasource.png}}]]+{{:visionx:​rest_services:​rest24-datasource.png?nolink|}}
  
 Click on the "​Test"​ button at the top right to test the connection. The results will show up in the table on the right side. Click on the "​Test"​ button at the top right to test the connection. The results will show up in the table on the right side.
  
-[[images/​rest25-test.png|{{:images/rest25-test.png}}]]+{{:visionx:​rest_services:​rest25-test.png?nolink|}}
  
 If necessary, column details can be edited in the "​Columns"​ table and the "​Column Details"​ section on the bottom right. If necessary, column details can be edited in the "​Columns"​ table and the "​Column Details"​ section on the bottom right.
  
-[[images/​rest26-column-details.png|{{:images/rest26-column-details.png}}]]+{{:visionx:​rest_services:​rest26-column-details.png?nolink|}}
  
 Click "​Finish"​ to create the new application screen. Click "​Finish"​ to create the new application screen.
  
-[[images/​rest27-new-screen-finish.png|{{:images/rest27-new-screen-finish.png}}]]+{{:visionx:​rest_services:​rest27-new-screen-finish.png?nolink|}}
  
 You can now use the REST data just like any other data table in VisionX. You can now use the REST data just like any other data table in VisionX.
  
-[[images/​rest28-test-complete.png|{{:images/rest28-test-complete.png}}]]+{{:visionx:​rest_services:​rest28-test-complete.png?nolink|}}
  
-====== ​VisionX REST Action Calls ======+====== Action Calls ======
  
 We can also use REST services in VisionX actions. To do that, we first define a new REST service and chose "​Action call" as the type. We can also use REST services in VisionX actions. To do that, we first define a new REST service and chose "​Action call" as the type.
  
-[[images/​restaction1-action-call-select.png|{{:images/restaction1-action-call-select.png}}]]+{{:visionx:​rest_services:​restaction1-action-call-select.png?nolink|}}
  
 We then add the authorization details, same as before (admin/​admin). We then add the authorization details, same as before (admin/​admin).
  
-[[images/​restaction3-authorization.png|{{:images/restaction3-authorization.png}}]]+{{:visionx:​rest_services:​restaction3-authorization.png?nolink|}}
  
 We then select the method and add the URL, just like in the previous examples. We then select the method and add the URL, just like in the previous examples.
Line 350: Line 350:
 We now have to enter the URL. We are going to use the demo resource again: We now have to enter the URL. We are going to use the demo resource again:
  
-https://​cloud.sibvisions.com/​heroes/​services/​rest/​Heroes/​HeroesWorkScreen/​data/​heroes {{:images/rest-config-action-1.png}}+https://​cloud.sibvisions.com/​heroes/​services/​rest/​Heroes/​HeroesWorkScreen/​data/​heroes {{:visionx:​rest_services:​rest-config-action-1.png?nolink|}}
  
 Next, we have to define the parameters for the data that we want to insert. This is done in the "​Payload"​ section at the bottom of the screen. Next, we have to define the parameters for the data that we want to insert. This is done in the "​Payload"​ section at the bottom of the screen.
Line 358: Line 358:
 The payload format can be selected from the dropdown menu on the right. The following formats are available: Text, Javascript, JSON, HTML, XML, Binary, and Multipart. The payload format can be selected from the dropdown menu on the right. The following formats are available: Text, Javascript, JSON, HTML, XML, Binary, and Multipart.
  
-[[images/​rest-config-action-2.png|{{:images/rest-config-action-2.png}}]]+{{:visionx:​rest_services:​rest-config-action-2.png?nolink|}}
  
 **//Note: Please define the parameter "​NAME"​ as runtime parameter. This will then be used as a parameter for the VisionX action. See next chapter.//​** **//Note: Please define the parameter "​NAME"​ as runtime parameter. This will then be used as a parameter for the VisionX action. See next chapter.//​**
  
-[[images/​rest-config-action-3.png|{{:images/rest-config-action-3.png}}]]+{{:visionx:​rest_services:​rest-config-action-3.png?nolink|}}
  
 We can now test inserting a record by entering a Name under "​Parameters"​ on the right side of the screen, and then pressing the "Test Action"​ button, and click "​Finish"​. We can now test inserting a record by entering a Name under "​Parameters"​ on the right side of the screen, and then pressing the "Test Action"​ button, and click "​Finish"​.
Line 368: Line 368:
 Now let’s go back to our application to test the action call. We first add a button to our application screen and name it "REST Call". Now let’s go back to our application to test the action call. We first add a button to our application screen and name it "REST Call".
  
-[[images/​restaction5-add-button.png|{{:images/restaction5-add-button.png}}]]+{{:visionx:​rest_services:​restaction5-add-button.png?nolink|}}
  
 We then define the action for the button by clicking on the "​Pencil"​ icon and selecting "​Create Action"​ at the bottom of the popup menu. We then define the action for the button by clicking on the "​Pencil"​ icon and selecting "​Create Action"​ at the bottom of the popup menu.
  
-[[images/​restaction6-create-action.png|{{:images/restaction6-create-action.png}}]]+{{:visionx:​rest_services:​restaction6-create-action.png?nolink|}}
  
 On the "​Action"​ tab, we select "Call REST Action"​ from the dropdown menu. On the "​Action"​ tab, we select "Call REST Action"​ from the dropdown menu.
  
-[[images/​restaction7-select-REST-action.png|{{:images/restaction7-select-REST-action.png}}]]+{{:visionx:​rest_services:​restaction7-select-rest-action.png?nolink|}}
  
 We then select the REST service we just defined using the pencil icon under "​Service"​. We then select the REST service we just defined using the pencil icon under "​Service"​.
  
-[[images/​restaction8-select-service.png|{{:images/restaction8-select-service.png}}]]+{{:visionx:​rest_services:​restaction8-select-service.png?nolink|}}
  
 The next screen shows the list of REST services that have been defined with the type "​Action call". In our example, there is only one ("REST service 2"), so we select it and click "​Next"​. The next screen shows the list of REST services that have been defined with the type "​Action call". In our example, there is only one ("REST service 2"), so we select it and click "​Next"​.
  
-[[images/​restaction9-select-service2.png|{{:images/restaction9-select-service2.png}}]]+{{:visionx:​rest_services:​restaction9-select-service2.png?nolink|}}
  
 Please fill the runtime parameter "​NAME"​ and click on "​Test"​ to test the REST action to add a new record. Then click Finsh. Please fill the runtime parameter "​NAME"​ and click on "​Test"​ to test the REST action to add a new record. Then click Finsh.
  
-[[images/​rest-action-use-1.png|{{:images/rest-action-use-1.png}}]]+{{:visionx:​rest_services:​rest-action-use-1.png?nolink|}}
  
 Now fill the "​NAME"​ parameter of the REST action with the value "​Hello"​. Now fill the "​NAME"​ parameter of the REST action with the value "​Hello"​.
  
-[[images/​rest-action-use-2.png|{{:images/rest-action-use-2.png}}]]+{{:visionx:​rest_services:​rest-action-use-2.png?nolink|}}
  
 Then click Finsh and test the app. A new record with the "​NAME"​ "​Hello"​ will be created on button click. To see the new record in the table click on Reload in the application. Then click Finsh and test the app. A new record with the "​NAME"​ "​Hello"​ will be created on button click. To see the new record in the table click on Reload in the application.
  
-===== REST Config ​Connection in the Application =====+===== Connection in the Application =====
  
 The REST connection can be configured in the application by opening the "​REST"​ item on the "​Settings"​ menu. The REST connection can be configured in the application by opening the "​REST"​ item on the "​Settings"​ menu.
  
-[[images/​restconfig-menu-1.png|{{:images/restconfig-menu-1.png}}]]+{{:visionx:​rest_services:​restconfig-menu-1.png?nolink|}}
  
 Here we can select the datasource and change the config parameters. Here we can select the datasource and change the config parameters.
  
-[[images/​restconfig-settings-2.png|{{:images/restconfig-settings-2.png}}]]+{{:visionx:​rest_services:​restconfig-settings-2.png?nolink|}}
  
-====== Exposing ​VisionX Application ​Data via REST ======+====== Exposing Data via REST ======
  
 VisionX application data can easily be exposed using our REST documentation. In this example, we are going to use the "​Contacts"​ application that comes preinstalled with VisionX. We first open the application:​ VisionX application data can easily be exposed using our REST documentation. In this example, we are going to use the "​Contacts"​ application that comes preinstalled with VisionX. We first open the application:​
  
-[[images/​restexp1-open-contacts.png|{{:images/restexp1-open-contacts.png}}]]+{{:visionx:​rest_services:​restexp1-open-contacts.png?nolink|}}
  
 When we open the "​Contacts"​ application screen, we see a list of contacts with addresses and other details. This is the data we want to expose. When we open the "​Contacts"​ application screen, we see a list of contacts with addresses and other details. This is the data we want to expose.
  
-[[images/​restexp2-open-contacts-screen.png|{{:images/restexp2-open-contacts-screen.png}}]]+{{:visionx:​rest_services:​restexp2-open-contacts-screen.png?nolink|}}
  
 To create the REST documentation,​ we first click on the dropdown arrow next to the "​Documents"​ button on the menu on the right side and select "REST Services"​. To create the REST documentation,​ we first click on the dropdown arrow next to the "​Documents"​ button on the menu on the right side and select "REST Services"​.
  
-[[images/​restexp3-open-doc-menu.png|{{:images/restexp3-open-doc-menu.png}}]]+{{:visionx:​rest_services:​restexp3-open-doc-menu.png?nolink|}}
  
 Select "​Create Swagger documentation"​ and click "​Next"​. Select "​Create Swagger documentation"​ and click "​Next"​.
  
-[[images/​restexp4-create-swagger-doc.png|{{:images/restexp4-create-swagger-doc.png}}]]+{{:visionx:​rest_services:​restexp4-create-swagger-doc.png?nolink|}}
  
 At the next step, we can select the application screens. All of them are checked by default, so we can just click "​Finish"​ to create the documentation for all screens. At the next step, we can select the application screens. All of them are checked by default, so we can just click "​Finish"​ to create the documentation for all screens.
  
-[[images/​restexp5-select-services.png|{{:images/restexp5-select-services.png}}]]+{{:visionx:​rest_services:​restexp5-select-services.png?nolink|}}
  
 A browser window will open with the documentation A browser window will open with the documentation
  
-[[images/​restexp6-swagger-view.png|{{:images/restexp6-swagger-view.png}}]]+{{:visionx:​rest_services:​restexp6-swagger-view.png?nolink|}}
  
 ====== GET ====== ====== GET ======
Line 436: Line 436:
 Let’s start with a GET REST call. Scroll down to "​Contacts"​ and click on the "​GET"​ line to expand it. Let’s start with a GET REST call. Scroll down to "​Contacts"​ and click on the "​GET"​ line to expand it.
  
-[[images/​restexp7-swagger-contacts.png|{{:images/restexp7-swagger-contacts.png}}]]+{{:visionx:​rest_services:​restexp7-swagger-contacts.png?nolink|}}
  
-[[images/​restexp8-swagger-contacts-get.png|{{:images/restexp8-swagger-contacts-get.png}}]]+{{:visionx:​rest_services:​restexp8-swagger-contacts-get.png?nolink|}}
  
 Then click on the "Try it out" button on the right side of the screen. Then click on the "Try it out" button on the right side of the screen.
  
-[[images/​restexp9-swagger-contacts-get-try.png|{{:images/restexp9-swagger-contacts-get-try.png}}]]+{{:visionx:​rest_services:​restexp9-swagger-contacts-get-try.png?nolink|}}
  
 We could now enter parameters, but we will leave those blank for now and scroll down and click the "​Execute"​ button. We could now enter parameters, but we will leave those blank for now and scroll down and click the "​Execute"​ button.
  
-[[images/​restexp10-swagger-contacts-parameters.png|{{:images/restexp10-swagger-contacts-parameters.png}}]]+{{:visionx:​rest_services:​restexp10-swagger-contacts-parameters.png?nolink|}}
  
-[[images/​restexp11-swagger-contacts-get-execute.png|{{:images/restexp11-swagger-contacts-get-execute.png}}]]+{{:visionx:​rest_services:​restexp11-swagger-contacts-get-execute.png?nolink|}}
  
 We can now see the contents of the "​Contacts"​ screen in the response body. We can now see the contents of the "​Contacts"​ screen in the response body.
  
-[[images/​restexp12-swagger-contacts-get-results.png|{{:images/restexp12-swagger-contacts-get-results.png}}]]+{{:visionx:​rest_services:​restexp12-swagger-contacts-get-results.png?nolink|}}
  
 We also get the same response if we take the "​Response URL" and paste it in the browser address line. We also get the same response if we take the "​Response URL" and paste it in the browser address line.
  
-[[images/​restexp13-get-contacts-request-url.png|{{:images/restexp13-get-contacts-request-url.png}}]]+{{:visionx:​rest_services:​restexp13-get-contacts-request-url.png?nolink|}}
  
-[[images/​restexp14-get-contacts-JSON.png|{{:images/restexp14-get-contacts-JSON.png}}]]+{{:visionx:​rest_services:​restexp14-get-contacts-json.png?nolink|}}
  
 ====== PUT ====== ====== PUT ======
Line 464: Line 464:
 We can also update a record using a PUT call. We first expand the PUT line in the "​Contacts"​ section and click the "Try it out" button. We can also update a record using a PUT call. We first expand the PUT line in the "​Contacts"​ section and click the "Try it out" button.
  
-[[images/​restexp15-swagger-contacts-put.png|{{:images/restexp15-swagger-contacts-put.png}}]]+{{:visionx:​rest_services:​restexp15-swagger-contacts-put.png?nolink|}}
  
 We first enter the primary key of the record we want to update. In this case, the primary key is the ID column, and we’ll pick "​2"​ for this example. We first enter the primary key of the record we want to update. In this case, the primary key is the ID column, and we’ll pick "​2"​ for this example.
  
-[[images/​restexp16-swagger-contacts-put-primary-key.png|{{:images/restexp16-swagger-contacts-put-primary-key.png}}]]+{{:visionx:​rest_services:​restexp16-swagger-contacts-put-primary-key.png?nolink|}}
  
 In the "​Body"​ section we can see all the fields on the "​Contacts"​ screen. In the "​Body"​ section we can see all the fields on the "​Contacts"​ screen.
  
-[[images/​restexp17-swagger-contacts-put-body.png|{{:images/restexp17-swagger-contacts-put-body.png}}]]+{{:visionx:​rest_services:​restexp17-swagger-contacts-put-body.png?nolink|}}
  
 To keep this example simple, we are only going to update the "First Name" field, so we can delete the rest of them. We also enter a new first name for that record. To keep this example simple, we are only going to update the "First Name" field, so we can delete the rest of them. We also enter a new first name for that record.
  
-[[images/​restexp18-swagger-contacts-put-new.png|{{:images/restexp18-swagger-contacts-put-new.png}}]]+{{:visionx:​rest_services:​restexp18-swagger-contacts-put-new.png?nolink|}}
  
 After clicking "​Execute",​ we can see that the first name has been updated. After clicking "​Execute",​ we can see that the first name has been updated.
  
-[[images/​restexp19-swagger-contacts-put-execute.png|{{:images/restexp19-swagger-contacts-put-execute.png}}]]+{{:visionx:​rest_services:​restexp19-swagger-contacts-put-execute.png?nolink|}}
  
 We can also see the updated record in VisionX after hitting the "​Reload"​ button. We can also see the updated record in VisionX after hitting the "​Reload"​ button.
  
-[[images/​restexp20-swagger-contacts-put-result.png|{{:images/restexp20-swagger-contacts-put-result.png}}]]+{{:visionx:​rest_services:​restexp20-swagger-contacts-put-result.png?nolink|}}
  
 ====== DELETE ====== ====== DELETE ======
Line 490: Line 490:
 We can delete a record using a DELETE call. To do that, we click on the "​Delete"​ line in the "​Contacts"​ section and hit the "Try it out" button. We can delete a record using a DELETE call. To do that, we click on the "​Delete"​ line in the "​Contacts"​ section and hit the "Try it out" button.
  
-[[images/​restexp21-swagger-contacts-delete.png|{{:images/restexp21-swagger-contacts-delete.png}}]]+{{:visionx:​rest_services:​restexp21-swagger-contacts-delete.png?nolink|}}
  
 Then we simply enter the ID of the record we want to delete and hit "​Execute"​. Then we simply enter the ID of the record we want to delete and hit "​Execute"​.
  
-[[images/​restexp22-swagger-contacts-delete-primary-key.png|{{:images/restexp22-swagger-contacts-delete-primary-key.png}}]]+{{:visionx:​rest_services:​restexp22-swagger-contacts-delete-primary-key.png?nolink|}}
  
 The response will simply show the 200 code, which stands for "​Successful operation"​. We can again hit "​Reload"​ in VisionX to confirm that the record has been deleted. The response will simply show the 200 code, which stands for "​Successful operation"​. We can again hit "​Reload"​ in VisionX to confirm that the record has been deleted.
Line 502: Line 502:
 The POST call is used to insert a new record. We first click on the "​POST"​ line in the "​Contacts"​ and then the "Try it out" button. The POST call is used to insert a new record. We first click on the "​POST"​ line in the "​Contacts"​ and then the "Try it out" button.
  
-[[images/​restexp23-swagger-contacts-post.png|{{:images/restexp23-swagger-contacts-post.png}}]]+{{:visionx:​rest_services:​restexp23-swagger-contacts-post.png?nolink|}}
  
 We can again see the list of all fields on the "​Contacts"​ screen. We can again see the list of all fields on the "​Contacts"​ screen.
  
-[[images/​restexp24-swagger-contacts-post-body.png|{{:images/restexp24-swagger-contacts-post-body.png}}]]+{{:visionx:​rest_services:​restexp24-swagger-contacts-post-body.png?nolink|}}
  
 We do not have to enter data for each field, but we have to make sure that data for the required fields is entered. Required fields are identified in VisionX by yellow highlights in the table. We do not have to enter data for each field, but we have to make sure that data for the required fields is entered. Required fields are identified in VisionX by yellow highlights in the table.
  
-[[images/​restexp25-contacts-check-required-fields.png|{{:images/restexp25-contacts-check-required-fields.png}}]]+{{:visionx:​rest_services:​restexp25-contacts-check-required-fields.png?nolink|}}
  
 We can also see the required fields in the data model in Design Mode (the "​Mandatory"​ column). We can also see the required fields in the data model in Design Mode (the "​Mandatory"​ column).
  
-[[images/​restexp26-contacts-required-fields.png|{{:images/restexp26-contacts-required-fields.png}}]]+{{:visionx:​rest_services:​restexp26-contacts-required-fields.png?nolink|}}
  
 Keeping that in mind, we now enter the data for the required fields and click "​Execute"​. Keeping that in mind, we now enter the data for the required fields and click "​Execute"​.
  
-[[images/​restexp27-swagger-contacts-post-execute.png|{{:images/restexp27-swagger-contacts-post-execute.png}}]]+{{:visionx:​rest_services:​restexp27-swagger-contacts-post-execute.png?nolink|}}
  
 In the response body we can see that the new record has been created with the data we entered. In the response body we can see that the new record has been created with the data we entered.
  
-[[images/​restexp28-swagger-contacts-post-response.png|{{:images/restexp28-swagger-contacts-post-response.png}}]]+{{:visionx:​rest_services:​restexp28-swagger-contacts-post-response.png?nolink|}}
  
 And again, we can hit "​Reload"​ in VisionX to confirm that the new record is there. And again, we can hit "​Reload"​ in VisionX to confirm that the new record is there.
  
-[[images/​restexp29-contacts-post-result.png|{{:images/restexp29-contacts-post-result.png}}]]+{{:visionx:​rest_services:​restexp29-contacts-post-result.png?nolink|}}
  
  
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information