eikonapir - error 502

I am new in eikon api for R. When I try to get data I have this error:

> get_data("MSFT.O","TR.ISIN", debug=TRUE)
[1] "Request *************************************"
{"Entity":{"E":["DataGrid"],"W":{"instruments":[["MSFT.O"]],"fields":[{"name":["TR.ISIN"]}]}}}
[1] "Response *************************************"
[1] "<!DOCTYPE html>...Requested URL:\r\n\t\t\t</div>\r\n\t\t\r\n\t\t\t<div class=\"span6\">\r\n\t\t\t\thttp://localhost:9000/api/v1/data\r\n\t\t\t</div>\r\n\t\t</div>\r\n\r\n\t\t<div class=\"row\">\r\n\t\t\t<div class=\"span2 label\">\r\n\t\t\t\tReason:\r\n\t\t\t</div>\r\n\t\t\r\n\t\t\t<div class=\"span6\">\r\n\t\t\t\tInvalid argument\r\n\t\t\t</div>\r\n\t\t</div>..."
[1] "Response status *************************************"
[1] 502
Error in print.default("HTTP Error, code= ", response$status_code, sep = "") :
invalid 'digits' argument

I think it used to work several weeks ago.

There is a proxy in my enviroment but I do not have to explicitly set it in order to install packages or download files in R.

http://localhost:9000/ping?all

{"port":9000,"mode":"eikon4","pid":30764,"hasSecure":true,"startedTime":"Wed May 13 2020 09:25:01 GMT+0300 (FLE Daylight Time)","subApps":[{"path":"/heap"},{"path":"/ping"},{"path":"/sxs","data":{"hasSecure":true,"sxsApps":{}}},{"path":"/api"},{"path":"/sxs/v1/services/messenger"}]}

http://localhost:9000/api/v1/

{"code":404,"message":"Not Found","statusMessage":"Not Found"}

Best Answer

  • Jirapongse
    Answer ✓

    @svilen

    You can do a quick check with the curl command, as shown below.

    curl -H "Content-Type: application/json" -H "x-tr-applicationid: <app_id>" -L -X POST -v -d "{\"Entity\": {\"E\": \"DataGrid\",\"W\": {\"fields\": [{\"name\": \"TR.ISIN\"}],\"instruments\": [\"MSFT.O\"]}}}" http://localhost:9000/api/v1/data

    Please change <app_id> to your application id.

    If the curl command gets the same error code 502, it could be a problem in the machine's settings.

Answers