static void Main(string[] args) { Authenticator auth = Authenticator.Instance; auth.Authenticate(authUrl, clientId, clientSecret); //Pass auth url, username, and password to authenticate to auth server foreach (Endpoint e in auth.GetEndpoints(providerId)) //For the provided endpoint { XPress xPress = new XPress(e.href); //Pass endpoint info to data API (token, href) foreach (XLeaType l in xPress.GetXLeas().Data) //Iterate through each xLea { for (int i = 1; i <= xPress.GetLastPage(ServicePath.GetXRostersByXLea, l.refId, navigationPageSize); i++) //Get max page size for rosters by lea { foreach (XRosterType r in xPress.GetXRostersByXLea(l.refId, i, navigationPageSize).Data) //Get each roster for each lea refId w/ paging { Console.WriteLine("courseTitle: " + r.courseTitle); foreach (XPersonReferenceType p in r.students.studentReference) //Students for each course { Console.WriteLine("refId: " + p.refId); Console.WriteLine("localId: " + p.localId); Console.WriteLine("givenName: " + p.givenName); Console.WriteLine("familyName: " + p.familyName); } } Console.WriteLine("######## PAGE " + i + " ########"); } } } Console.Read(); }
/* xLeas */ public static void GetXLeas(XPress xPress) { List <XLeaType> xLeaTypeList = xPress.GetXLeas(OPAQUE_MARKER).Data; foreach (XLeaType o in xLeaTypeList) { Console.WriteLine(o.refId + " | " + o.leaName + " | " + o.Metadata.SchoolYear); } }
static void Main(string[] args) { Authenticator auth = Authenticator.Instance; auth.Authenticate(authUrl, clientId, clientSecret); foreach (Endpoint e in auth.GetEndpoints(providerId)) { XPress xPress = new XPress(e.href); string json = xPress.GetXLeas().Json; string xml = xPress.GetXLeas(2018).Xml; Console.WriteLine(json); Console.WriteLine(); Console.WriteLine(xml); //Console.WriteLine(xPress.GetXLea("03ACF04F-DC12-411A-9A42-E8323516D699").Json); //Console.WriteLine(); //Console.WriteLine(xPress.GetXLea("03ACF04F-DC12-411A-9A42-E8323516D699").Xml); } Console.Read(); }