2015-11-06 64 views
0

我正在寻找通过API向社区添加大量成员的最有效方法。通过API向社区添加多个成员

我可以在社区管理界面看到有可能导入成员电子邮件地址的CSV,在API中是否有等效的方法?

我试过了,只是向标准社区成员端点发布成员条目的提要,但我得到了一条400条回应的消息:无效的成员条目。如果我单独发送相同的条目,该相同的端点工作正常。

我张贴到:/社区/服务/ ATOM /社区/成员communityUuid = XXX

回答

0

你发送应用程序/原子+ xml或application/atomcat + XML作为Content-Type头?

也许尝试这种模式。......更新,包括在进入饲料的xmlns

<feed> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:snx="http://www.ibm.com/xmlns/prod/sn"> 
<title type="text">Amy Jones2</title> 
<id>http://communities.ibm.com:2006/service/atom/community/members?communityUuid=2e68aa77-216c-4029-bedf-57d513abbaba&amp;[email protected]</id> 
<summary type="text">Amy Jones2</summary> 
<link href="http://lcauto53.swg.usma.ibm.com/profiles/atom/[email protected]" type="application/atom+xml"> 
</link> 
<link href="http://lcauto53.swg.usma.ibm.com/profiles/vcard/[email protected]" type="text/directory"> 
</link> 
<content type="xhtml"> 
    <div xmlns="http://www.w3.org/1999/xhtml"> 
    <span> 
     <a href="http://lcauto53.swg.usma.ibm.com/profiles/atom/[email protected]" class="url fn">Amy Jones2</a> 
     <div> 
     <a href="mailto:[email protected]" class="email">[email protected]</a> 
     </div> 
     <div class="x-guid">8af53b40-f6df-1032-9a75-d02a14283ea9</div> 
     <div class="x-community-role">member</div> 
    </span> 
    </div> 
</content> 
<published>2015-11-11T02:19:58.379Z</published> 
<updated>2015-11-11T02:19:58.379Z</updated> 
<contributor> 
    <email>[email protected]</email> 
    <snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">8af53b40-f6df-1032-9a75-d02a14283ea9</snx:userid> 
    <snx:userState xmlns:snx="http://www.ibm.com/xmlns/prod/sn">active</snx:userState> 
    <snx:isExternal xmlns:snx="http://www.ibm.com/xmlns/prod/sn">false</snx:isExternal> 
    <name>Amy Jones2</name> 
</contributor> 
<link href="http://lcauto53.swg.usma.ibm.com/communities/service/atom/community/members?communityUuid=2e68aa77-216c-4029-bedf-57d513abbaba&amp;userid=8af53b40-f6df-1032-9a75-d02a14283ea9" rel="self"> 
</link> 
<link href="http://lcauto53.swg.usma.ibm.com/communities/service/atom/community/members?communityUuid=2e68aa77-216c-4029-bedf-57d513abbaba&amp;userid=8af53b40-f6df-1032-9a75-d02a14283ea9" rel="edit"> 
</link> 
<snx:role xmlns:snx="http://www.ibm.com/xmlns/prod/sn" component="http://www.ibm.com/xmlns/prod/sn/communities">member</snx:role> 
<category term="person" scheme="http://www.ibm.com/xmlns/prod/sn/type"> 
</category> 
<snx:orgId xmlns:snx="http://www.ibm.com/xmlns/prod/sn">a</snx:orgId> 

+0

我无法检查,直到周一,但我相信,我们正在发送应用程序/原子+ XML,你是说它应该是应用程序/ atomcat + XML? – Ademund

+0

不管内容类型 – Ademund

+0

,您是否尝试过Feed格式?和你有什么版本4.0 4.5 5.0?您是使用托管版本(IBM Connections Cloud)还是内部部署?你有什么日志?你的确切响应代码和你确切的响应有效载荷是什么? –

相关问题