• R
    raylatbasix

    Good Morning Phil,

    You can cancel this request, I was able to solve my Authorization Request Header issue.

    Thanks again for all the help!!

    posted in User help read more
  • R
    raylatbasix

    Hi Phil,

    Yes, I saw that, and forgive my ignorance, I can generate user tokens. My problem is that I can only modify the URL on my third party app. I am not understanding how to pass this authorization token from within my request URL.

    Sorry for the crazy question :)

    EDIT: In other words, what is my URL's format for reqesting data? ie:

    http://localhost:8080/rest/v2/custom/latest-value-only/DP_e64bb726-ddd4-4065-8972-21c9441af408?access_token=<auth token here>??????
    

    posted in User help read more
  • R
    raylatbasix

    Hi Terry,
    Sorry for being a newbie, but How would I pass this JWT Auth token within a request URL to the Rest API?

    posted in User help read more
  • R
    raylatbasix

    On a side note to this application, When I use this Rest URL from my third-party app on the same network, Will I recieve any authentication challenges "Auth Tokens" before Mango will display the data? Right now, It works fine in my localhost browser, but I'm not sure about a remote application.

    posted in User help read more
  • R
    raylatbasix

    Hi Phil,

    Nevermind! Apparently the command:

    jar uf mango-api-3.6.0.jar com/infiniteautomation/mango/rest/v2/CustomizedRestController.class
    

    did not actually take the first time. I think Mango was running by mistake, when I ran it the first time.

    It's actually all working now, and I see the plain text data that I need for my application!!

    Brilliant as always Phil!!

    Thanks again!!

    posted in User help read more
  • R
    raylatbasix

    Thanks Phil,

    I was able to get it to compile by switching to the C:\Mango356\web\modules\mangoApi\lib directory, and then use the following command:

    javac -cp C:\Mango356\lib\*;C:\Mango356\web\modules\mangoApi\lib\* CustomizedRestController.java
    

    I then copied the CustomizedRestController.class file that was created, to the C:\Mango356\web\modules\mangoApi\lib\com\infiniteautomation\mango\rest\v2 directory.

    I then ran jar uf mango-api-3.6.0.jar com/infiniteautomation/mango/rest/v2/CustomizedRestController.class and did not recieve any errors at all. I then restarted Mango, and went into swagger, but fail to see any URL path t o access this custom endpoint. I tried accessing: http://localhost:8080/rest/v2/custom/latest-value-only/DP_059c7915-c0e7-48dc-b9e3-28ca8b92da01?fields=VALUE&limit=1&useCache=NONE but got a "page not found" error. Again, thanks for all the help!

    posted in User help read more
  • R
    raylatbasix

    Hi Phil,
    Thanks so much for offering a solution!! I believe I understand what I need to do.
    However, When I try to compile the class in Windows 7 using the following command:

    C:\Program Files\Java\jdk1.8.0_144\bin>javac -cp C:\Mango356\lib\*; C:\Mango356\
    web\modules\mangoApi\lib\CustomizedRestController.java
    

    I Recieve the following error:

    C:\Mango356\web\modules\mangoApi\lib\CustomizedRestController.java:11: error: pa
    ckage com.infiniteautomation.mango.rest.v2.exception does not exist
    import com.infiniteautomation.mango.rest.v2.exception.NotFoundRestException;
                                                         ^
    1 error
    

    I had copied the CustomizedRestController.java to my "C:\Mango356\web\modules\mangoApi\lib" directory,
    and also created the folders "com\infiniteautomation\mango\rest\v2" within the "C:\Mango356\web\modules\mangoApi\lib" directory as well. I'm sure I'm missing something. I do not do much java compiling.

    Thanks again for the help!

    posted in User help read more
  • R
    raylatbasix

    Hi Phil,

    I can update the URL on the third-party app, Just not modify any scripting on that side.

    posted in User help read more
  • R
    raylatbasix

    Hi Phil,

    There is a third-party app looking for plain text, when it query's another rest server's URL. This third-party app is currently connecting to a DGLux5 Rest server service which is responding with the plain text that the third-party app needs. I am looking to move to the Mango Rest API in order to eliminate the DGLux5 from the equasion. I am not able to modify the script on the third-party app that is currently looking for plain text, so I need a solution on the Mango side. Any ideas as to how I would go about creating a script that would accomplish stripping the JSON down to just the value alone being returned from the the third-party apps URL Get Request? Thanks for the help.

    posted in User help read more
  • R
    raylatbasix

    Rather new to the Rest API. Looking for help on changing the Response type when I request the following point Value URL:
    http://localhost:8080/rest/v2/point-values/latest/DP_059c7915-c0e7-48dc-b9e3-28ca8b92da01?fields=VALUE&limit=1&useCache=NONE
    Returns JSON:

    [ {
      "value" : "Community Center"
    } ]
    

    Instead, I need to strip off any JSON characters, and simply recieve a plain text response with the following:

    Community Center
    

    Any help on What I need to do to accomplish this, would be appreciated.

    posted in User help read more