I forgot to add the scope in the authentication url according to this document
1.Send a user to https://stackexchange.com/oauth, with these query string parameters
◦redirect_uri - must be under an apps registered domain
◦state - optional
You're treating the response as a UTF-8 encoded string. That's bound to fail with binary data like GZip. A quick fix is to use Encoding.GetEncoding("iso-8859-1") instead of UTF8 in StringToByteArray, and also pass this encoding to the StreamReader constructor in FetchURL.
That encoding maps bytes to codepoints one-to-one; see this answer on Stack Overflow.
I am aware that the last activity in this thread was more than four years ago, but since it still shows up in Google searches, I would like to point out some errors in the conversion.
I have no comments to the JSON.net related part of the converter, since that is what I searched for. But the conversion from and to UNIX timestamps is wrong.
A UNIX timestamp ...
You have to create a post describing your application, and edit it into your application's registration.
Basically, the first arrow needs a value; and you can set it when you edit (with the second arrow). Click "Manage your applications" in the homepage sidebar of Stack Apps to get to your application list.
We require this so that:
we always have a ...
As Brock Adams stated in his answer, you can't do this via the StacMan library.
Might I suggest an alternative?
You should be able to add new questions via the SEStandard library at SEStandard - A .NET Standard 1.1 compliant Stack Exchange client library that supports API v2.2.
using Scopes = ...
Sorry about that. Turns out, return URLs were broken on stackexchange.com entirely during signup and login. A fix is out now, so any API app auth redirect issues should also be resolved with it.
Please let me know if you see any other problems. Thanks for the report, and my apologies for the delay in fixing the issue.
In a nutshell and don't know ask me how to write this in C#:
That first "500 error" page is normal. You must display that to the user and the user must approve.
When the user approves, the page will redirect to a page (nominally stackexchange.com/oauth/login_success) with the access_token in the URL parameters. For example:
I don't know why but I am not able to install that package. I'll get this error:
PM> Install-Package StacMan
"StacMan 18.104.22.168" wurde erfolgreich installiert.
"StacMan 22.214.171.124" wurde erfolgreich deinstalliert.
Installationsfehler. Rollback wird ausgeführt...
Install-Package : Das Paket "StacMan 126.96.36.199" konnte nicht installiert werden. Sie versuchen, ...
Not working on Windows (8x64)
Firstly, it doesn't not install in C:\Program Files (x86)\StackWatcher but the executable is found in C:\Users\<user>\AppData\Roaming\StackWatcher.exe
Then I wasn't able to set the the user up as it couldn't get the site list
I guess it's suffering from the same sort of error StackApplet is
The active questions queue shows posts that have been edited. I like to watch that. But I can't get a List of Answers sorted by activity, only Questions. I am looking for something like this
var o = new PostOptions();
o.SortBy = Sort.Activity;
o.SortDirection = SortDirection.Descending;
o.FromDate = DateTime....