Jump to content


Swarm API: Retrieve multiple reviews by ID

SWARM

  • Please log in to reply
2 replies to this topic

#1 Clutchplate

Clutchplate

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 30 January 2019 - 10:12 PM

Reading over the documentation, this URL should return two reviews:

http://p4swarm/api/v9/reviews?fields=author,id,participants,commits,created,state,stateLabel,description,updated,versions&ids[]=4200745&ids[]=4201131

Yet it only returns one, the first one (I tried switching the numbers and it only returned the other one).

I also tried

&ids[]=4200745,4201131 
  
which returned no reviews, and

&ids[]=4200745,ids[]=4201131 
  
which also returned no reviews, and

 &ids=4200745,4201131
  
which returned all reviews.

Is this broken or have I not stumbled upon the correct syntax, yet?

- Lutz

#2 P4Dale

P4Dale

    Advanced Member

  • Staff
  • 38 posts

Posted 05 February 2019 - 03:03 PM

Hello Lutz,

I have just tried this on our instance here and it returns both:

https://swarm.intern...ed,versions[]=1755291&ids[]=1755017

Quote

{

  • lastSeen: 1755017,

  • reviews:
    [


    • {

      • id: 1755291,

      • author: "J*****",

      • commits: [ ],

      • created: 1549355172,

      • description: "*************************************",

      • participants:
        {

        • J*****: [ ],

        • N*****: [ ]
        },

      • state: "needsReview",

      • stateLabel: "Needs Review",

      • updated: 1549358395
      },


    • {

      • id: 1755017,

      • author: "D*****",

      • commits: [ ],

      • created: 1549288416,

      • description: "*************************************",

      • participants:
        {

        • D*****: [ ]
        },

      • state: "needsReview",

      • stateLabel: "Needs Review",

      • updated: 1549289012
      }
    ],

  • totalCount: 2
}

Just want to confirm that 4200745  and 4201131 are both review ID's?

If they are changelist ID's your query should look like this:


http://p4swarm/api/v...versions[]=4200745&change[]=4201131



Regards,

Dale.

#3 Clutchplate

Clutchplate

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 05 February 2019 - 06:45 PM

As I mentioned in my original post, I can retrieve each review separately just fine, so they are both valid review IDs.

Your URL's are getting mangled by this forum software. Can you enclose them in code tags or something? When I hover over them, they only show partial URLs. I think it's getting confused be the square brackets.



Also tagged with one or more of these keywords: SWARM

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users