4 Replies Latest reply on Feb 8, 2017 11:42 PM by Likrant

    REST API and onBehalfOf

    Likrant

      I found in jive rest documentation ability to create documents (and messages) from the name of absent user (onBehalfOf):

      Jive REST API v3.14 → Document entity

       

      But after testing I cant see that feature in Jive (also can't see DB properties, also can't see via server debug).

      Does that feature enable and working for current jive 9.0.0.1 version? If "yes" - how I can use it?

       

      Jive is cloud, I can't use plugins and not all of users already join there, so can't use run-as feature too

        • Re: REST API and onBehalfOf

          onBehalfOf was available for some time now (I think 7.x) and it's useful for when you need to perform REST API calls from an access level instead of run-as which is system admin level. Are you including all the required fields and have access to that place? Your payload would look something like:

           

          {

            "content":

                {

                "type": "text/html",

                "text": "<body><p>Description</p></body>"

                },

            "type": "document",

          "onBehalfOf" :  {

          "email" : "user@email.com",

          "person" :  {

                "emails" : [ {

                  "jive_label" : "Email",

                  "primary" : true,

                  "type" : "work",

                  "value" : "user@email.com"

                }  ],

          }

          }

          }

            • Re: REST API and onBehalfOf
              Likrant

              I have all permissions. I include email and name. Person filed is read-only. Content created successfully, but behalfof in response is null and no properties in DB.

               

              I made research and found that behalfof works ONLY with external storage integrations And I can't find any usage of that field in regular REST endpoint (api/core/v3/contents)

               

              Do you really made it works by yourself?

            • Re: REST API and onBehalfOf
              jgoldhammer

              You could use the runAs-feature, but only with an admin account or a separate middleware where user actions are executed with an admin account...

               

              BTE, why is onBehalfof not available for all content types?? It is not available for blogposts, ideas etc.

              Jive REST API v3.14 → OnBehalfOf entity

               

              CC:Rashed Talukder

               

              Thanks

              Jens