Я отправляю запрос на отправку сообщения с телом XML из моего приложения для iphone
<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];
}
Амит Баттан