Apps without app_id are blocked now

edited October 2019 in General

Please note that we have blocked access to apps accessing our api without app_id. We have communicated this through our facebook and twitter handle as well.

To register your please refer https://developers.binary.com/ (https://developers.binary.com/applications/)

As of now you will receive an error when you request any call. In future we will not allow connection for such apps.

Comments

  • I want to register for an app_id, but I don't have a redirect URL, or a public app (github, appstore, google play).

    Does this mean that you don't allow people to register an app just for their own personal use? Do you need to distribute it for you to receive an app_id?

  • @fonda you can still register app even if you don't have app on github, appstore, google play. Redirect url is url where we will redirect you with oauth token that you can use to authorize, this is standard nowadays. You can provide dummy value as of now to get app id then authorize using api token, but please note in future we may have more block on non standard apps.

  • I already have an app_id registered and the token is in my string. I have tested the token on the playground and it authenticates. But when it is in the string I am not being allowed to access the ws. I have also tried registering to get another token and all I get is this: I have put a dummy redirect in numerous formats including an https

    redirect_uri": "does not match the regex pattern ^(https?://)?(localhost:?\d/?|([\da-z.-]+).([a-z.]{2,8})([\/\w .-])*/?)$"

    Please advise?

  • I have registered my app (I also had that before, but I created a new API token and registered a new app because it stopped working and since I did not find the post here yet, I did not know what was going on), but it still says

     message: 'App id is mandatory to access our api. Please register your application.' },
    

    in the response of the authorize call using the API token from https://www.binary.com/en/user/security/api_tokenws.html.

    So do I actually need to specify the app_id in the request and how is that attribute named? It is not app_id, I already tested that.

  • edited February 2017

    Okay, I figured it out by myself.

    Here is the solution: you have to add app_id=0000 to the websocket URL: e.g. wss://ws.binaryws.com/websockets/v3?app_id=0000
    (replace 0000 with the id of your registered app)

    I am also wondering if there is some mailing list or newsletter for such important changes. Luckily I do not have any live apps out there.
    Before I found the forum I was thinking "no way... they wouldn't just change the current API version, that is not the way you do things", but they did. Which can be okay for security reason, but when people don't know it.. well.. lol...

  • @bambraptor i have been doing as you suggested but I am still getting the errors...so none the wiser....I do agree but hey all we need is the data... :)

  • @Middleend You need to pass the app_id in websocket url and then you can authorize using api token as well

    Code sample:

    var ws = new WebSocket('wss://ws.binaryws.com/websockets/v3?app_id=123');
    var result;
    ws.onmessage = function (msg) {
      result = JSON.parse(msg.data);
      console.log(result);
    };
    
    ws.onopen = function (e) {
        console.log("i am open send request", e);
        // authorize with oauth token or api token
        ws.send(JSON.stringify(authorize: <token>))
    }
    

    In place of token you can send your api_token as well

  • @Raunak or anyone who can help, I am getting the error: "App id is mandatory to access our api. Please register your application." to both "authorize" message and 'ticks history' message.

                function getbindata(){
                var ws = new WebSocket('wss://ws.binaryws.com/websockets/v3?app_id=xxxxx');
                ws.addEventListener('open', function(event){
                        ws.send(JSON.stringify({'authorize': 'xxxxx'}));
                });
                ws.addEventListener('message',function(event){
                    ws.send(JSON.stringify({"ticks_history": "frxGBPUSD","end": "latest","count":86400,"style":"candles","granularity":   
                                         14400,"subscribe":1}));
                    var jdata;
                    jdata = JSON.parse(event.data);
                    console.log('Message from Server',jdata)
                })
                }
    
  • @Middleend you need to register your app as specified above. You cannot pass random app id in this.

  • @Raunak have re-registered and noted app_id many thanks.

  • My websocket has been closing since ive registered my API which is for my personal use; ive been getting these errors

    this error i get in IE SCRIPT12030: WebSocket Error: Network Error 12030, The connection with the server was terminated abnormally
    this error i get in CHROME Websocket is already in closing or closed state
    ive been getting this error since i change my URL redirect in IE SCRIPT12002: WebSocket Error: Network Error 12002, The operation timed out

    ive tried to if was an update so i tested it on a computer that does not have auto updates still got errors ;to see if it where a network issue i tested it on a computer at work still got error , to test if it where ping issue shortened & Lengthen the ping interval still got an error , to check if it was the URL redirect issue i changed the URL redirect since that im getting a new error SCRIPT12002: WebSocket Error: Network Error 12002, The operation timed out

    ***Please Note****** I use a simple webpage/index file built in notepad that has a websocket connection with some buttons that is press automatically which worked perfectly fine before i registered it as an api below is the basic code without token & ID

    var ws = new WebSocket('wss://ws.binaryws.com/websockets/v3?app_id=0000');

    ws.onopen = function(evt) {
    ws.send(JSON.stringify({authorize:'000000000'}));
    };

    var intervalId = setInterval(function() {
    ws.send(JSON.stringify({ping:'1'}));
    }, 2500);

    ws.onmessage = function(msg) {
    var data = JSON.parse(msg.data);
    console.log('ping update: %o', data);
    };

    ws.onmessage = function(msg) {
    var data = JSON.parse(msg.data);
    console.log('authorize update: %o', data);
    };

    this the basic code to authorize

  • @don will debug this and get back to you

  • thanks for taking the time look at it ive been trying to figure it out for 3 weeks ; ive ran this code off binary.com https://developers.binary.com/demos/ ( saved it as index.html file in notepad and launched it in IE )also this also stopped without any error @ all in console or debugger i eventually switch out my ping code and used the ticks to substitute for my ping it also ran and stopped and produce no error in console or debugger it just stopped.

  • Does binary.com utilise a proxy server with there websockets ,proxy servers often close websockets if there deemed idle

  • We have timeout if connection is idle but as you said you are sending ping so it should not be problem. There is problem with vb websocket that it times out even if you send ping but as you are not using it so should be fine

  • i think the source of my problems is the time out of my connection now im getting no errors when i use the tick stream to substitute as ping also did u get to debug my code

  • Hi everyone,

    i am facing an issue in using C# API of binary.com

    i am getting following message in WebSoket Exception :

    "The Buffer type '96' is invalid. Valid Buffer types are : 'Close', 'BinaryFragment', 'BinaryMessage', 'UTF8Fragment', 'UTF8Message' "

    Below is the stackTrade from Visual Studio :

    at System.Net.WebSockets.WebSocketBase.GetMessageType(BufferType bufferType)
    at System.Net.WebSockets.WebSocketBase.WebSocketOperation.ReceiveOperation.ProcessAction_IndicateReceiveComplete(Nullable1 buffer, BufferType bufferType, Action acti on, Buffer[] dataBuffers, UInt32 dataBufferCount, IntPtr actionContext) at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()

    at Binary_Test.BinaryWS.d__5.MoveNext() in c:\Users\Ajay Kushwaha\Documents\Visual Studio 2013\Projects\Binary_Test\Binary_Test\Program.cs:line 50

    This exception has occurred recently, i have also used this API earlier but did not encounter this error.

    i am using the Sample Code Provided by binary.com at https://developers.binary.com/demos/

    Please help, if somebody has encountered this error too or suggest any solution please.

    Thanks in Advance
    Ajay

  • @don Yes I debugged your code and removed unnecessary callbacks. You were attaching lot of onmessage to single connection. Please note that latest one will override other on message. As best practice you should have single onmessage callback and check for msg_type

    <!DOCTYPE html>
    <html>
        <body>
            <div>
                <object> <button id="myBtn">Send to server: buy1</button></object>
            <div>
                <object> <button id="myBtn1">Send to server: buy2</button></object>
            </div>
            <div>
                <object> <button id="myBtn2">Send to server: buy3</button></object>
            </div>
    
            <!-- move script to end as best practice -->
            <script>
                var ws = new WebSocket('wss://ws.binaryws.com/websockets/v3?app_id=<app>');
    
                ws.onopen = function(evt) {
                    ws.send(JSON.stringify({authorize:'<token>'}));
                };
    
                // send ping every 1 minute
                var intervalId = setInterval(function() {
                  ws.send(JSON.stringify({ping:'1'}));
                }, 60000);
    
                // only one on message as adding multiple
                // will override previous one
                // classify response based on msg_type
                ws.onmessage = function(msg) {
                   var data = JSON.parse(msg.data);
                   var msg_type = data["msg_type"];
                   if (msg_type === "ping") {
                       console.log('ping update: %o', data);
                   }
                   if (msg_type === "authorize") {
                       console.log('authorize response: %o', data);
                   }
                   if (msg_type === "buy") {
                       console.log('buy response: %o', data);
                   }
                };
    
                // attach event handlers
                document.getElementById("myBtn").addEventListener("click", function MyFunction(evt){
                    ws.send(JSON.stringify(({parameters:{symbol:'R_100',amount:'1.10',basis:'stake',duration:'3',contract_type:'PUT',currency:'USD',duration_unit:'m'},price:'1.10',buy:'1'})));
                });
    
                document.getElementById("myBtn1").addEventListener("click", function MyFunction2(evt){
                   ws.send(JSON.stringify(({parameters:{symbol:'R_100',amount:'1.10',basis:'stake',duration:'3',contract_type:'CALL',currency:'USD',duration_unit:'m'},price:'1.10',buy:'1'})));
                });
    
                document.getElementById("myBtn2").addEventListener("click", function MyFunction3(evt){
                  ws.send(JSON.stringify(({parameters:{symbol:'R_100',amount:'2.25',basis:'stake',duration:'3',contract_type:'PUT',currency:'USD',duration_unit:'m'},price:'2.25',buy:'1'})));
                });
            </script>
        </body>
    </html>
    

    Please also have a look at https://github.com/binary-com/binary-live-api

  • Thanks for doing that im not actually a coder all the coeds i got is what i scraped together and found on the internet ; however is there still the issue of me being timed out or getting disconnected

  • @Raunak im looking to utilize something like this
    console.error = function(){
    window.location.reload();
    }
    i realize that upon refresh/reload everything is back to normal so i decided just to ignore the error and reload but this code is seemingly not working this a less complex code works but fires irregardless of an error

  • dondon
    edited April 2017

    @Raunk the code below seems to work tested it in chrome & IE anytime the websocket does not respond to pings or disconnects and is therefore closed it reloads

    ws.onclose = function(){
    location.reload();
    }

  • the vanilla node js example on github dont work? - https://github.com/binary-com/binary-live-api

  • Please raise github issue on that repo itself

  • Hello,
    I wrote with the E-Mail service and thei said, its not be possible to program my own robot f.e. with Python..
    But in this chat it looks like it would be possible.. How do you implement your code?

    best regards
    Christian

  • Hello fellows, i have something different and new engaged in trading binary option and forex trade , Here i have good strategy, unbeatable signal and best software that produces 98% profit payout investing minimum of $5,000 to earn profit payout of $50,000 on or before fourth and fifth working days of the week. Also if you have noticed a ripoff of your investment from your broker or your trader from $7,000 above, kindly message me on my email ( kenlynch507@gmail.com ) i will guide you to success , help you trade and make good profit in trading binary option and get your money back refund too if you don't know how to go for it.

Sign In or Register to comment.