Hi,
Piwigo ver.: 2.5.3.
Our team is writing a simple iOS app for auto login but got the following error message:
"stat": "fail","err";1002,"message":"Missing parameters: username, password"}
The portion of the iPhone/iPad app code is as follows:
[request setURL:[NSURL URLWithString:@"http://av.samplepiwigo.com/ws.php?format=json&method=pwg.session.login"]];
[request setHTTPMethod:@"POST"];
// [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
// NSString *post = @"username=[username]&password=[password]";
NSString *post = @"[username]&[password]";
inside [...] are user parameters.
The thing our team uncertain is whether we're using the correct URL (...ws.php?...) and format of the username and password above.
Can anyone please kindly advise?
Offline
the url is correct (because the answer is clear - you called the right method)
however the received username and password are either inexistent or empty. I cannot help on this one as I don't know ios
Offline
After some testing, I think we manage to get authentication successfully.
We get the reply: {"stat":"ok", "result":true}
Yet, as different from web-based login, we don't get the webpage after successful login. We've just got the above one-line message.
May I ask what is the link to proceed to load after a successful login?
I don't think you really get how a webservice works : it only exposes raw data and logical methods
once you are logged you can perform requests on other methods
but I didn't tell us what you want to achieve but I think it's no more directly related to Piwigo and you will get more help on specialized forums
Offline
hello
there is any option that allowed me to connect to the album with a specific username and password from ios?
have anyone done it?
thanks
Offline
Hi,
You may have a look here: https://github.com/Piwigo/Piwigo-Mobile
Cheers
Offline