Wiki

Scale Your Enterprise

User Tools

Site Tools


bw2:web_service_tool

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bw2:web_service_tool [2021/02/10 16:05]
akoehler [Request Settings]
bw2:web_service_tool [2024/01/08 16:02] (current)
wgates [Request Settings]
Line 1: Line 1:
-====== Introduction (WebService Tool)======+====== Introduction (WebService Tool v2)======
  
-The Web Services tool is used to allow Bizweaver to interact with APIs from other applications. Bizweaver also has its own API in the form of the Bizweaver web service. Unfortunately, almost all APIs are different. This document describes how the Web Service tool is configured and provides some basic examples of how it is used for some major applications.+The Web Services tool is used to allow Bizweaver to interact with APIs from other applications. Bizweaver also has its own API in the form of the Bizweaver web service. This document describes how the Web Service tool is configured and provides some basic examples of how it is used for some major applications.
  
 ====== Related Documents ====== ====== Related Documents ======
Line 13: Line 13:
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
-Beginning in Bizweaver v2.0.170, two Web Service tools are displayed: WebService and WebService2. WebService2 provides a much more flexible way of working with web services including the use of REST Global Connections While workflows created using WebService will continue to function, any new workflows should use WebService 2. All references to “WebService” in this section refer to WebService2.+Beginning in Bizweaver v2.0.170, two Web Service tools are displayed: WebService and WebService2. WebService2 provides a much more flexible way of working with web servicesincluding REST Global ConnectionsWhile workflows created using WebService will continue to function, any new workflows should use WebService 2. All references to “WebService” in this section refer to WebService2.
 </WRAP> </WRAP>
  
  
   * **API** – Application Programming Interface. Technical tools to allow one application to interact with another, typically via “internet-type” methods.   * **API** – Application Programming Interface. Technical tools to allow one application to interact with another, typically via “internet-type” methods.
-  * **REST** - "REST" stands for **RE**presentational **S**tate **T**ransfer.  A RESTful API is an application program interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data.  REST technology is generally preferred to the more robust Simple Object Access Protocol (SOAP) technology because REST leverages less bandwidth, making it more suitable for internet usage.  SOAP APIs are not supported in Bizweaver.+  * **REST** - "REST" stands for **RE**presentational **S**tate **T**ransfer.  A RESTful API is an application program interface (API) that uses HTTP requests to GET, PUT, POSTand DELETE data.  REST technology is generally preferred to the more robust Simple Object Access Protocol (SOAP) technology because REST leverages less bandwidth, making it more suitable for internet usage.  SOAP APIs are not supported in Bizweaver.
  
  
 ====== Before You Begin ====== ====== Before You Begin ======
  
-Before you begin to configure a web service tool you will need information from the provider of your target API to know exactly what type of authorization will be used, what needs to be transmitted, and where (e.g. Body, Header, Cookies), and what will be returned.+Before you begin to configure a web service toolyou will need information from the provider of your target API to know exactly what type of authorization will be used, what needs to be transmitted, and where (e.g.Body, Header, Cookies), and what will be returned.
  
-  - The web service tool currently has two ways to work with known **REST** connections. +  - The web service tool currently has three ways to work with known **REST** connections. 
-  - The **Select Service** drop-down currently has two options: Custom and Salesforce.com. +  - The **Select Service** drop-down currently has three options: CustomSalesforce.com, and SAP Service Layer
-    - Custom is used for all cases other than Salesforce.com+    - Custom is used for all cases other than Salesforce.com and Service Layer.
     - The Salesforce.com option provides a predefined tool specifically for working with Salesforce.com. See **//[[bw2:salesforce_api|Salesforce API]]//** for more information on this tool.     - The Salesforce.com option provides a predefined tool specifically for working with Salesforce.com. See **//[[bw2:salesforce_api|Salesforce API]]//** for more information on this tool.
 +    - SAP Business One Service Layer is a new generation of extension API for consuming SAP Business One data and services.  [[https://help.sap.com/doc/0d2533ad95ba4ad7a702e83570a21c32/9.3/en-US/Working_with_SAP_Business_One_Service_Layer.pdf|Working with SAP Business One Service Layer]]
     - Additional predefined tools may be added in the future.     - Additional predefined tools may be added in the future.
   - When basic or oAuth 2 authentication is used, a REST Global Connection can be defined. This allows the use of the same information to be used for each call to the target system. In these cases, select the **Custom** as the Service, check the “Authentication Required” checkbox, and select the (previously defined) Global Connection from the “Select Service” drop-down.   - When basic or oAuth 2 authentication is used, a REST Global Connection can be defined. This allows the use of the same information to be used for each call to the target system. In these cases, select the **Custom** as the Service, check the “Authentication Required” checkbox, and select the (previously defined) Global Connection from the “Select Service” drop-down.
Line 37: Line 38:
  
  
-{{  :bw:webservice1.png?400  |WebService Tool}}+{{ :bw2:bizweaverwebservicetool1.png |}}
  
  
Line 51: Line 52:
     - The basic URI string can also be defined as a variable and then referenced using the <F4> option and adding additional qualifiers as needed.     - The basic URI string can also be defined as a variable and then referenced using the <F4> option and adding additional qualifiers as needed.
  
-As an example, here is the base URI to use the HANA Service Layer web services.+As an example, here is the base URI to use the Service Layer web services.
  
 https://YourServer:50000/b1s/v1 https://YourServer:50000/b1s/v1
  
-Instead of entering this string for each web service call we can optionally define the string as a variable.+Instead of entering this string for each web service callwe can optionally define the string as a variable.
  
  
  
-{{  :bw:webservice2.png?600  |WebService Variable}}+{{ :bw2:bizweaverwebservicetool2.png |}}
  
-Then, in the web service tool, we can reference the variable followed by the specific function we need to use. In the following image we are calling the Login function.+Then, we can reference the variable followed by the specific function we need to use in the web service tool. In the following imagewe are calling the Login function.
  
-{{  :bw:webservice3.png?600  |WebService Variable Usage}}+{{ :bw2:bizweaverwebservicetool3.png |}} 
 +  - Each web service must indicate the **Method** to be used. Select the appropriate method from the drop-down list.
  
-  - Each web service all must indicate the **Method** to be used. Select the appropriate method from the drop-down list.+{{ :bw2:bizweaverwebservicetool4.png |}}
  
-{{  :bw:webservice4.png?200  |WebService Methods}} +  - **Content-Type** is used to indicate the media type of the resource. Common content types in the Bizweaver environment include “application/XML” and “application/JSON.”
- +
-  - **Content** is used to indicate the media type of the resource. Common content types in the Bizweaver environment include “application/XML” and “application/JSON.”+
   - The **Advanced Settings** area contains three tabs: Body Information, Header Information, and Cookies. As always, refer to the API documentation for information about what you need to send in the request and where it needs to be placed.   - The **Advanced Settings** area contains three tabs: Body Information, Header Information, and Cookies. As always, refer to the API documentation for information about what you need to send in the request and where it needs to be placed.
   - The Body Information tab offers two additional options: **Raw** and **Form-Data**.   - The Body Information tab offers two additional options: **Raw** and **Form-Data**.
-  - The Raw option allows “free form” entry of whatever information is needed as illustrated below. +  - The Raw option allows “free form” entry of whatever information is neededas illustrated below.
- +
- +
-{{  :bw:webservice5.png?600  |WebService Advanced}}+
  
 +{{ :bw2:bizweaverwebservicetool5.png |}}
   - Form-Data allows the use of external/non-ASCII files or large binary data sets that contains the needed information to process webservice calls. This can be helpful when you have multiple web service calls that use the same information.    - Form-Data allows the use of external/non-ASCII files or large binary data sets that contains the needed information to process webservice calls. This can be helpful when you have multiple web service calls that use the same information. 
-  - x-www-form-urlencoded: Allows for simple text/ASCII data+  - x-www-form-urlencoded: Allows for simple text/ASCII data input
  
-{{  :bw:webservice6.png?600  |WebService FormData}}+{{ :bw2:bizweaverwebservicetool6.png |}}
  
   - The Header Information and Cookies tabs are free-form text and are used as needed by the API.   - The Header Information and Cookies tabs are free-form text and are used as needed by the API.
   - There are three remaining options in the Request Information tab.   - There are three remaining options in the Request Information tab.
  
-{{  :bw:webservice7.png?700  |WebService Other Options}}+{{ :bw2:bizweaverwebservicetool7.png |}}
  
   - **Ignore self-signed certificate errors** allows communication with sites that use self-signed SSL certificates. If the response to your request indicates a certificate error, try selecting this option.   - **Ignore self-signed certificate errors** allows communication with sites that use self-signed SSL certificates. If the response to your request indicates a certificate error, try selecting this option.
-  - **Format Variables for JSON** is used when Bizweaver variables are used in the web service call. Selecting this option ensures that the data passed through the call are formatted correctly. This only applies if the Content type is JSON.+  - **Format Variables for JSON** is used when Bizweaver variables are used in the web service call. Selecting this option ensures that the data passed through the call are formatted correctly. This only applies if the Content-type is JSON.
     - The **Timeout** value is used as a built-in "pause" mechanism.  It causes this step to wait for a response from the called web service.  The timeout value is only applied if a response is not received within the set time.     - The **Timeout** value is used as a built-in "pause" mechanism.  It causes this step to wait for a response from the called web service.  The timeout value is only applied if a response is not received within the set time.
     - Use the **File/Binary Data – Destination** option when the expected response is a file containing binary data. This option defines where the response file should be placed.     - Use the **File/Binary Data – Destination** option when the expected response is a file containing binary data. This option defines where the response file should be placed.
Line 95: Line 93:
 **Examples** **Examples**
   * If the called web service responds in two seconds, the workflow moves to the next step.   * If the called web service responds in two seconds, the workflow moves to the next step.
-  * If the called web service does not respond within the set number of seconds, the workflow will continue to the next step.  However, this may cause other issues if the subsequent steps rely on the web service call having completed.+  * If the called web service does not respond within the set number of seconds, the workflow will continue to the next step.  However, this may cause other issues if the subsequent steps rely on the web service call has been completed.
 </WRAP> </WRAP>
 <WRAP center round info 80%> <WRAP center round info 80%>
-If you have multiple web service call that can execute concurrently (at the same time), set the timeout value to 1.+If you have multiple web service calls that can execute concurrently (simultaneously), set the timeout value to 1.
 </WRAP> </WRAP>
  
-Once the request information has been provided, click the __Request__ link in the lower right corner of the screen. This will initiate a web service call to the target API based on the information provided. The screen will automatically shift to the Response tab so that you can review the results of the call.+Once the request information has been provided, click the __SEND__ link in the lower right corner of the screen. This will initiate a web service call to the target API based on the information provided. The screen will automatically shift to the Response tab to review the results of the call. 
 + 
 +==== Multipart\Formdata ==== 
 + 
 +In version 2.7.8 there was new functionality added to use the content type of multipart\formdata to send files and other key-value pairs through certain APIs that use this functionality. 
 + 
 +{{:bw2:multipart_form_data.png|}} 
 + 
 +  - Radio button to select the multipart/form-data API choice 
 +  - Key field to enter the name of the variable you are passing into the API  
 +  - The dropdown field that indicates if the value field is Text or a file if the file is selected the value box will have "..." that will open a file explorer to search and select files 
 +  - Value field this will allow you to either enter a file path or text 
 +    - If the file is selected a "..." will populate and allow you to add a file from the file explorer. A typed file path can be entered manually or a Bizweaver Variable can be added if this value changes. This file will be sent over as a binary file.  
 +    - If text is selected it will allow multi-line text that will be sent through the API 
 +  - Description allows you to enter a description of the field 
 +  - "X" will delete the row from the grid 
 + 
  
 ===== Response ===== ===== Response =====
Line 111: Line 126:
   - **Cookies** displays any cookies that are included in the response.   - **Cookies** displays any cookies that are included in the response.
     - Not all APIs will return cookies.     - Not all APIs will return cookies.
-    - If the target application uses cookies for authentication in subsequent requests, the cookies from the response can be referenced using Bizweaver step variables.+    - If the target application uses cookies for authentication in subsequent requests, the response cookies can be referenced using Bizweaver step variables.
   - **Details** displays detailed information returned from the call.   - **Details** displays detailed information returned from the call.
   - **Log** displays the information that was sent in the call.   - **Log** displays the information that was sent in the call.
Line 117: Line 132:
 Images are not provided for these tabs since the information will be different for each API and the call being made. Images are not provided for these tabs since the information will be different for each API and the call being made.
  
-In all steps in this document you should always refer to the API documentation for the information that you need.+In all steps in this documentyou should always refer to the API documentation for the information you need.
  
 ====== Specific APIs ====== ====== Specific APIs ======
  
-  * [[bw2:Bizweaver_API|Bizweaver API]] +  * **[[bw2:Bizweaver_API|Bizweaver API]]** 
-  * [[bw2:Salesforce_API|Salesforce.com]] +  * **[[bw2:Salesforce_API|Salesforce.com]]** 
-  * [[bw2:SBO_SL_v24|SAP Business One using Service Layer with Bizweaver v2.4]] +  * **[[bw2:SBO_SL_v24|SAP Business One using Service Layer with Bizweaver v2.4]]** 
-  * [[bw2:SBO_SL_v25|SAP Business One using Service Layer with Bizweaver v2.5 and higher]] +  * **[[bw2:SBO_SL_v25|SAP Business One using Service Layer with Bizweaver v2.5]]** 
-  * [[bw2:BigCommerce_API|BigCommerce API]]+  * **[[bw2:SBO_SL_v26|SAP Business One using Service Layer with Bizweaver v2.6 and higher]]** 
 +  * **[[bw2:BigCommerce_API|BigCommerce API]]** 
 + 
 + 
 +====Web Service Tool Variables=== 
 + 
 +^ Name           ^ Description^| 
 +|Alt-svc| HTTP header allows a server to indicate that another network location (the "alternative service") can be treated as authoritative for that origin when making future requests.| 
 +|AuthenticationRequired |True or False if the authentication required checkbox is selected| 
 +|BinaryDataFileName| This indicates the file name and location used for binary data and the exetension| 
 +|BodyInfo| This is the request body of the API call that is being sent if any| 
 +|BodyType| The type of body radio button that is selected ex. Raw,form-data etc.| 
 +|CF-Cache-Status| cache type being used for the API call default is Dynamic| 
 +|CF-Ray| This header is a hashed value that encodes information about the data center and the visitor’s request.| 
 +|Connection| This indicates that the WebService2 tool will keep the connection alive "keep-alive"
 +|Content-Encoding|The Content-Encoding representation header lists any encodings that have been applied to the representation (message payload), and in what order. This lets the recipient know how to decode the representation in order to obtain the original payload format. Content encoding is mainly used to compress the message data without losing information about the origin media type.| 
 +|Content-Length| The Content-Length header indicates the size of the message body, in bytes, sent to the recipient.| 
 +|Content-Security-Policy| The HTTP Content-Security-Policy response header allows website administrators to control the resources the user agent is allowed to load for a given page. With a few exceptions, policies mostly involve specifying server origins and script endpoints. This helps guard against cross-site scripting attacks (Cross-site_scripting).| 
 +|Content-Type| The Content-Type representation header is used to indicate the original media type of the resource (prior to any content encoding applied for sending). This will include the charset| 
 +|ContentType |The Content-Type representation header is used to indicate the original media type of the resource (prior to any content encoding applied for sending).| 
 +|CookieInfo| This will indicate if any information was entered in the cookies field if | 
 +|Date| This indicates the date and time the request is being made| 
 +|EnableJSONBodyFormat| True or False if the format body for JSON checkbox is selected| 
 +|Expect-CT| The Expect-CT header lets sites opt into reporting and/or enforcement of Certificate Transparency requirements, to prevent the use of misissued certificates for that site from going unnoticed.| 
 +|FileAttachment| This indicates the file that is attached to the request| 
 +|FormURLEncodedInfo| This indicates the data if any in the form URL encoded fields| 
 +|GraphQL| This indicates if the GraphQL radio button was selected | 
 +|HeaderInfo| This indicates if there was any header data passed into the API call| 
 +|HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT| Returns the number number of total API calls made and the total number available| 
 +|IgnoreCertificateErrors True or False if the ignore self-signed certificate errors checkbox is selected| 
 +|InputString| This is the data that is being sent to the Salesforce API| 
 +|IsBinaryData| True or False flag | 
 +|IsSuccessful| True or False flag that indicates if the API call was successful or not| 
 +|Link| This indicates the URL that is being returned by the API | 
 +|Location| This specifies the name and location of the binary that is being used for an API Call| 
 +|Method| The type of call you are making ex. Get,Post,Put,Patch,Delete| 
 +|NEL| The HTTP NEL response header is used to configure network request logging.| 
 +|OperationType| Dealing with the SAP SL or Salesforce connector it will be the option that is selected ex. Get Token, Interact with Data| 
 +|OutputString| This is the response returned from the API| 
 +|Referrer-Policy| The Referrer-Policy HTTP header controls how much referrer information (sent with the Referer header) should be included with requests. Aside from the HTTP header, you can set this policy in HTML.| 
 +|RequestTimeout| The length of time entered into the timeout field in the Webservice2 tool default 100 seconds| 
 +|RESTConnectionName| This indicates the connection used from the connection manager| 
 +|SalesForce_AccessToken| This indicates the Salesforce access token when generated using the Salesforce connector| 
 +|SalesForce_Behavior| Shows either Production or Sandbox| 
 +|SalesForce_InstanceID| This indicates the instance id sent back from Salesforce| 
 +|SalesForce_ManageData| This indicates if the manage object and data are selected when the Salesforce connector is selected| 
 +|SalesForce_ObjetName| This indicates what object is selected when managing data in the Salesforce connector | 
 +|SalesForce_RecordID| This indicates the record Id entered in the Record Id field in the Salesforce connector| 
 +|SAPServiceLayer_RecordIDDataType| This indicates the data type of Record Id for the SAP Service Layer Record Id field| 
 +|Server| the server that is used for the Webservice2 tool which is cloudflare| 
 +|ServiceType| This will show either “Get Token”, “Interact with data” or “Manage Objects” etc. For custom, it should be blank| 
 +|Set-Cookie| The Set-Cookie HTTP response header is used to send a cookie from the server to the user agent so that the user agent can send it back to the server later. To send multiple cookies, multiple Set-Cookie headers should be sent in the same response.| 
 +|StatusCode| The status of an API call response ex. 200, 400| 
 +|StatusDescription| The message for the API status code| 
 +|Strict-Transport-Security| The HTTP Strict-Transport-Security response header (often abbreviated as HSTS) informs browsers that the site should only be accessed using HTTPS and that any future attempts to access it using HTTP should automatically be converted to HTTPS.| 
 +|Transfer-Encoding| The Transfer-Encoding header specifies the form of encoding used to safely transfer the payload body to the user.| 
 +|URI| This indicated the URI entered into the Webservice2 tool| 
 +|Vary| The Vary HTTP response header describes the parts of the request message aside from the method and URL that influenced the content of the response it occurs. Most often, this is used to create a cache key when content negotiation is in use.| 
 +|X-Content-Type-Options| The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised in the Content-Type headers should be followed and not be changed. The header allows you to avoid MIME type sniffing by saying that the MIME types are deliberately configured.| 
 +|StepMessage| During a failure the reason for failure will be populated here| 
 +|StepStatus| True or False| 
 +|**Note**| Some APIs will return different variables that are specific to that API and not Bizweaver| 
bw2/web_service_tool.1612991101.txt.gz · Last modified: 2021/02/10 16:05 by akoehler