2011-04-29 2 views
0
내가 XML의 bodyfrom 내 아이폰 응용 프로그램

메시지 보내기 API 오류

<mailbox-item><recipients><recipient><person path='/people/93619553' /></recipient><recipient><person path='/people/116008244' /></recipient><recipient><person path='/people/96885725' /></recipient></recipients><subject>Message from butterfli</subject><body>Aasd</body></mailbox-item> 

로 메시지 요청을 보낼 보내는 그러나이 오류를

++ LinkedIn engine reports failure for connection 3CD3052A-7061-4EA0-8863-5584270B9177 
The operation couldn’t be completed. (HTTP error 404.) 

코드를 얻고있다

- (RDLinkedInConnectionID *)sendMessage:(NSDictionary *)shareDict { 
    NSURL* url = [NSURL URLWithString:[kAPIBaseURL stringByAppendingString:@"/v1/people/~/mailbox"]]; 
    NSString *xmlStr = @"<mailbox-item><recipients>"; 
    NSArray *toIdArray = [[shareDict objectForKey:@"privacy"] componentsSeparatedByString:@","]; 
    for (int l=0; l<[toIdArray count]; l++) { 
     xmlStr = [xmlStr stringByAppendingString:[NSString stringWithFormat:@"<recipient><person path='/people/%@' /></recipient>", 
                [toIdArray objectAtIndex:l]]]; 
    } 
    xmlStr = [xmlStr stringByAppendingString:[NSString stringWithFormat:@"</recipients><subject>%@</subject><body>%@</body></mailbox-item>", 
               @"Message from butterfli",[shareDict objectForKey:@"text_message"]]]; 

    [NSString stringWithFormat:@"<share><comment>%@</comment><content><submitted-url>%@</submitted-url></content><visibility><code>anyone</code></visibility></share>", 
         [shareDict objectForKey:@"link_msg"],[shareDict objectForKey:@"link"]]; 
    NSData *body = [xmlStr dataUsingEncoding:NSUTF8StringEncoding]; 
    NSLog(@"xmlStr..%@",xmlStr); 
    return [self sendAPIRequestWithURL:url HTTPMethod:@"POST" body:body]; 
} 

미트 Battan

+0

Plz은 나에게이 코드를 전송 –

답변

0

해당되지 않음 ... 그 전에

소송을 제기하지만 지금이 솔루션은 완료

... 내가 웹에서 사용자 프로필의 URL에 표시되는 사용자 ID를 하드 코딩하고 그 전에
입니다.
하지만 API를 통해 들어오는 사용자 ID가 정상적으로 작동합니다 ..
하지만 왜 다른 사용자의 ID가 달라지는 지 알 수 없습니까?


으로 링크드 인은 사용자의 개인 정보를 보호하기 위해 각 사용자/응용 프로그램 조합에 대해 고유 한 사용자 ID를 사용합니다. 원래 구성원에게 인증을 요청한 (및 가지고있는) 응용 프로그램 만이 해당 토큰을 사용하여 추가 정보를 검색 할 수 있습니다.

http://developer.linkedin.com/thread/3044