package eu.hsrw.ias.ggd;

import Credentials.PlonkTest;
import HttpCall.PlonkHttpGet;
import org.json.JSONObject;

public class PlonkDataRequest {
    public static String x() throws Exception {
        String token;
        String result;
        {
            PlonkTest plonkTest = new PlonkTest();
            PlonkHttpGet plonkHttpGet = new PlonkHttpGet();
            String outputToken = PlonkHttpPostRequest.OnCallMethod();
            JSONObject obj = new JSONObject(outputToken);
            token = obj.getString("access_token");
            String urlExtension= plonkTest.getServer()+"/api/pre/objects";
            result = plonkHttpGet.PlonkHttpGetCall(urlExtension,token);

        }

        return result;
    }

    public static void main(String[] args) {
        try {
            String output = x();
            System.out.println(output);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
