Imgur

שולם
Verified
על ידי Imgur | מְעוּדכָּן 21일 전 | Entertainment
פּוֹפּוּלָרִיוּת

9.9 / 10

חֶבִיוֹן

1,143ms

רמת שירות

100%

Health Check

N/A

חזרה לכל הדיונים

Imgur API does not support "me" for account information

Rapid account: Luistrois
luistrois
7년 전

I have run the following code which sends a REST request to the mashape imgur API

import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Response;

import com.fasterxml.jackson.databind.JsonNode;
import com.jivecake.api.serializer.JsonTools;

public class ImgurTest {
    @org.junit.Test
    public void gallery() {
        String url = String.format("https://imgur-apiv3.p.mashape.com/3/account/me");

        Response response = ClientBuilder.newClient()
            .target(url)
            .request()
            .header("X-Mashape-Key", "key_hidden")
            .header("Authorization", "Client-ID client_id_hidden")
            .header("Content-Type", "application/x-www-form-urlencoded")
            .header("Accept", "application/json")
            .buildGet()
            .invoke();
        String content = response.readEntity(String.class);

        System.out.println(content);
    }
}

and I received the following response for this REST request

{
  "data" : {
    "error" : "Unable to find account username, me",
    "request" : "/3/account/me/images",
    "method" : "GET"
  },
  "success" : false,
  "status" : 404
}

The API documentation purports that “me” can be used for the currently authenticated account here: https://api.imgur.com/endpoints/account#current

Why does the above REST request not work?

Note that the mashape key and client ID are valid but are obscured but for the purposes of submitting this ticket.

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות