API for Mobile Apps - Older Versions

This article is obsolete as of version 2023-07-08.

For versions 2023-07-08 or newer, see this article instead.

In order to use the Crows Nest Mobile App, you must install and configure the API on the server that runs Crows Nest. Use the link below to download the latest CNAPI.zip file.

DOWNLOAD THE LATEST API


Updating the API from a Previous Version

During the initial implementation of Crows Nest, one of our team members installs and configures the API which is necessary for the mobile application to connect to the server hosting the Crows Nest database.

From time-to-time, as new releases of the mobile application become available and additional features are introduced, it is necessary to update the API to allow for continued functionality between the mobile and desktop applications.

Following these steps closely will ensure that your downtime is minimized to minutes.

Step-by-Step API Update

  1. Download the latest compressed API file (.zip) from above and note the full name of the .zip file.

  2. Login to the Windows web server that is currently running Internet Information Services (IIS) using an Admin account (or an account with full Sys Admin credentials)

  3. Launch Internet Information Services (IIS).

  4. On the left-hand menu tree, click to select CNAPI.

  5. On the far right-hand side, click on Basic Settings… under ‘Edit Site’.

     

  6. Make note of the physical path location of your current API configuration.
    (Note: It should be something like: C:\inetpub\cnapi)

     

  7. Open a Windows Explorer window and navigate to the inetpub folder.

  8. Create a NEW folder alongside of the folder named ‘cnapi’, but name it with the date obtained from the .zip file downloaded in step #1 (i.e., CNAPI_2023-03-20).

  9. Extract the contents of the downloaded .zip file into the newly created folder (Note: alternatively, you can open the downloaded .zip, CTRL+A to ‘Select All’, CTRL+C to copy the entire contents, and CTRL+V, to paste the contents into the newly created folder).

  10. Locate the Notepad App, right-click, and ‘Run as administrator’. Answer ‘Yes’ to the security question asking, “Do you want to allow this app to make changes to your device?”

     

  11. From Notepad, File->Open

  12. In the bottom right-hand corner select 'All Files’ from the dropdown.

     

  13. Browse to your current API (noted in step #6) and open the Web.config file with Notepad.

  14. In the section identified by a starting tag reading: <connectionStrings>, locate your current Data Source and copy (CTRL+C) the text string as outlined in this example (up to, but not including the semicolon). This will copy the string representing your server’s name and the Crows Nest database to your computer’s clipboard.

     

  15. Close the Web.config file without saving any unintended changes.

  16. From Notepad, browse to the NEW folder created in step #8.

  17. File->Open the Web.config file.

  18. Select the Data Source string up to, but not including the semicolon (just like in step# 14) and paste the copied string from your clipboard over the top of the placeholder data. This will make the new API’s data source match your current data source.

  19. Save the Web.config file and close it.

  20. Return to IIS and click the ‘Basic Settings…’ link on the far right-hand side (as in step#5).

  21. Click the elipse to the right of the physical path, browse to the location of the newly created folder with the Web.config file that you just modified (i.e., C:\inetpub\CNAPI_2023-03-20), and click OK.

  22. Confirm the ‘Physical path’ displays the new folder you created in step# 8 and Click OK.
    IIS will now use this latest version of the API.

  23. END


The name that you give the new folder you create is not critical. However, giving it a name that reflects the date that the API was published will allow you to easily identify one version from another over time. In the event there is ever a need to roll-back to the previous version, it will be easy to identify which folder to point IIS to. The naming convention for the API .zip files is: CNAPI_YEAR-MONTH-DAY.



  • The Data Source string in the web.config file that you download is a placeholder and must be replaced with YOUR server and database information.

  • Step #14, you copy the server\database string from your current working web.config file.

  • Step #18, you paste from your clipboard to overwrite the placeholder string of the NEW web.config file.