User Tools

Site Tools


webapi_swagger_documentation

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
webapi_swagger_documentation [2020/05/06 13:43 (4 years ago)] kevinwebapi_swagger_documentation [2022/02/23 13:40 (2 years ago)] (current) kevin
Line 2: Line 2:
  
 ===== Summary ===== ===== Summary =====
-The s5webAPI solution runs as a 32-bit service and provides a doorway to push and pull information from a System Five database.  This technology will work with both onPrem installations and our System Five on Cloud deployments.  +The s5webAPI solution runs as a 32-bit service and provides a doorway to push and pull information from a System Five database.  This technology will work with both [[:webapi_installation|on premise installations]] and our System Five on Cloud deployments.  
  
 The following is an explanation for retrieving and using the Swagger 2.0 documentation from all available endpoints of the Windward S5WebAPI.  Several endpoints have been marked as deprecated in version 6.2.2.175 which occurred in August of 2018.  Deprecated methods will continue to operate but no new development is planned for these areas. The following is an explanation for retrieving and using the Swagger 2.0 documentation from all available endpoints of the Windward S5WebAPI.  Several endpoints have been marked as deprecated in version 6.2.2.175 which occurred in August of 2018.  Deprecated methods will continue to operate but no new development is planned for these areas.
Line 9: Line 9:
  
 <note important> Be aware that WEB API uses a Pervasive License. </note> <note important> Be aware that WEB API uses a Pervasive License. </note>
 +
 +<note> To use TLS 1.2 ensure you are running a version of the webapi above 6.2.4.255. </note>
  
  
Line 59: Line 61:
 ===== Known Limitations ===== ===== Known Limitations =====
  
-Prior to 6.2.2.175 released versions of the Web API had a maximum limit of 32 concurrent connections. This limit has been removed and is now limited by how much available memory (max 4GB as this is a 32 bit service) running the API.+Prior to 6.2.2.175 released versions of the Web API had a maximum limit of 32 concurrent connections. This limit has been removed and is now limited by how much available memory (max 4GB as this is a 32-bit service) running the API.
  
-<note tip> +The Swagger 2.0 interface is only supported via HTTP, it is not supported via HTTPS. The other methods described below can be used when HTTPS is the only protocol configured. 
-Due to the JSON parser that the Windward Web API usesany '%' characters inside of JSON strings can cause internal server errors The best practice is to scrub your JSON passed of these characters. + 
-</note>+===== Setup and Configuration Details ===== 
 + 
 +Configuring both HTTP and HTTPS is not required, but in order to support HTTPS communication and allow the use of the Swagger interfaceboth need to be configured.  
 + 
 +Azure Hosting - Network Security - Both the HTTP Port 80 and the HTTPS Port 443 need to be opened in order to allow external communication. The use of other Ports can be supported, but it is recommended that the standard HTTP - 80 and/or HTTPS - 443 be used to eliminate confusion. 
 + 
 +Azure VM - Firewall Rules - Inbound rules for the same HTTP Port 80 and/or HTTPS port 440 need to be added. 
 + 
 +The specific instance of the S5WebAPISvc.exe needs to have UDP and TCP Inbound rules to allow communication. 
 + 
 +Azure Environment Variables on the VM - A System Environment Variable named S5INIPATH must exists and contain the path to the SystemFive_SaaS.ini file that is used by System Five SaaS to launch the application. This INI file should already exists and be in use by the installation of SystemFiveSaaS.exe. The API now uses this same INI file to obtain required settings.
  
 ===== Retrieving The Documentation ===== ===== Retrieving The Documentation =====
Line 115: Line 127:
  
 ===== Samples  ===== ===== Samples  =====
 +<note tip>Sending blank strings for data fields could wipe out the values that exist in the database and unintentionally cause problems.  Only send data that you actually want the receiving API to process.</note>
   * [[webapi:examples:customers|How Customers work in System Five]]   * [[webapi:examples:customers|How Customers work in System Five]]
   * [[webapi:examples:customer_changes|Get Customers that have changed sample]]   * [[webapi:examples:customer_changes|Get Customers that have changed sample]]
Line 122: Line 135:
 ===== What Version are you using? ===== ===== What Version are you using? =====
 Depending on the feature you may be looking for in an endpoint you may need to know what version you are running.  Depending on the feature you may be looking for in an endpoint you may need to know what version you are running. 
- It is not uncommon to have a training and production WebAPI configured when testing new features.  Assuming the API is running and you are authenticated, you can access the application version using the TServerMethodsWebAPI and the Connect endpoint.+ It is common to have a training and production WebAPI configured when testing new features.  Assuming the API is running and you are authenticated, you can access the application version using the TServerMethodsWebAPI and the Connect endpoint.
   * http://API_IP_ADDRESS:API_PORT/Windward/WebAPI/TServerMethodsWebAPI/Connect   * http://API_IP_ADDRESS:API_PORT/Windward/WebAPI/TServerMethodsWebAPI/Connect
  
Line 132: Line 145:
  
 ===== Release 6.2.4.x History ===== ===== Release 6.2.4.x History =====
 +  * Review Further [[https://wiki.windwardsoftware.com/doku.php?id=release_notes:releasenotes624|Release notes]] for the Area changed: **Web API**
 +  * Version 6.2.4.185 - December 7, 2020
 +    * [ TFS 41605 / 58429 ] - The Inventory Changes end point has been enhanced to include changes in the stock level, not just the changes inventory records. The End Point will now include the changes made by Purchase Orders and Sales Invoices.
 +  * Version 6.2.4.141 - October 2, 2020
 +    * [ TFS 40116 ] - Web API: Added Logging information to the Web API Service to help determine the root cause of some runaway processes on the cloud.
 +  * Version 6.2.4.113 - August 14, 2020
 +    * [ TFS 36512 ] - The /addInventory method in the Inventory end point of the S5WebAPI is failing to find the non-Supplier Default records when adding Parts when the Item Code feature is enabled in System Five.
 +  * Version 6.2.4.80 - July 6, 2020
 +    * [ TFS 37259 ] - Web API Fix: to Inventory Changes endpoint to ensure proper functionality with pages.
 +  * Version 6.2.4.65 - June 19, 2020
 +    * [ TFS 31992 / 58075 ] Web API Fix: to include an email in the /Invoice/AddInvoice endpoint in InvoiceBilling & InvoiceShipping.
   * Version 6.2.4.10 – April 2, 2020   * Version 6.2.4.10 – April 2, 2020
     * [ TFS 33670 / 58200 ] Web API Fix: eCommerceExport=Y filter was not working for /InventoryChanges method     * [ TFS 33670 / 58200 ] Web API Fix: eCommerceExport=Y filter was not working for /InventoryChanges method
  
 ===== Release 6.2.2.x History ===== ===== Release 6.2.2.x History =====
 +  * Review further [[https://wiki.windwardsoftware.com/doku.php?id=release_notes:releasenotes627|Beta Release notes]] for the Area changed: **Web API**
   * Version 6.2.2.636 – March 12, 2020   * Version 6.2.2.636 – March 12, 2020
     * [ TFS 32447 / 58176 ] The Inventory/ End Point methods now accepts a Department Parameter to reduce the volume of data returned by the API by limiting Stock, Price, and Sale Date information to the requested Department. Also matched the contents of the Returned Pricing to the object listed in the Swagger documentation.     * [ TFS 32447 / 58176 ] The Inventory/ End Point methods now accepts a Department Parameter to reduce the volume of data returned by the API by limiting Stock, Price, and Sale Date information to the requested Department. Also matched the contents of the Returned Pricing to the object listed in the Swagger documentation.
Line 227: Line 252:
 ===== Beta 6.2.7.x History ===== ===== Beta 6.2.7.x History =====
 There can be functionality available in our beta that will not be present in our released product.  Typically new enhancement work is completed in this release. There can be functionality available in our beta that will not be present in our released product.  Typically new enhancement work is completed in this release.
 +  * Version 6.2.7.696 - December 9, 2020
 +    * [ TFS 41605 / 58429 ] -  The Inventory Changes end point has been enhanced to include changes in the stock level, not just the changes inventory records. The End Point will now include the changes made by Purchase Orders and Sales Invoices.
 +  * Version 6.2.7.615 - August 14, 2020
 +    * [ TFS 36512 ] - The /addInventory method in the Inventory end point of the S5WebAPI is failing to find the non-Supplier Default records when adding Parts when the Item Code feature is enabled in System Five.
   * Version 6.2.7.562 – April 28, 2020   * Version 6.2.7.562 – April 28, 2020
-    * [ TFS 34807 ] Fix for /AddInventory endpoint in S5webapi not updating list price.+    * [ TFS 34807 ] Fix for /AddInventory endpoint in S5webapi not updating list price. (Beta only)
   * Version 6.2.7.530 – March 25, 2020   * Version 6.2.7.530 – March 25, 2020
     * [ TFS 33670 / 58200 ] Web API Fix: eCommerceExport=Y filter was not working for /InventoryChanges method     * [ TFS 33670 / 58200 ] Web API Fix: eCommerceExport=Y filter was not working for /InventoryChanges method
Line 276: Line 305:
     * [56999] Added pagination to the Inventory, Virtual Inventory, Customer and A/P Bill endpoints to eliminate calls that exceed the maximum number of records that the S5WebAPISvc can handle.     * [56999] Added pagination to the Inventory, Virtual Inventory, Customer and A/P Bill endpoints to eliminate calls that exceed the maximum number of records that the S5WebAPISvc can handle.
  
-===== Troubleshooting =====+===== Common Errors/Issues ===== 
 +Best practices when troubleshooting errors or issues for escalation with engineering or another technician. 
 +  * Check the logs and capture the specific error message text (with an export of the logs or screenshot) 
 +  * Capture the complete S5webapi INI file settings 
 +  * Any other relevant information such as the operating systems (Are windows updates applied) 
 + 
 + 
 +** Getting POS Failure! {"error":"Assertion failure (R:\system5\projects\prgs\FullInvoice.pas, line 50886)"} when pushing an order through WEB API .** 
 + 
 +Reasons :  
 +The JSON that is being used is invalid.  
 + 
 +Only 1 InvoiceLines Array is allowed. 
 +The Description must only have 255 characters MAXIMUM! The database will throw away anything longer.  
 +The Invoice Comment must not contain invalid characters. (Carriage Returns and Line Feeds) 
 + 
 +Additional information: 
 +You do not need to include the InvoiceCustomer / InvoiceShipTo unique numbers AND the InvoiceShipping / InvoiceBilling 
 +One or the other is all that is required. If you know the Unique Numbers, use them. The system will ignore InvoiceShipping and InvoiceBilling data. 
 +If you don’t, then use the InvoiceShipping and InvoiceBilling. The system will look-up the Account records or create them. 
 + 
 +Here is what it should look like: 
 +<code> 
 +
 +  "Invoice":
 +    { 
 +      "InvoiceHeader":
 +        "InvoiceSubTotal": 87, 
 +        "InvoiceTaxTotal": 8.97, 
 +        "InvoiceOrdered": "2019-08-13T16:15:11.282Z", 
 +        "InvoiceDate": "2019-08-13T16:15:11.282Z", 
 +        "InvoiceType": "W", 
 +        "InvoiceSubType": "O", 
 +        "InvoiceDepartment": 0, 
 +        "InvoiceBookMonth": "2019-08-13T16:15:11.282Z", 
 +        "InvoiceCustomer": 31599, 
 +        "InvoiceShipTo": 31599, 
 +        "InvoiceSalesman": 1, 
 +        "InvoiceComment": "This is a test order. Please do not process! Item 1: This is a delivered product. Delivery 321 elm street  60607 Business. Product Name: Arrangement. Product Options: Color: Earth - 0, Size: Large - 20, Delivery: 60607 - 17. Recipient: TesterChicago, 3332221111, [email protected]. Card message: Hi, nnLook forward to you receiving these testing flowers.nnJoe. Delivery date 08/31/19." 
 +      }, 
 +      "InvoiceTenders":
 +        { 
 +          "Type": "O", 
 +          "Amount": 95.92 
 +        } 
 +      ], 
 +      "InvoiceLines":
 +        { 
 +          "PartUnique": 15868, 
 +          "Ordered": 1, 
 +          "Price": 50, 
 +          "Description": "This is a test order. Please do not process!" 
 +        }, 
 +        { 
 +          "Part": "SHIPPING", 
 +          "Ordered": 1, 
 +          "Price": 17, 
 +          "Description": "SHIPPING/DELIVERY" 
 +        } 
 +      ] 
 +    } 
 +  ], 
 +  "ConnectionInfo":
 +    "TerminalNumber":
 +  } 
 +
 +</code> 
 + 
 +You can prevent all of these problems by simply checking the JSON payload in a JSON editor like: 
 +https://jsoneditoronline.org/ 
 + 
 + 
 +** Adding Newline Feed on Invoice Comment ** 
 + 
 +In /addInvoice method, you can add Invoice Comment. In the parameter, look for this field "InvoiceComment" and add your comment.  
 + 
 +To add a new line feed, add this \\n in the comment. 
 + 
 +** Access Violation when making API call ** 
 + 
 +When troubleshooting the s5webAPI if receiving an access violation when making an API call, XML may require re-installation. 
 + 
 + 
 +**Getting a User Security Error on WordsToo.btr** 
 + 
 +If you are presented with a "User # Security Error on WordsToo.btr. User Record has been tampered with" message. 
 + 
 +The reason for this error message is due to the user account being locked out or expired and the S5webapi is trying to login using those credentials. 
 +   
 +To resolve this issue: 
 +  - Go to Setup Wizard > Users and Security > Go to user # (It is the WEB API log in)  
 +  - Uncheck the lockout tick box or reset the password 
 +  - Ensure the password is the same in the WebAPI.INI configuration 
 +  - Restart the S5WebAPI 
 +  - Optionally test the S5WebAPI using swagger if configured 
 + 
 + 
 +**LogAnaylytics:Socket Connection Error 10060** 
 + 
 +This happens when the Log Analytics workspace is unreachable. The API service keeps trying to connect to the workspace which causes it to use too much CPU on the client's server. 
 + 
 +As a workaround, we removed the Log Analytics argument from the ini file. 
 + 
 +{{:initestfile.jpg?direct&600|}}
  
-===Access Violation when making API call===+Once it is removed, CPU usage goes back to normal. 
  
-When troubleshooting the s5webAPI if receiving an access violation when making and API call re-install XML. 
webapi_swagger_documentation.1588797797.txt.gz · Last modified: 2020/05/06 13:43 (4 years ago) by kevin