Upcoming API Changes to Proposal_Open_Contract Call
We have noticed a discrepancy in our API.
The response from proposal_open_contract
is currently returning Boolean "false"
or "true"
for the is_sold
attribute, where the same response from the "buy" subscription call is returning 1 or 0 for the is_sold
attribute.
This should be as per the API documentation https://developers.binary.com/api/#proposal_open_contract either a 1 or 0.
We intend to fix this issue with a release around the 18th of January 2018.
Example of old response:
{ "echo_req": { "proposal_open_contract": 1 }, "msg_type": "proposal_open_contract", "proposal_open_contract": { "account_id": 39, "barrier": "5821.00", "barrier_count": 1, "bid_price": 7.85, "buy_price": 10, "contract_id": 339, "contract_type": "ONETOUCH", "currency": "USD", "current_spot": "5719.15", "current_spot_time": 1546935280, "date_expiry": 1548270000, "date_settlement": 1548277200, "date_start": 1546933571, "display_name": "Australian Index", "entry_spot": "5715.75", "entry_tick": "5715.75", "entry_tick_time": 1546933573, "is_expired": 0, "is_forward_starting": 0, "is_intraday": 0, "is_path_dependent": "1", "is_settleable": 0, "is_sold": false, "is_valid_to_sell": 1, "longcode": "Win payout if Australian Index touches 5821.00 through close on 2019-01-23.", "payout": "15.72", "profit": -2.15, "profit_percentage": "-21.50", "purchase_time": 1546933571, "shortcode": "ONETOUCH_OTC_AS51_15.72_1546933571_1548270000_5821_0", "status": "open", "transaction_ids": { "buy": 579 }, "underlying": "OTC_AS51" } }
Example of new response
{ "echo_req": { "contract_id": "259", "proposal_open_contract": 1, "subscribe": 1 }, "msg_type": "proposal_open_contract", "proposal_open_contract": { "barrier": "5821.00", "barrier_count": 1, "bid_price": 7.72, "buy_price": "10.00", "contract_id": "259", "contract_type": "ONETOUCH", "currency": "USD", "current_spot": "5719.30", "current_spot_time": 1546930378, "date_expiry": 1548270000, "date_settlement": 1548277200, "date_start": 1546930354, "display_name": "Australian Index", "entry_spot": "5719.30", "entry_tick": "5719.30", "entry_tick_time": 1546930378, "id": "7c9318d3-e313-afae-5f42-5adfbba36025", "is_expired": 0, "is_forward_starting": 0, "is_intraday": 0, "is_path_dependent": "1", "is_settleable": 0, "is_sold": 0, "is_valid_to_sell": 1, "longcode": "Win payout if Australian Index touches 5821.00 through close on 2019-01-23.", "payout": "15.45", "profit": -2.28, "profit_percentage": "-22.80", "purchase_time": "2019-01-08 06:52:34", "shortcode": "ONETOUCH_OTC_AS51_15.45_1546930354_1548270000_5821_0", "status": "open", "transaction_ids": { "buy": "499" }, "underlying": "OTC_AS51" } }
Comments
So, with this how do I integrate it to my php design to initiate opening of fresh(new) contract?
Secondly, do you have manual, to check available contract type string field names?
Thank you.
Emmanuel