5 Replies Latest reply on Jul 18, 2016 6:04 AM by jlevi

    How to get inbox count for person by id in REST API?

    taras

      Hi. I want to get persons inbox count using admin credentials via REST API, but seems like there is no such API endpoint.

      For example : https://my.comunity.com/api/core/v3/people/SomeId/inbox/count.

      I can get persons activities, but not inbox. Please help me, maybe I'm doing something wrong. Thx.

        • Re: How to get inbox count for person by id in REST API?
          jlevi

          You should be using the /inbox endpoint (https://developers.jivesoftware.com/api/v3/cloud/rest/InboxService.html)

           

          For example:

           

          <community URL>/api/core/v3/inbox/counts

           

          Because it returns values for the person making the request, you'll have to use the "run as" (https://community.jivesoftware.com/docs/DOC-110343) mechanism to switch to the user you want.

            • Re: How to get inbox count for person by id in REST API?
              taras

              Can I use Run AS like standalone feature, if I'm using cloud? Because I cannot change system settings there

                • Re: How to get inbox count for person by id in REST API?
                  jlevi

                  You should read through the linked document to understand the requirments.  Run as needs to be enabled in the instance and the account you use to make API calls must have full administrator privileges:

                   

                  Using Run-As with Core API - Standalone

                  In the event you are just making a call to APIs and would like to leverage the Run-As feature, you will need to do the following:

                  1.       Setup a service account user that has Full Access permissions.

                  2.       Configure the jive.api.run_as.strategies property in the Admin Console > System > Management > System Properties (see above)

                  3.       When making the service call, you will need to pass an additional header in the UI:

                  .         X-Jive-Run-As [INSERT VALUE HERE]

                  o    if strategy is email, you would insert the user's email (i.e. bob@bob.com)

                  o    if strategy is userid, you would insert the user's Jive ID (i.e. 1234)

                  o    if strategy is username, you would insert the user's username (i.e. bob)

                  4.       Send the command, and validate that Run-As completed as intended.

                   

                  1 person found this helpful
                    • Re: How to get inbox count for person by id in REST API?
                      taras

                      Seems like you don`t understand my question. I'm full access admin.

                      Configure the jive.api.run_as.strategies property in the Admin Console > System > Management > System Properties. I cant see those properties.

                      I was trying to use curl like this one : curl -X POST -s -i -u "admin:pass" -H "Content-Type: application/json" --data "{'name': 'jive.api.run_as.strategies', 'value' : 'email' }" "https://muUrl/api/core/v3/admin/properties" But no results.

                      So:

                      • documentation says: "The service account must be a Full Access admin"
                      • the Jive doc says: "CAUTION: Cloud instances do not have the Full Access role."

                      So my question is:

                      • Is it possible to use "Run-As with Core API - Standalone" on a Cloud instance?
                        • Re: How to get inbox count for person by id in REST API?
                          jlevi

                          Yes, it is.  In the case of the cloud, you have to request the system property change via a support case - our support team can update the settings for you.  We do not give customers direct access to system properties in the cloud specifically to avoid losing control of settings that might affect an upgrade.

                          1 person found this helpful