2

iPhone アプリからステータス更新を投稿しようとしたときに、この返信を受け取りました。そして、私は自分が何を間違っているのかわかりません.ドキュメント、パケットスニッフィング、Linkedinフォーラム、およびLinkedin APIモンスターとの戦いをしているコードに出入りしましたが、このエラーを乗り越えることができません.この問題をトラブルシューティングおよび/または解決するために私ができることについて、知っている人からのポインタをお待ちしています:

data: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<status>401</status>
<timestamp>1349234286875</timestamp>
<request-id>ZAAVLR7K6H</request-id>
<error-code>0</error-code>
<message>[unauthorized]. OAUxxxxxxxx-xxxxxxxx|*xx|*xx:xxxxxxxx:lxxxxxxxxxxxxxxxx=</message>
</error>

これらの権限を要求します: r_fullprofile r_contactinfo r_emailaddress、rw_nus 承認用。

グラフ パスは次のように設定されます。

http://api.linkedin.com/v1/people/~/shares

認証後の私の基本署名は次のようになります。

POST&http%3A%2F%2Fapi.linkedin.com%2Fv1%2Fpeople%2F~%2Fshares&oauth_consumer_key%3Diws9c2xtzgdr%26oauth_nonce%xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1349234713%26oauth_token%xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%26oauth_version%3D1.0

これを開始するために呼び出すメイン コードは次のようになります。

- (void) updateStatus : (NSString *) status{
if (self.consumer != nil) {
OAMutableURLRequest *request =
[[OAMutableURLRequest alloc] initWithURL: requestURL
consumer: self.consumer
token: self.accessToken
callback: nil
signatureProvider: nil];

NSMutableDictionary *permsDict = [NSMutableDictionary dictionary];

[permsDict setValue: @"anyone" forKey: @"code"];

NSMutableDictionary *shareJSONDict = [NSMutableDictionary dictionary];

[shareJSONDict setValue: permsDict forKey: @"visibility"];
[shareJSONDict setValue: @"test" forKey: @"comment"];

[request setValue:@"application/json" forHTTPHeaderField:@"x-li-format"];

NSString *updateString = [shareJSONDict JSONString];

[request setHTTPBodyWithString:updateString];
[request setHTTPMethod:@"POST"];

OADataFetcher *fetcher = [[OADataFetcher alloc] init];

[fetcher fetchDataWithRequest: request
delegate: self.sessionDelegate
didFinishSelector: @selector(postUpdateApiCallResult:didFinish:)
didFailSelector: @selector(postUpdateApiCallResult:didFail:)];
}
}

これまでのところ、Linkedin API と格闘するのに 12 時間を費やしました。私がする必要があるのは、ユーザーの基本情報を取得して Linkedin で共有できるようにすることだけです。Facebook と Twitter では 30 秒かかりました。

4

1 に答える 1