发送消息API错误

问题描述:

我发送带有XML bodyfrom我的iPhone应用程序发送消息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给我这个代码 – 2013-08-13 13:32:21

它不是封闭的之前起诉...

但现在的解决方案是

对其做...
它之前,我硬编码它在网络上的用户配置文件的URL显示的用户ID。
但它的工作与通过API即将到来的用户ID ..
但没有得到为什么linkedin用户不同的ID?

as
LinkedIn为每个用户/应用程序组合使用唯一的用户ID来保护用户的隐私。只有最初从成员请求(并获得)认证的应用程序才能使用该令牌来检索更多信息。

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