1
Vote

Topic Pagination Fails

description

When retrieving Topics for a project, the first page succeeds, while the next page fails with __"The remote server returned an error: (415) Unsupported Media Type."}

The Stack Trace is:
Apis.dll!Clonked.Basecamp.BasecampRequest.GetResponse(string method) Line 180 C#
Apis.dll!Clonked.Basecamp.BasecampRequest.GetResponse<System.Collections.Generic.IEnumerable<Clonked.Basecamp.Topic>>(string method) Line 204   C#
Apis.dll!Clonked.Basecamp.Api.Get<System.Collections.Generic.IEnumerable<Clonked.Basecamp.Topic>>(string action) Line 100   C#
Apis.dll!Clonked.Basecamp.Managers.TopicManager.GetInner(string action) Line 35 C#
Apis.dll!Clonked.Basecamp.Managers.TopicManager.GetTopicsForProject(int projectId) Line 17  C#
Apis.dll!Clonked.Basecamp.Project.Topics.get() Line 146 C#
Apis.dll!Clonked.Basecamp.Project.Messages.get() Line 134   C#
The request works properly in curl:
curl -X GET -u ruser:pass -H 'User-Agent: MyApp (user@email.com)' https://basecamp.com/9999/api/v1/projects/9999/topics.json&page=2

Any ideas?

Thanks,
Mark

comments

mrosenthal wrote Dec 9, 2016 at 3:34 PM

Found it:

Line 35 of TopicManager.cs is "var nextPageAction = action + "&page=" + page++;"

But should be :
var nextPageAction = action + "?page=" + page++;

Change the & to a ? and it works fine. The 415 error threw me off.