n1nj4z33 / iqoptionapi

IQ Option API 4.x (Python 2.7) The project is obsolete and is not supported because of problems with access to IQ Options in Russia
121 stars 559 forks source link

Can't open an option #121

Open lucianopinheiro opened 4 years ago

lucianopinheiro commented 4 years ago

Since last change (from buyV2 to binary-options.open-option) I can't open an option. There is nothing wrong with my code (I guess). Every other websocket command they accept. Then I think there is something before (like an authorisation) I try to open. Oficial JSON captured in chrome:

{
   "name":"sendMessage",
   "request_id":"201",
   "msg":{
      "name":"binary-options.open-option",
      "version":"1.0",
      "body":{
         "user_balance_id":XXXXXXXX,
         "active_id":77,
         "option_type_id":3,
         "direction":"call",
         "expired":1582934880,
         "refund_value":0,
         "price":1.0,
         "value":859625,
         "profit_percent":87
      }
   }
}

My JSON

{
   "msg":{
      "body":{
         "option_type_id":3,
         "direction":"call",
         "refund_value":0,
         "price":1.0,
         "active_id":76,
         "expired":1586709000,
         "profit_percent":70,
         "value":859625,
         "user_balance_id":XXXXXXXX
      },
      "version":"1.0",
      "name":"binary-options.open-option"
   },
   "name":"SendMessage",
   "request_id":"499"
}

There is 2 main changes: the order (wich I don't control) and the request_id (sequential on website).