问题
There is a requirement to upload a file into a Community from an widget ( instead of going to files sections within a community and upload )
Can we upload files from an widget into a Community Files Section. I found this article here which talks about uploading files, but not under Community section. Is uploading files through community section possible ? Any reference would help
How do we get a Nonce in a widget ? Do we still need to pass authentication parameters, or can use those from the currently logged in user.
回答1:
You should look at http://www-10.lotus.com/ldd/appdevwiki.nsf/xpAPIViewer.xsp?lookupName=API+Reference#action=openDocument&res_title=Adding_a_file_using_a_multipart_POST_ic50&content=apicontent * however you you want to post this url pattern https://{serverUrl}/files/basic/api/communitylibrary/{communityUuid}/feed
For the nonce if you are in an iWidget specifically, you can look at the csrf_token and use that in the X-Update-Nonce header.
However, there is no guarantee that it remains named csrf_token. You should use http://www-10.lotus.com/ldd/appdevwiki.nsf/xpAPIViewer.xsp?lookupName=API+Reference#action=openDocument&res_title=Getting_a_cryptographic_key_ic50&content=apicontent
来源:https://stackoverflow.com/questions/28984433/ibm-connections-api-uploading-files-in-a-community-and-getting-nonce-widget