Skip to content

Workforce-Technologies/dotnet-client

Repository files navigation

Workforce - the C# library for the Workforce API

Public API for the Workforce software

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: v1
  • SDK version: 1.0.0
  • Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen For more information, please visit https://www.twitter.com/adamlonsdale

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

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
Install-Package System.ComponentModel.Annotations

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

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

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

using Workforce.Api;
using Workforce.Client;
using Workforce.Model;

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Workforce.Api;
using Workforce.Client;
using Workforce.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://api.workforcehr.org";
            // Configure OAuth2 access token for authorization: Bearer
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AbsenceApi(config);
            var absence = new Absence(); // Absence |  (optional) 

            try
            {
                // Add a new Absence to the Workforce system
                apiInstance.CreateOrUpdateAbsence(absence);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling AbsenceApi.CreateOrUpdateAbsence: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.workforcehr.org

Class Method HTTP request Description
AbsenceApi CreateOrUpdateAbsence POST /v1/Absence Add a new Absence to the Workforce system
AbsenceApi DeleteAbsence DELETE /v1/Absence Delete an Absence from the Workforce system
AbsenceApi GetAbsence GET /v1/Absence/{id} Get a specific Absence from Workforce
AbsenceApi GetAbsences GET /v1/Absence Get all Absences within Workforce
AbsenceApi GetAbsencesForEmployee GET /v1/Absence/Employee/{id} Get a list of Absences from workforce for a specific Employee
AbsenceApi SearchAbsences GET /v1/Absence/Search Get a list of Absences from workforce that match the specified criteria
BranchApi CreateOrUpdateBranch POST /v1/Branch Add a new Branch to the Workforce system
BranchApi DeleteBranch DELETE /v1/Branch Delete a Branch from the Workforce system
BranchApi GetBranch GET /v1/Branch/{id} Get a specific Branch from Workforce
BranchApi GetBranches GET /v1/Branch Get all Branches within Workforce
CountryApi CreateOrUpdateCountry POST /v1/Country Add a new Nationality to the Workforce system
CountryApi DeleteCountry DELETE /v1/Country Delete a Country from the Workforce system
CountryApi GetCountries GET /v1/Country Get all Countries within Workforce
CountryApi GetCountriesWithRegions GET /v1/Country/full Get all Countries within Workforce and the assoicated regions
CountryApi GetCountry GET /v1/Country/{id} Get a specific Country from Workforce
DepartmentApi CreateOrUpdateDepartment POST /v1/Department Add a new Department to the Workforce system
DepartmentApi DeleteDepartment DELETE /v1/Department Delete a Department from the Workforce system
DepartmentApi GetDepartment GET /v1/Department/{id} Get a specific Department from Workforce
DepartmentApi GetDepartments GET /v1/Department Get all Departments within Workforce
EmployeeApi CreateOrUpdateEmployee POST /v1/Employee Add a new Employee to the Workforce system
EmployeeApi DeleteEmployee DELETE /v1/Employee Delete an Employee from the Workforce system
EmployeeApi GetEmployee GET /v1/Employee/{id} Get a specific Employee from Workforce
EmployeeApi GetEmployeePhoto GET /v1/Employee/employees/{employeeId}/photo Get a single Employee Photo from Workforce
EmployeeApi GetEmployees GET /v1/Employee Get all Employees within Workforce
EmployeeApi SearchEmployees GET /v1/Employee/search Search for Employees within Workforce
EmploymentTypeApi CreateOrUpdateEmploymentType POST /v1/EmploymentType Add a new Employment Type to the Workforce system
EmploymentTypeApi DeleteEmploymentType DELETE /v1/EmploymentType Delete an Employment Type from the Workforce system
EmploymentTypeApi GetEmploymentType GET /v1/EmploymentType/{id} Get a specific Employment Type from Workforce
EmploymentTypeApi GetEmploymentTypes GET /v1/EmploymentType Get all Employment Types within Workforce
ImageApi V1ImagesEmployeeGet GET /v1/images/employee
JobRoleApi CreateOrUpdateJobRole POST /v1/JobRole Add a new Job Role to the Workforce system
JobRoleApi DeleteJobRole DELETE /v1/JobRole Delete a Job Role from the Workforce system
JobRoleApi GetJobRole GET /v1/JobRole/{id} Get a specific Job Role from Workforce
JobRoleApi GetJobRoles GET /v1/JobRole Get all Job Roles within Workforce
LocationApi CreateOrUpdateLocation POST /v1/Location Add a new Location to the Workforce system
LocationApi DeleteLocation DELETE /v1/Location Delete a Location from the Workforce system
LocationApi GetLocation GET /v1/Location/{id} Get a specific Location from Workforce
LocationApi GetLocations GET /v1/Location Get all Locations within Workforce
NationalityApi CreateOrUpdateNationality POST /v1/Nationality Add a new Nationality to the Workforce system
NationalityApi DeleteNationality DELETE /v1/Nationality Delete a Nationality from the Workforce system
NationalityApi GetNationalities GET /v1/Nationality Get all Nationalities within Workforce
NationalityApi GetNationality GET /v1/Nationality/{id} Get a specific Nationality from Workforce
NoticePeriodApi CreateOrUpdateNoticePeriod POST /v1/NoticePeriod Add a new Notice Period to the Workforce system
NoticePeriodApi DeleteNoticePeriod DELETE /v1/NoticePeriod Delete a Notice Period from the Workforce system
NoticePeriodApi GetNoticePeriod GET /v1/NoticePeriod/{id} Get a specific Notice Period from Workforce
NoticePeriodApi GetNoticePeriods GET /v1/NoticePeriod Get all Notice Periods within Workforce

Documentation for Models

Documentation for Authorization

Bearer

  • Type: OAuth
  • Flow: password
  • Authorization URL:
  • Scopes:
    • workforce_api: Access Workforce API
    • openid: Open ID
    • profile: User Profile

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors