<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JAMA &amp;amp; the RESTful interface in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174167#M1206339</link>
    <description>&lt;P&gt;There are tokens written to the cookie file. I read the API documentation, and the examples are in JAVA (which is not LabVIEW). You use a single command with some command-line switches, and it just works. I am not successful in the translation, or there is some minute detail in an example that will free the bits from the security hassle.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Aug 2021 16:11:07 GMT</pubDate>
    <dc:creator>JoeLV1992</dc:creator>
    <dc:date>2021-08-24T16:11:07Z</dc:date>
    <item>
      <title>JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4073134#M1170666</link>
      <description>&lt;P&gt;I would like to download data from JAMA which has a RESTful interface.&amp;nbsp; I found examples in other programming languages,&amp;nbsp;&lt;A href="https://github.com/jamasoftware-ps/REST-References" target="_blank"&gt;https://github.com/jamasoftware-ps/REST-References&lt;/A&gt;&amp;nbsp;but I struggle to take these examples to something that works in LabVIEW.&amp;nbsp; Anyone have any suggestions/example of how to implement an example to get data out of JAMA?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 14:18:57 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4073134#M1170666</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2020-08-06T14:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4083201#M1174802</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/309011"&gt;@JoeLV1992&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I would like to download data from JAMA which has a RESTful interface.&amp;nbsp; I found examples in other programming languages,&amp;nbsp;&lt;A href="https://github.com/jamasoftware-ps/REST-References" target="_blank" rel="noopener"&gt;https://github.com/jamasoftware-ps/REST-References&lt;/A&gt;&amp;nbsp;but I struggle to take these examples to something that works in LabVIEW.&amp;nbsp; Anyone have any suggestions/example of how to implement an example to get data out of JAMA?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't know anything about JAMA. I do know RESTful requests are simply HTTP get\set requests. So you can use the VIs (Data Communication&amp;gt;Protocols&amp;gt;HTTP Client) and examples for HTTP...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A REST\RESTful request is simply a HTTP GET to the right URL. You can even type the URL in a browser, and get the result... A PUT set data, although often the server also accepts GET with the PUT data as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The send data are specific to JAMA. They can be plain text, binary, XML, anything really.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 09:40:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4083201#M1174802</guid>
      <dc:creator>wiebe@CARYA</dc:creator>
      <dc:date>2020-09-15T09:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4173885#M1206223</link>
      <description>&lt;P&gt;OK, I had to shelve this project for a little bit, and I am back to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I am getting stuck at authentication:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;Advanced Authentication (OAuth)&lt;/H4&gt;
&lt;DIV class="subgroup"&gt;
&lt;H5&gt;Basic Authentication&lt;/H5&gt;
&lt;P&gt;Most rest clients have an easy interface for basic authentication. You must provide your username and password in the header of the request following the RFC 2617 standard&lt;/P&gt;
&lt;P&gt;&lt;I&gt;Note: This type of authentication will not work in a SAML/SSO environment.&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;Examples for username: “myusername” and password: “mypassword”&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Header&lt;BR /&gt;&lt;CODE&gt;Authorization: Basic bXl1c2VybmFtZTpteXBhc3N3b3Jk&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Curl Example&lt;BR /&gt;&lt;CODE&gt;curl -u myusername:mypassword &lt;A href="http://basepath/rest/v1/projects" target="_blank" rel="noopener"&gt;http://basepath/rest/v1/projects&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;I am curious to know if the Open Handle is performing this function because I do not see authorization as one of the items to select from the add header function?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 Aug 2021 16:04:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4173885#M1206223</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2021-08-23T16:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174089#M1206303</link>
      <description>&lt;P&gt;Some more clues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JAMA has a utility called, "Swagger". It provides a developer interface to the REST API. There is a very simple GET procedure named, "/projects" that will provide a list of projects on a server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where the URL is (replacing the actual server name with &amp;lt;server name&amp;gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="microlight"&gt;&lt;A href="https://&amp;lt;server" target="_blank"&gt;https://&amp;lt;server_name&lt;/A&gt;&amp;gt;/contour/rest/latest/projects&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and the GET statement/URL is a CURL command as follows with the server name and token removed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;curl -X GET "https://&amp;lt;server_name/contour/rest/latest/projects" -H "accept: application/json" -H "jama-csrf-token: tokenremovedforprivacy"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where -H are GET statement headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So here is where I am limited with the LabVIEW toolkit:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) I cannot see what the actual URL with headers are that are sent to the server&lt;/P&gt;
&lt;P&gt;2) The headers I can see are the ones that I set. So I can set the accept header, but I cannot set the jama-csrf-token as is it is not a standard header&lt;/P&gt;
&lt;P&gt;3) The authentication function in the pallet is locked so I cannot see what it is doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 12:21:31 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174089#M1206303</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2021-08-24T12:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174093#M1206305</link>
      <description>&lt;P&gt;The HTTP Client library has a function Add Header.vi to add extra header fields. The header parameter is a drop down list with standard headers but it uses the LabVIEW Combo Box control which accepts ANY string you want to add, so just enter the header field name your service expects.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 12:42:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174093#M1206305</guid>
      <dc:creator>rolfk</dc:creator>
      <dc:date>2021-08-24T12:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174109#M1206313</link>
      <description>&lt;P&gt;Cool! Any idea on how to create the token?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 13:33:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174109#M1206313</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2021-08-24T13:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174138#M1206329</link>
      <description>&lt;P&gt;As I stumble through this, here is where I am at.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;in my URL, I needed the 's' in https to create a secure connection.&lt;/LI&gt;
&lt;LI&gt;I need the cookie file specified and the&amp;nbsp;jama-csrf-token appears in the cookie file. So I am going to believe that this is being handled under the hood.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;So now I get a lot more headers from the server, and with the reply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{"meta":{"status":"Unauthorized","timestamp":"2021-08-24T14:37:47.773+0000","message":""}}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So,&lt;STRONG&gt; I think&lt;/STRONG&gt;,&amp;nbsp; this must be a server or security thing to get setup. Onto bugging them.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 14:53:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174138#M1206329</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2021-08-24T14:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174149#M1206334</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/309011"&gt;@JoeLV1992&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Cool! Any idea on how to create the token?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is usually REST service specific. For many services you register at the service and receive a service token of some form. Possibly it is stored automatically in a cookie for the current session when you work from within a browser and if you stay in that browser session it may automatically reuse it but for other services you often need to register for a specific API token that identifies you or your application to the service provider. How that needs to be done varies per service and should be documented by the REST API documentation for that service.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 15:22:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174149#M1206334</guid>
      <dc:creator>rolfk</dc:creator>
      <dc:date>2021-08-24T15:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174154#M1206335</link>
      <description>&lt;P&gt;I also found this in the cookie file. JAMA may not support Netscape?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Netscape HTTP Cookie File&lt;BR /&gt;# &lt;A href="https://curl.haxx.se/docs/http-cookies.html" target="_blank"&gt;https://curl.haxx.se/docs/http-cookies.html&lt;/A&gt;&lt;BR /&gt;# This file was generated by libcurl! Edit at your own risk.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 15:40:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174154#M1206335</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2021-08-24T15:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174167#M1206339</link>
      <description>&lt;P&gt;There are tokens written to the cookie file. I read the API documentation, and the examples are in JAVA (which is not LabVIEW). You use a single command with some command-line switches, and it just works. I am not successful in the translation, or there is some minute detail in an example that will free the bits from the security hassle.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 16:11:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174167#M1206339</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2021-08-24T16:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174198#M1206351</link>
      <description>&lt;P&gt;It turns out we have SSL setup on our server. I found the function to setup SSL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://zone.ni.com/reference/en-XX/help/371361R-01/lvcomm/http_client_configssl/#Input2" target="_blank"&gt;https://zone.ni.com/reference/en-XX/help/371361R-01/lvcomm/http_client_configssl/#Input2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Curious, where do I obtain these files and key codes?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:05:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174198#M1206351</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2021-08-24T18:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174208#M1206354</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/309011"&gt;@JoeLV1992&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Curious, where do I obtain these files and key codes?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It depends. If your HTTP server is using a public certificate purchased from a known CA then you don't have to do much. Before LabVIEW 2021 you could have a problem that the local root certificates that the curl library uses, that is underneath the HTTP Client VIs, might be outdated and don't authenticate current CA certificates anymore. So they had to be updated from time to time if you try to access public web servers with SSL/TLS that don't verify anymore. In LabVIEW 2021 the HTTP Client VIs use the platform system certificate store now, which should be kept updated by Windows Update automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use so called self signed certificates for you SSL (more correct TLS, SSL is outdated and should not be used anymore but is still often used, even when referring to TLS in reality) setup on the server, you will have to export the public key of that certificate using for instance the OpenSSL command line tool and create a cer file that you can then specify for the CA_certificate_file to the SSL Config VI.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:28:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174208#M1206354</guid>
      <dc:creator>rolfk</dc:creator>
      <dc:date>2021-08-24T18:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174212#M1206357</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JAMA Basic Auth with SSL.png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/d88c8e5d1bcdfa24b953b61144ce362758df9380/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32393131373769383244333032413545384130354143382f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="JAMA Basic Auth with SSL.png" alt="JAMA Basic Auth with SSL.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;So, I got a response from the server and made it through the three gates of security to establish contact.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) The user name and password in open handle do nothing for the JAMA authentication.&lt;/P&gt;
&lt;P&gt;2) I had to make a custom header "Authorization" with the value "Basic &amp;lt;username&amp;gt;:&amp;lt;password&amp;gt;"&lt;/P&gt;
&lt;P&gt;3) My server is setup for SSL, and I only had to create a certificate for the CA certificate file input. This was done in chrome by clicking on the lock icon in the address bar, and exporting a 64 bit cer file.&lt;/P&gt;
&lt;P&gt;4) Verify Server is set to false. Setting it to true will generate an error on the GET command.&lt;/P&gt;
&lt;P&gt;5) I needed a cookie file so that the jama-csrf-token could be generated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps anyone else who may have to interface with JAMA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:45:57 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174212#M1206357</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2021-08-24T18:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: JAMA &amp; the RESTful interface</title>
      <link>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174388#M1206436</link>
      <description>&lt;P&gt;Update to the previous post. I was getting a server error with the previous post's code for malformed entry and thought it was due to the request I was making. Our server is setup for basic authentication/authorization. Therefore, I removed the SSL step and added in a 64 bit encoding based on the discussion from this group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.ni.com/t5/LabVIEW/Forcing-Authentication-with-HTTP-Client/td-p/2509656" target="_blank" rel="noopener"&gt;https://forums.ni.com/t5/LabVIEW/Forcing-Authentication-with-HTTP-Client/td-p/2509656&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what the code looks like now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JAMA Basic Auth.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/8517c778d8f26a4cc4662ba2a5f4610268fa619e/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32393132303369434334423739334642464141413746302f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="JAMA Basic Auth.png" alt="JAMA Basic Auth.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enjoy,&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 12:44:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/JAMA-amp-the-RESTful-interface/m-p/4174388#M1206436</guid>
      <dc:creator>JoeLV1992</dc:creator>
      <dc:date>2021-08-25T12:44:45Z</dc:date>
    </item>
  </channel>
</rss>

