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 |
void CreateOrUpdateBranch (Branch branch = null)
Add a new Branch to the Workforce system
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);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| branch | Branch | [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 Branch | - |
| 400 | If the Branch is null | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteBranch (Guid? id = null)
Delete a Branch from the Workforce system
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);
}
}
}
}| 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 Branch was deleted | - |
| 400 | If the Id is null | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Branch GetBranch (Guid id)
Get a specific Branch from Workforce
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);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | Guid | Unique ID of the Branch |
- Content-Type: Not defined
- Accept: application/json
| 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]
List<Branch> GetBranches ()
Get all Branches within Workforce
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);
}
}
}
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns the Branch list | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]