簡體   English   中英

使用Python將列表內容發布到Jive Connect頁面

[英]Post list contents to jive connect page using python

我正在嘗試將用戶名列表上傳到Jive內容頁面,但是每次嘗試都會得到405。 以下是我嘗試用於將一些內容發布到頁面的示例代碼

url = "https://connect.**.***.com/api/core/v3/contents?filter=entityDescriptor(102,786664)"
header = { "Content-Type": "application/json" }
username='*******'
passwd='******'
r = requests.put(url, headers=header,auth=(username,passwd),json=list_of_delegatedadmins, verify=False)
print r.content, r

有人可以幫幫我嗎。 我嘗試使用https://connect.**.***.com/api/core/v3/contents/contentid格式,但現在響應為400。

我找到了問題的答案。 需要發布的內容ID不是文檔ID(786664)。 發布前需要使用GET獲取內容。 從響應中提取ID "entityType" : "document", "id" : "786664", "resources" : { "entitlements" : { "allowed" : [ "GET" ], "ref" : "https://connect.**.***.com/api/core/v3/contents/1943462/entitlements" },

1943462是要在請求URL中傳遞的內容ID:

"url = "https://connect.**.***.com/api/core/v3/contents/1943462?minor=true" minor = true可確保沒有通知或通過此更改將更新發送給用戶

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM