0 Replies Latest reply on Sep 14, 2014 10:55 PM by ivanzhang

    Unlike content failed using Run-as Feature

    ivanzhang

      We are using the Run-as Feature(https://community.jivesoftware.com/docs/DOC-110343).

       

      We can get the actitities, people and like content through the Rest API. But when we unlike a content with the method "DELETE". The REST API returns 403 error.

       

      Our code is following:

         

       

      string requestUrl = "https://jive.home.url/api/core/v3/contents/45060/likes"

      using (WebClient client = new WebClient())

      {

          client.Encoding = Encoding.UTF8;

          string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(this.adminAccount + ":" + this.adminPassword));

          client.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;

          client.Headers[HttpRequestHeader.Accept] = "application/json";

          client.Headers[HttpRequestHeader.ContentType] = "application/json";

          if (!string.IsNullOrEmpty(this.currentUsername))

          {

              client.Headers.Add("X-Jive-Run-As", "username " + this.currentUsername);

          }

          string response;

          response = client.UploadString(requestUrl, "DELETE", string.Empty);

          response = response.Replace("throw 'allowIllegalResourceCall is false.';", string.Empty);

       

          return response;

      }

       

       

       

      I can confirm the admin account is correct. Who can help me find the root cause? Is it the jive's limitation? Can the run-as feature execute "DELETE" method?