All URIs are relative to https://api.workforcehr.org
| Method | HTTP request | Description |
|---|---|---|
| CreateOrUpdateCountry | POST /v1/Country | Add a new Nationality to the Workforce system |
| DeleteCountry | DELETE /v1/Country | Delete a Country from the Workforce system |
| GetCountries | GET /v1/Country | Get all Countries within Workforce |
| GetCountriesWithRegions | GET /v1/Country/full | Get all Countries within Workforce and the assoicated regions |
| GetCountry | GET /v1/Country/{id} | Get a specific Country from Workforce |
void CreateOrUpdateCountry (Country country = null)
Add a new Nationality to the Workforce system
using System.Collections.Generic;
using System.Diagnostics;
using Workforce.Api;
using Workforce.Client;
using Workforce.Model;
namespace Example
{
public class CreateOrUpdateCountryExample
{
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 CountryApi(config);
var country = new Country(); // Country | The nationality to add (optional)
try
{
// Add a new Nationality to the Workforce system
apiInstance.CreateOrUpdateCountry(country);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CountryApi.CreateOrUpdateCountry: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| country | Country | The nationality to add | [optional] |
void (empty response body)
- Content-Type: application/json-patch+json, application/json, text/json, application/_*+json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Returns the newly created Nationality | - |
| 400 | If the Nationality is null | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteCountry (Guid? id = null)
Delete a Country from the Workforce system
using System.Collections.Generic;
using System.Diagnostics;
using Workforce.Api;
using Workforce.Client;
using Workforce.Model;
namespace Example
{
public class DeleteCountryExample
{
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 CountryApi(config);
var id = new Guid?(); // Guid? | The Id of the entity to delete (optional)
try
{
// Delete a Country from the Workforce system
apiInstance.DeleteCountry(id);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CountryApi.DeleteCountry: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | Guid? | The Id of the entity to delete | [optional] |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | If the Country was deleted | - |
| 400 | If the Id is null | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<Country> GetCountries ()
Get all Countries within Workforce
using System.Collections.Generic;
using System.Diagnostics;
using Workforce.Api;
using Workforce.Client;
using Workforce.Model;
namespace Example
{
public class GetCountriesExample
{
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 CountryApi(config);
try
{
// Get all Countries within Workforce
List<Country> result = apiInstance.GetCountries();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CountryApi.GetCountries: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns the Country list | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<Country> GetCountriesWithRegions ()
Get all Countries within Workforce and the assoicated regions
using System.Collections.Generic;
using System.Diagnostics;
using Workforce.Api;
using Workforce.Client;
using Workforce.Model;
namespace Example
{
public class GetCountriesWithRegionsExample
{
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 CountryApi(config);
try
{
// Get all Countries within Workforce and the assoicated regions
List<Country> result = apiInstance.GetCountriesWithRegions();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CountryApi.GetCountriesWithRegions: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns the Country and region list | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Country GetCountry (Guid id)
Get a specific Country from Workforce
using System.Collections.Generic;
using System.Diagnostics;
using Workforce.Api;
using Workforce.Client;
using Workforce.Model;
namespace Example
{
public class GetCountryExample
{
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 CountryApi(config);
var id = new Guid(); // Guid | Unique ID of the Country
try
{
// Get a specific Country from Workforce
Country result = apiInstance.GetCountry(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CountryApi.GetCountry: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | Guid | Unique ID of the Country |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns the Country | - |
| 404 | If the Country doesn't exist | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]