Rest API Connections

I cannot get Board to connect to an API using the Board Connector. The query runs properly via Chrome, Internet Explorer and the Command Line, the Log File says it cannot connect to the server. 

 

This suggests that Board isn't using the machine default proxy settings, but I cannot find anywhere to configure any Board specific proxy settings. 

 

The query I am trying to run is (I've removed the API Key):

 

https://api.darksky.net/forecast/{API KEY}/52.6308,1.2973?exclude=minutely,hourly,daily,alerts,flags

 

Anyone got any ideas of things I can try?

Answers

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers

    Hi,

     

    after running/connecting to the API do you get a new entry in BoardConnector log file ("BOARD\Dataset\Log\BoardConnector.log")?

    Maybe this can give you a hint, why it's not working.

    Some additional questions:

    Will the result be a streamed CSV or JSON? Is the authorization only be done via the API Key? Can you open the link direclty on the server running board? Do you need a proxy to conenct to hte internet?

     

    regards

    Björn

  • Hi Björn Reuber

     

    The Log file does get new entries. It says:

    [7/27/2018 2:20:30 PM] REST Adapter correctly created
    [7/27/2018 2:21:33 PM] Error executing query [Unable to connect to the remote server]
    [7/27/2018 2:21:33 PM] REST Adapter Job Done

     

    The result should be JSON. The auth is only by the API key. The link works directly on the server running Board.

    Yes I need a proxy to connect to the internet. Geomaps work in BOARD, so I'm assuming it can connect to the internet ok to download the map file.

     

    Thanks for your help!

     

    Neil

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers

    Hi,

     

    just an idea, but can you pleae run the BOARD Engine with your suer account? Cause maybe the port is blocked and this would be also an useful testcase

     

    regards

    Björn

  • Hi Björn Reuber

     

    Just tried that and get exactly the same problem.

     

    We've also checked our proxy logs, and the request doesn't seem to be leaving Board. 

     

    Thanks

     

    Neil

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers

    Hi,

     

    do you have a firewall which might block the request directly on the server?

     

    regards

    Björn

  • I don't think so, otherwise it would get blocked in the browser as well.

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers

    some firewalls are depending on the users account. So a request from a normal win user is not block, but requests from Service/System accounts

     

    regards

    Björn

  • Andy Makings any thoughts on Bjorn's response above?

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers
    edited March 2020

    have you tried to run the BOARD engine with a user account instead of the system account?

    You can define this in Windows Service window:

    image

    image

     

    Please be sure, that the account you're  using has enough rights (in windows) to start the service and also has writing access to board folder

     

    Regards

    Björn

  • Thank you so much Björn Reuber. That fixed the issue.

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers

    good to know that this fixed the problem.

    So it seems to be an environment/configuration problem on Windows side (and not within the BOARD Software) , cause it's working with a certain domain user, but not for local system. Maybe your IT Deparment can clarify the differences

     

    regards

    Björn

  • Hi Björn Reuber,

     

    I am also struggling with API in Board. It seems that my request url get some result.. but Board cannot handle it. What would your analysis be on the below log message?

     

    Thanks and kind regards,

     

    Joris

     

    [03/12/2018 15:28:55] Error executing query [Type 'System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' is not supported for deserialization of an array.]

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers

    Hi Joris,

     

    what is the result, when you run the query in a browser. Are furthermore getting some info within the log: "BOARD\Dataset\Log\BoardConnector.log"

     

    regards

    Björn

  • Hi Björn,

     

    When I run the query in a browser, I get the following result (anonymized)

    [{"data":{"date_range_from":"2018-12-01","rating_type":"OVERALL","value":[{"value":0.837,"timestamp":1543618800000},{"value":0.854,"timestamp":1543705200000},{"value":0.858,"timestamp":1543791600000}],"date_range_to":"2018-12-03"},"name":"xxxxxxxx","pid":xxxxxx}]

    In the board log I get the following:

    [03/12/2018 15:25:31] Error executing query [Type 'System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' is not supported for deserialization of an array.]
    [03/12/2018 15:25:31] REST Adapter Job Done

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers

    Hi,

     

    if I'm understanding it correct, the error occurs, cause board expect only one datapoint and not an array of datapoints

     

    regards

    Björn

  • Hi Björn,

     

    Would you be available for a go-to-meeting this friday to look further into this.

     

    I have a support ticket(39851) but you have already provided more valuable information until now ;-)

     

    Thanks and kind regards,

     

    Joris

  • Hi Neil Chapman and Björn Reuber,

     

    Thanks for raising this issue. I am currently trying to build a connector as well. As you have proposed I have created another user to run Board to avoid this error message. However, I am getting another one:

     

    3-4-2019 11:59:14] Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

     

    Any idea what is going wrong?

     

    Thanks!

     

    Rick