Clever - the C# library for the Clever API

The Clever API

This C# SDK is automatically generated by the Swagger Codegen project:

  • API version: 3.0.0
  • SDK version: 1.0.0
  • Build package: io.swagger.codegen.languages.CSharpClientCodegen

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Clever.Api;
using Clever.Client;
using Clever.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Clever.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Getting Started

using System;
using System.Diagnostics;
using Clever.Api;
using Clever.Client;
using Clever.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {

            // Configure OAuth2 access token for authorization: oauth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new DataApi();
            var id = id_example;  // string | 
            var limit = 56;  // int? |  (optional) 
            var startingAfter = startingAfter_example;  // string |  (optional) 
            var endingBefore = endingBefore_example;  // string |  (optional) 

            try
            {
                UsersResponse result = apiInstance.GetContactsForUser(id, limit, startingAfter, endingBefore);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DataApi.GetContactsForUser: " + e.Message );
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.clever.com/v3.0

Class Method HTTP request Description
DataApi GetContactsForUser GET /users/{id}/mycontacts
DataApi GetCourse GET /courses/{id}
DataApi GetCourseForSection GET /sections/{id}/course
DataApi GetCourses GET /courses
DataApi GetCoursesForResource GET /resources/{id}/courses
DataApi GetCoursesForSchool GET /schools/{id}/courses
DataApi GetDistrict GET /districts/{id}
DataApi GetDistrictForCourse GET /courses/{id}/district
DataApi GetDistrictForSchool GET /schools/{id}/district
DataApi GetDistrictForSection GET /sections/{id}/district
DataApi GetDistrictForTerm GET /terms/{id}/district
DataApi GetDistrictForUser GET /users/{id}/district
DataApi GetDistricts GET /districts
DataApi GetResource GET /resources/{id}
DataApi GetResources GET /resources
DataApi GetResourcesForCourse GET /courses/{id}/resources
DataApi GetResourcesForSection GET /sections/{id}/resources
DataApi GetResourcesForUser GET /users/{id}/resources
DataApi GetSchool GET /schools/{id}
DataApi GetSchoolForSection GET /sections/{id}/school
DataApi GetSchools GET /schools
DataApi GetSchoolsForCourse GET /courses/{id}/schools
DataApi GetSchoolsForTerm GET /terms/{id}/schools
DataApi GetSchoolsForUser GET /users/{id}/schools
DataApi GetSection GET /sections/{id}
DataApi GetSections GET /sections
DataApi GetSectionsForCourse GET /courses/{id}/sections
DataApi GetSectionsForResource GET /resources/{id}/sections
DataApi GetSectionsForSchool GET /schools/{id}/sections
DataApi GetSectionsForTerm GET /terms/{id}/sections
DataApi GetSectionsForUser GET /users/{id}/sections
DataApi GetStudentsForUser GET /users/{id}/mystudents
DataApi GetTeachersForUser GET /users/{id}/myteachers
DataApi GetTerm GET /terms/{id}
DataApi GetTermForSection GET /sections/{id}/term
DataApi GetTerms GET /terms
DataApi GetTermsForSchool GET /schools/{id}/terms
DataApi GetUser GET /users/{id}
DataApi GetUsers GET /users
DataApi GetUsersForResource GET /resources/{id}/users
DataApi GetUsersForSchool GET /schools/{id}/users
DataApi GetUsersForSection GET /sections/{id}/users
EventsApi GetEvent GET /events/{id}
EventsApi GetEvents GET /events

Documentation for Models

Documentation for Authorization

oauth