Skip to content

Latest commit

 

History

History
361 lines (279 loc) · 10.3 KB

File metadata and controls

361 lines (279 loc) · 10.3 KB

Workforce.Api.CountryApi

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

CreateOrUpdateCountry

void CreateOrUpdateCountry (Country country = null)

Add a new Nationality to the Workforce system

Example

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);
            }
        }
    }
}

Parameters

Name Type Description Notes
country Country The nationality to add [optional]

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json-patch+json, application/json, text/json, application/_*+json
  • Accept: application/json

HTTP response details

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]

DeleteCountry

void DeleteCountry (Guid? id = null)

Delete a Country from the Workforce system

Example

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);
            }
        }
    }
}

Parameters

Name Type Description Notes
id Guid? The Id of the entity to delete [optional]

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

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]

GetCountries

List<Country> GetCountries ()

Get all Countries within Workforce

Example

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);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<Country>

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns the Country list -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetCountriesWithRegions

List<Country> GetCountriesWithRegions ()

Get all Countries within Workforce and the assoicated regions

Example

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);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<Country>

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

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]

GetCountry

Country GetCountry (Guid id)

Get a specific Country from Workforce

Example

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);
            }
        }
    }
}

Parameters

Name Type Description Notes
id Guid Unique ID of the Country

Return type

Country

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

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]