All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.evotext.clever.util.Caller Maven / Gradle / Ivy

Go to download

The Clever-Java project is a Java wrapper for the Clever.com API for keeping educational applications rostered and up-to-date.

There is a newer version: 2.0.0
Show newest version
package com.evotext.clever.util;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.evotext.clever.model.Teacher;
import com.evotext.clever.requests.IdListRequest;
import com.evotext.clever.requests.ListRequest;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class Caller {

	public static List getTeachers(final Clever clever) throws JsonParseException, JsonMappingException, IOException, JSONException 
	{
		String url = clever.getFullUrl() + "teachers";

		ListRequest request = new ListRequest.Builder(clever.getToken(), url).build();
		JSONObject jo = Connect.get(request);

		JSONArray arrJson= jo.getJSONArray("data");
		ObjectMapper mapper = new ObjectMapper();
		List list = new ArrayList<>();
		for(int i=0;i getDataList(final Clever clever, final String url) throws JSONException, JsonParseException, JsonMappingException, IOException
	{
		ListRequest request = new ListRequest.Builder(clever.getToken(), url).build();
		JSONObject jo = Connect.get(request);
		
		System.out.println(jo);

		JSONArray arrJson= jo.getJSONArray("data");
		ObjectMapper mapper = new ObjectMapper();
		Class clazz = clever.getBase().getClass();
		List list = new ArrayList<>();
		for(int i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy