views:

153

answers:

3
NSMutableURLRequest *jaikuRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://api.jaiku.com/json"]
                                                               cachePolicy:NSURLRequestUseProtocolCachePolicy 
                                                           timeoutInterval:60.0];



[jaikuRequest setHTTPMethod:@"POST"]; 
NSString *jbody= [NSString stringWithFormat:@"method=presence.send&user=XXusernameXX&personal_key=XXpersonalkeyXX&message=%@", 
encodedMsg];

[jaikuRequest setHTTPBody:[[NSString stringWithFormat:jbody] dataUsingEncoding:NSASCIIStringEncoding]];

I wrote the above code snippet to be able to post a jaiku on jaiku.com. I've come across similar samples in other languages for posting a jaiku. However i get the following response in the console:

{"status": "error", "message": "Invalid API user", "code": 0}

what could be the error or if im wrong, what is the correct approach to posting a jaiku using xcode?

+1  A: 

You are trying to use the legacy authentication which is deprecated and sounds like it might not be fully functional any longer (certainly untested):

http://www.jaiku.com/api/docs/authentication

You should try using the new OAuth authentication they document at the above link. definitely more complicated (and secure).

Dad
A: 

Is it possible that your username and/or password contain characters that cannot be placed in the string without encoding?

ntt
A: 

Is there any way to add contacts to a user's jaiku account using api?

reddd