Comments (16)
by using the browser
from iqoptionapi.
This is in Java code, but quite clear and working.
The initial login is via a https post. the cookie ssid is used to keep the login alive, then we upgrade our https connection to a wss connection.
The following relates to the https URL's.
// precedes a comment in java. ; ends the code to run/line
// List of url's in use
private static final String url = "https://iqoption.com"; // base site
private static final String urlLogin = url + "/api/login"; // use https POST to login
private static final String urlGetProfile = url + "/api/getprofile"; // use https GET
private static final String urlChangeBalance = url + "/api/profile/changebalance"; // use https GET
when using this python coded api, use-
api = IQOptionAPI("iqoption.com", "yourLoginEmail", "yourPassword")
api.connect()
from iqoptionapi.
At 18:07 GMT the api works well
from iqoptionapi.
The login endpoint for the website is https://auth.iqoption.com/api/v1.0/login.
I haven't used nor worked on this API in a long time so I'm not sure.
Are you receiving a 404 error visiting it in a browser or through the API wrapper?
from iqoptionapi.
Hey @MadOne199 , i just converted your source to c#
`
HttpWebRequest request = WebRequest.Create("https://iqoption.com/api/login") as HttpWebRequest;
request.Method = "POST";
string _auth = string.Format("{0}:{1}", "[email protected]", "mydemopass");
string _enc = Convert.ToBase64String(Encoding.ASCII.GetBytes(_auth));
string _cred = string.Format("{0} {1}", "Basic", _enc);
request.Headers[HttpRequestHeader.Authorization] = _cred;
request.ContentType = "application/json";
var httpResponse = (HttpWebResponse)request.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
Response.Write(result);
}
`
But it returns
{"isSuccessful":false,"message":{"email":["E-mail "" is not valid"],"password":["Invalid password length"]},"result":[]}
Can you please help me why this response returns?
from iqoptionapi.
Can’t help with C# sorry. Never used it. The response indicates you are not using your real login email and password so check that first. I am of course assuming you have an account. I also don’t see where the post is being made ie iqoption.com or eu.iqoption.com? The fact that you have a response shows that you are nearly there. Not at a computer so sorry cannot be more helpful.
from iqoptionapi.
I read it all this time, I cannot see anything obvious and cannot try the code just now.
1/. The response says email and password incorrect. Check these values by a manual login via a web browser
2/ you are using http biut the site is https.
I know it may sound daft, but I had similar response and it was down to me using an incorrect password.
Please note that I only used this code to see how to do it. I don’t use the python code.
If still stuck at the weekend ask again and I will try to help
from iqoptionapi.
Did you already solve the problem? I have the same issue and don't know why...
@MadOne199 I tried to login manually --> works fine and http or https does not change the problem...
from iqoptionapi.
@HubSpace2000 Thats the default response if the post data is missing from the request.
@MadOne199 @SiliconDare You don't need to use the Authorization Header, you're not requesting a network authorization. Your content type is also wrong. Post the email address and password in the request stream. The following should work fine. Cheers!
HttpWebRequest HTTPRequest = WebRequest.Create("https://iqoption.com/api/login") as HttpWebRequest;
var PostData = Encoding.ASCII.GetBytes("[email protected]&password=eXaMpL3");
HTTPRequest.Method = "POST";
HTTPRequest.ContentType = "application/x-www-form-urlencoded";
HTTPRequest.ContentLength = PostData.Length;
using (var HTTPStream = HTTPRequest.GetRequestStream())
{
HTTPStream.Write(PostData, 0, PostData.Length);
}
var HTTPResponse = (HttpWebResponse)HTTPRequest.GetResponse();
using (var HTTPResponseStream = new StreamReader(HTTPResponse.GetResponseStream()))
{
var HTTPResponseString = HTTPResponseStream.ReadToEnd();
MessageBox.Show(HTTPResponseString);
}
@n1nj4z33 I think this issue can be closed now?
from iqoptionapi.
@HubSpace2000 Thats the default response if the post data is missing from the request.
@MadOne199 @SiliconDare You don't need to use the Authorization Header, you're not requesting a network authorization. Your content type is also wrong. Post the email address and password in the request stream. The following should work fine. Cheers!
HttpWebRequest HTTPRequest = WebRequest.Create("https://iqoption.com/api/login") as HttpWebRequest; var PostData = Encoding.ASCII.GetBytes("[email protected]&password=eXaMpL3"); HTTPRequest.Method = "POST"; HTTPRequest.ContentType = "application/x-www-form-urlencoded"; HTTPRequest.ContentLength = PostData.Length; using (var HTTPStream = HTTPRequest.GetRequestStream()) { HTTPStream.Write(PostData, 0, PostData.Length); } var HTTPResponse = (HttpWebResponse)HTTPRequest.GetResponse(); using (var HTTPResponseStream = new StreamReader(HTTPResponse.GetResponseStream())) { var HTTPResponseString = HTTPResponseStream.ReadToEnd(); MessageBox.Show(HTTPResponseString); }
@n1nj4z33 I think this issue can be closed now?
I needed to change the login url to the updated v1.0 and is working fine
It returns a session id something like this {"data":{"ssid":"90ab03c2e4ee732b3581ca9420f09c99"}}
But after this response how to get profile. The success url to retrieve profile is https://iqoption.com/api/getprofile but it returns {"isSuccessful":false,"message":"Not logged in","result":[]}
from iqoptionapi.
It’s been an year since I tried this, but from what I remember I was using the above code with a Cookie Container and WebSocket requests. Did you try the above code? What was in the JSON result?
from iqoptionapi.
It’s been an year since I tried this, but from what I remember I was using the above code with a Cookie Container and WebSocket requests. Did you try the above code? What was in the JSON result?
I already mentioned above that the login works fine and returns a ssid but having problem to get profile
from iqoptionapi.
How do you find all these urls?
from iqoptionapi.
@HubSpace2000 Thats the default response if the post data is missing from the request.
@MadOne199 @SiliconDare You don't need to use the Authorization Header, you're not requesting a network authorization. Your content type is also wrong. Post the email address and password in the request stream. The following should work fine. Cheers!
HttpWebRequest HTTPRequest = WebRequest.Create("https://iqoption.com/api/login") as HttpWebRequest; var PostData = Encoding.ASCII.GetBytes("[email protected]&password=eXaMpL3"); HTTPRequest.Method = "POST"; HTTPRequest.ContentType = "application/x-www-form-urlencoded"; HTTPRequest.ContentLength = PostData.Length; using (var HTTPStream = HTTPRequest.GetRequestStream()) { HTTPStream.Write(PostData, 0, PostData.Length); } var HTTPResponse = (HttpWebResponse)HTTPRequest.GetResponse(); using (var HTTPResponseStream = new StreamReader(HTTPResponse.GetResponseStream())) { var HTTPResponseString = HTTPResponseStream.ReadToEnd(); MessageBox.Show(HTTPResponseString); }
@n1nj4z33 I think this issue can be closed now?
hi, someone can help me? Hi, i have tried this code but i couldn't make it work.
i am receiving a 404 error! I have tryed two URLs: https://iqoption.com/api/v1.0/login and https://iqoption.com/api/login.
from iqoptionapi.
ok. i got it! the correct url is "https://auth.iqoption.com/api/v1.0/login"
from iqoptionapi.
thanks
from iqoptionapi.
Related Issues (20)
- Delayed iqoption data (Not realtime?) HOT 1
- Get pair list of active assets HOT 2
- API is not placing trades
- metatrader and IQ Option API
- Where did you get the IQOption endpoints ?
- Response <404> error with iqoption.com HOT 4
- how to place the commands on binary options in specifaint the times of expirations
- Asking mail address
- A winning Strategy
- URL iqoption.com/api/login not found HOT 1
- Can't open an option
- Could you attribute a license open source?
- where can i find the api.sell() example?
- amount left in tournamount
- Lower and Higher value of the candle
- How to get order result?
- How can I make the get real-time candles run async
- IQ Option Parameters
- 404 Client Error: Not Found for url: https://iqoption.com/api/login
- https://iqoption.com/api/profile/changebalance Can't change balance?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iqoptionapi.