I'm trying to anonymously get image data (like image sizes) through the Imgur Version 3 API through C#. Their documentation states
The API requires each client to use OAuth 2 authentication. This means you'll have to register your application, and generate an access_code if you'd like to log in as a user.
For public read-only and anonymous resources, such as getting image info, looking up user comments, etc. all you need to do is send an authorization header with your client_id in your requests. This also works if you'd like to upload images anonymously (without the image being tied to an account), or if you'd like to create an anonymous album. This lets us know which application is accessing the API.
Authorization: Client-ID YOUR_CLIENT_ID
So I added the Client-ID as a header to my HttpWebRequest. Here's my code below.
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("https://api.imgur.com/3/image/id/8ABRUYt");
webRequest.Headers.Add("Authorization", "Client-ID XXXXX");
Stream response = webRequest.GetResponse().GetResponseStream();
StreamReader reader = new StreamReader(response);
string responseFromServer = reader.ReadToEnd();
Console.WriteLine(responseFromServer);
reader.Close();
response.Close();
I get a 404 error, but that image clearly exists -> https://i.sstatic.net/1NJK2.jpg (Picture of a milky way bar). Am I doing anything wrong?