Skip to content

Latest commit

 

History

History
293 lines (226 loc) · 8.17 KB

File metadata and controls

293 lines (226 loc) · 8.17 KB

Workforce.Api.BranchApi

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

Method HTTP request Description
CreateOrUpdateBranch POST /v1/Branch Add a new Branch to the Workforce system
DeleteBranch DELETE /v1/Branch Delete a Branch from the Workforce system
GetBranch GET /v1/Branch/{id} Get a specific Branch from Workforce
GetBranches GET /v1/Branch Get all Branches within Workforce

CreateOrUpdateBranch

void CreateOrUpdateBranch (Branch branch = null)

Add a new Branch 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 CreateOrUpdateBranchExample
    {
        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 BranchApi(config);
            var branch = new Branch(); // Branch |  (optional) 

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

Parameters

Name Type Description Notes
branch Branch [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 Branch -
400 If the Branch is null -

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

DeleteBranch

void DeleteBranch (Guid? id = null)

Delete a Branch 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 DeleteBranchExample
    {
        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 BranchApi(config);
            var id = new Guid?(); // Guid? | The Id of the entity to delete (optional) 

            try
            {
                // Delete a Branch from the Workforce system
                apiInstance.DeleteBranch(id);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BranchApi.DeleteBranch: " + 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 Branch was deleted -
400 If the Id is null -

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

GetBranch

Branch GetBranch (Guid id)

Get a specific Branch from Workforce

Example

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

namespace Example
{
    public class GetBranchExample
    {
        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 BranchApi(config);
            var id = new Guid(); // Guid | Unique ID of the Branch

            try
            {
                // Get a specific Branch from Workforce
                Branch result = apiInstance.GetBranch(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BranchApi.GetBranch: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
id Guid Unique ID of the Branch

Return type

Branch

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Returns the Branch -
404 If the Branch doesn't exist -

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

GetBranches

List<Branch> GetBranches ()

Get all Branches within Workforce

Example

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

namespace Example
{
    public class GetBranchesExample
    {
        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 BranchApi(config);

            try
            {
                // Get all Branches within Workforce
                List<Branch> result = apiInstance.GetBranches();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BranchApi.GetBranches: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<Branch>

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Returns the Branch list -

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