macos-api-explorer

Step 1: Get an OAuth request token

/** This operation gets a request token as explained in the OAuth specification * section 6.1.1. Consumer Obtains a Request Token. This is the first phase of the authentication process. * You will need to the application key and the application secret key. */ - (void) getRequestToken { if (!consumer) { consumer = [[OAConsumer alloc] initWithKey:@"put_your_application_Key_here" secret:@"and_your secret_key_here"]; } NSURL *url = [NSURL URLWithString:[[NSString alloc] initWithFormat:@"%@/v1/oauth/request_token",URL_REQ]]; OAMutableURLRequest *request = [[OAMutableURLRequest alloc] initWithURL:url consumer:consumer token:nil // we don't have a Token yet realm:nil // our service provider doesn't specify a realm signatureProvider:nil]; // use the default method, HMAC-SHA1 [request setHTTPMethod:@"POST"]; OADataFetcher *fetcher = [[OADataFetcher alloc] init]; [fetcher fetchDataWithRequest:request delegate:self didFinishSelector:@selector(requestTokenTicket:didFinishWithData:) didFailSelector:@selector(requestTokenTicket:didFailWithError:)]; }