Jump to content


Member Since 18 Dec 2018
Offline Last Active Feb 11 2019 07:31 PM

Posts I've Made

In Topic: Swarm API: Retrieve multiple reviews by ID

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.

In Topic: Swarm API: C# API access

11 January 2019 - 07:26 PM

Ok, I got some help from colleagues and WebRequest is not really the right fit for this. Here's what does work:

_httpClient = new HttpClient { BaseAddress = new Uri(@"http://p4swarm") };
var authString = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{Environment.UserName}:{P4SwarmToken}"));
_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authString);
var p4Response = await _httpClient.GetAsync(@"api/v9/reviews");

- Lutz

In Topic: Swarm API: C# API access

10 January 2019 - 09:43 PM

Using Fiddler to look at the network traffic, Swarm does not even do an Authentication challenge. And sending the Authorization header has no effect either.

In Topic: Swarm API: Who approved the review

19 December 2018 - 07:25 PM

The activity version does work for me, though, so I'll use that. Thanks!

In Topic: Swarm API: Who approved the review

19 December 2018 - 07:21 PM

Thanks for the reply.
I am using the Swarm API to retrieve this data. The API docs REALLY could use some TLC. I don't see "approvals" as a field anywhere, in fact none of the commands list the available fields for each command.

However, this does not work for my server.

When I issue

I get this back:

I get the same result if I leave off "approvals" from the fields. And leaving off the fields spec entirely, it also does not return approvals either.

The "version" command returns:
{"apiVersions":[1,1.1,1.2,2,3,4,5,6,7,8,9],"version":"SWARM\/2018.1\/1660025 (2018\/05\/09)","year":"2018"}

Is this something that can be configured on the server?