Posting a jaiku using xcode

Posted by frameworkguy on Stack Overflow See other posts from Stack Overflow or by frameworkguy
Published on 2010-01-22T06:42:35Z Indexed on 2010/03/30 17:03 UTC
Read the original article Hit count: 318

Filed under:
|
|
|
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?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk