Forum Discussion

bmeng's avatar
bmeng
New Contributor
7 years ago

How to list currently open reviews using JSON API?

I wanted to use JSON API via Python to retrieve all current open reviews (reviews that are not completed) from the Collaborator server. I have read the JSON API documentation and I did not find a suitable API to accomplish this.

 

Could you point out how to get such data? Thanks!

6 Replies

  • OlegB's avatar
    OlegB
    SmartBear Alumni (Retired)

    Hi bmeng,

     

    You can try to use a JSON API call as below:

     

    [
    {"command" : "SessionService.authenticate",
    
    "args":{"login":"admin","ticket":"ca5c7a6dca425ca5b885cc4c097e653a"}},
    {"command" : "UserService.getActionItems"}
    
    ]

     

     As a result, it will return all opened reviews for the authenticated user.

     

    Otherwise, you can use the ccollab admin wget command that will return the results of the "Reviews Currently in Progress" report or obtain the needed data from the database:

     

    ccollab admin wget "/go?page=ReportReviewList&formSubmittedreportConfig=1&reviewIdVis=y&reviewTitleVis=y&data-format=html&phaseFilter=inprogress"

    OR

    SELECT
    r.review_id AS "REVIEWID"
    ,r.review_phaseid AS "PHASE"
    FROM
    REVIEW r
    WHERE
    (r.review_phaseid=1 OR r.review_phaseid=8 OR r.review_phaseid=2 OR r.review_phaseid=3)
    ORDER BY
    r.review_id DESC

     I hope this helps!

     

     

    • bmeng's avatar
      bmeng
      New Contributor

      Hi OlegB,

       

      Thanks for your help.

       

      I tried to use with my login username & password:

      {"command" : "UserService.getActionItems"}

      But it is not what I want. The JSON response only lists all reviews that needs a my attention. In order to get another user's action items, I need know that user's login credentials which is not possible.

       

      I can query all open reviews from the Collaborator's web UI with my login credentials. What I wanted is an equivalent API that lists all open reviews easily using JSON.

       

      Regards,

      Bin

       

  • bmeng's avatar
    bmeng
    New Contributor

    Hello there,

     

    Is there a solution to my question? Thanks!

     

    Regards,

    Bin

  • OlegB's avatar
    OlegB
    SmartBear Alumni (Retired)

    Hi bmeng,

     

    I couldn't find any other API call that can satisfy your request. 

     

    >>>I can query all open reviews from the Collaborator's web UI with my login credentials.<<< Do you mean the "Reports" feature? In this case, the data that is shown there is fetched from the database directly. You can find what query was used there by clicking the "SQL" button.