Hello,
I need to communicate with an external server log regarding payment.
I think you'll create a custom code, please let us know the bapbeop.
The sample code.
API Spec
URL : https://api.kakao.com/v1/token/check.json
method : GET
Parameter
access_token : 카카오 유저 액세스 토큰
user_id : 카카오 회원번호
client_id : 게임의 클라이언트 아이디
sdkver : 이용중인 카카오게임 SDK 버전
Response Code
SUCCESS : 0
UNAUTHORIZED : 401, 토큰이 유효하지 않음
UNREGISTERED_USER : -13, 가입하지 않은 유저
ERROR : -500, 파라미터가 없거나 형식이 올바르지 않은 경우
Java Sample Code
String urlParameters = "client_id=88073051597566064" +
"&user_id=90360566856112065" +
"&access_token=H6pLrC3VMMn1eS6rF-Y-Vt3tGjQ2mDTz0BnWMNfsUrvBXz8lrhluRXRiJiUoBduXJK0LBMp9Je997NpfxYkcIg" +
"&sdkver=1.2.8";
String request = "https://api.kakao.com/v1/token/check.json?" + urlParameters;
URL url = new URL(request);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setReadTimeout(15*1000);
connection.connect();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
StringBuilder stringBuilder = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
stringBuilder.append(line).append("\n");
}
System.out.print(stringBuilder);
reader.close();
connection.disconnect();
Sample code, please.
Thank you.