I have a key and secret for the APIs, but I'm not able to get an OAuth Access Token from the /oauth/token API. I only ever get a 500 Internal Server Error.
Here's what my code looks like:
String auth = key + ":" + secretCombination;
Base64.Encoder encoder = Base64.getEncoder();
String encodedString = encoder.encodeToString(auth.getBytes(StandardCharsets.UTF_8) );
URL url = new URL(path);
HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
httpCon.addRequestProperty("Authorization", "Basic " + encodedString);
OutputStreamWriter out = new OutputStreamWriter(
When making a request to the Token API, you'll need to make sure you have a few things correct:
- Do a POST request to /oauth/token.
- Make sure you have the Authentication HTTP header value as
- Replace HASH with your key and secret, separated by a colon, and base64-encoded.
- Be sure you have a
Content-TypeHTTP Header with the value
- Lastly you need to send a body with the request:
Looks like you have steps 1-4 correct but are missing that body.
Informative update here and that looks pretty interesting. Would like to explore more about the game and also this https://www.collegessaywriter.com/research-paper/ link contains the professional's updates. Keep it up to bring more reliable updates for us.