3 Replies Latest reply on Apr 12, 2016 2:13 PM by pawans

    Unable to Change Author of Document Via API call

    harish1985

      I am not able to create document as another jive author. Using jive on rest v3 api to create a document and its created successfully. But i want to change the author while create a document.

       

      As i go through api documentation, their is author parameter, But did not getting what should pass in it ?

       

      Also author parameter is describe as "This value is used only when authorship is limited."

       

      Can any one help me to solve this issue?

        • Re: Unable to Change Author of Document Via API call
          pawans

          hi,

          you can try creating document using jive's run-as feature mentioned here Core V3 API - Run-As Feature & Signed Add-Ons

           

          As an admin you can run any jive rest api as someone else, in this case the person whom you are trying to make author.

          hope this helps.

          1 person found this helpful
            • Re: Unable to Change Author of Document Via API call
              harish1985

              Hello Pawan,

               

              Thanks for the response. I have jiveon sandbox account. Please tell me where i can enable this feature ?

               

              Did not get location "Admin Console > System > Management > System Properties" on my sandbox account.

               

              And also for access this feature by ADD On, Should i need signed Add on ?

                • Re: Unable to Change Author of Document Via API call
                  pawans

                  Hi Harish,

                  This feature requires you to be super admin on a jive instance, which I don't think is possible on the jive developer sandbox.

                  You need your own instance with admin access.

                   

                  Its not a must to have signed add-on.

                  You can have any system with admin credentials to call this api with run as.

                  But if you do create a signed add-on, you can use jive-sdk to call REST apis.

                  A signed add-on has the oauth tokens in community.json which you can utilize on your code.

                  Here's an example -

                   

                  jive.context.persistence.findByID("community", jiveUrl).then(function (community) {

                          jive.community.doRequest(community, {url: someApiUrl,

                                  "method": "GET" ,

                                  "headers":{

                                      "X-Jive-Run-As":"userid "+userId

                                  }

                              }

                          ).then(function (successResponse) {}, function(errorResponse){})

                      }