LinkedIn REST API:发送消息失败
我在向链接的连接发送消息时遇到一个问题。我使用了两个API,来更新配置文件,来向连接发送消息 更新个人资料对我来说很好,我甚至得到了一个1级连接。但是,在向连接发送消息时会出现问题 下面是我用来发送消息的XML代码LinkedIn REST API:发送消息失败,linkedin,Linkedin,我在向链接的连接发送消息时遇到一个问题。我使用了两个API,来更新配置文件,来向连接发送消息 更新个人资料对我来说很好,我甚至得到了一个1级连接。但是,在向连接发送消息时会出现问题 下面是我用来发送消息的XML代码 $xmlPostData = '<?xml version="1.0" encoding="UTF-8"?> <mailbox-item> <recipients> <recipient>
$xmlPostData = '<?xml version="1.0" encoding="UTF-8"?>
<mailbox-item>
<recipients>
<recipient>
<person path="/people/'.$iMemberId.'" />
</recipient>
</recipients>
<subject>Invitation to Connect</subject>
<body>Please Join On Eduroadmap</body>
<item-content>
<invitation-request>
<connect-type>friend</connect-type>
<authorization>
<name>'.$sAuthName.'</name>
<value>'.$sAuthValue.'</value>
</authorization>
</invitation-request>
</item-content>
</mailbox-item>';
在上面的代码中,$sUrl是=>,我添加了一个正确的访问令牌
我错过了什么?我试了很多,但什么也没找到。请访问。不管怎样,你从哪里得到$sAuthName和$sAuthValue的?从**处获得,并使用(api标准配置文件请求)。请求
以下是步骤:
示例:API调用必须满足API标准配置文件请求
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$sUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$xmlPostData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);