(Hris.TimeOffRequests)
- List - List Time Off Requests
- Create - Create Time Off Request
- Get - Get Time Off Request
- Update - Update Time Off Request
- Delete - Delete Time Off Request
List Time Off Requests
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
HrisTimeOffRequestsAllRequest req = new HrisTimeOffRequestsAllRequest() {
ServiceId = "salesforce",
Filter = new TimeOffRequestsFilter() {
StartDate = "2022-04-08",
EndDate = "2022-04-21",
UpdatedSince = "2020-09-30T07:43:32.000Z",
EmployeeId = "1234",
TimeOffRequestStatus = TimeOffRequestStatus.Approved,
CompanyId = "1234",
},
PassThrough = new Dictionary<string, object>() {
{ "search", "San Francisco" },
},
Fields = "id,updated_at",
};
HrisTimeOffRequestsAllResponse? res = await sdk.Hris.TimeOffRequests.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
HrisTimeOffRequestsAllRequest | ✔️ | The request object to use for the request. |
HrisTimeOffRequestsAllResponse
Error Type | Status Code | Content Type |
---|---|---|
ApideckUnifySdk.Models.Errors.BadRequestResponse | 400 | application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse | 401 | application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse | 402 | application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse | 404 | application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse | 422 | application/json |
ApideckUnifySdk.Models.Errors.APIException | 4XX, 5XX | */* |
Create Time Off Request
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
HrisTimeOffRequestsAddRequest req = new HrisTimeOffRequestsAddRequest() {
TimeOffRequest = new TimeOffRequestInput() {
EmployeeId = "12345",
PolicyId = "12345",
Status = TimeOffRequestStatusStatus.Approved,
Description = "Enjoying some sun.",
StartDate = "2022-04-01",
EndDate = "2022-04-01",
RequestDate = "2022-03-21",
RequestType = RequestType.Vacation,
ApprovalDate = "2022-03-21",
Units = Units.Hours,
Amount = 3.5D,
DayPart = "morning",
Notes = new Models.Components.Notes() {
Employee = "Relaxing on the beach for a few hours.",
Manager = "Enjoy!",
},
PassThrough = new List<PassThroughBody>() {
new PassThroughBody() {
ServiceId = "<id>",
ExtendPaths = new List<ExtendPaths>() {
new ExtendPaths() {
Path = "$.nested.property",
Value = new Dictionary<string, object>() {
{ "TaxClassificationRef", new Dictionary<string, object>() {
{ "value", "EUC-99990201-V1-00020000" },
} },
},
},
},
},
},
PolicyType = "sick",
},
ServiceId = "salesforce",
};
var res = await sdk.Hris.TimeOffRequests.CreateAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
HrisTimeOffRequestsAddRequest | ✔️ | The request object to use for the request. |
HrisTimeOffRequestsAddResponse
Error Type | Status Code | Content Type |
---|---|---|
ApideckUnifySdk.Models.Errors.BadRequestResponse | 400 | application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse | 401 | application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse | 402 | application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse | 404 | application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse | 422 | application/json |
ApideckUnifySdk.Models.Errors.APIException | 4XX, 5XX | */* |
Get Time Off Request
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
HrisTimeOffRequestsOneRequest req = new HrisTimeOffRequestsOneRequest() {
Id = "<id>",
EmployeeId = "<id>",
ServiceId = "salesforce",
Fields = "id,updated_at",
};
var res = await sdk.Hris.TimeOffRequests.GetAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
HrisTimeOffRequestsOneRequest | ✔️ | The request object to use for the request. |
HrisTimeOffRequestsOneResponse
Error Type | Status Code | Content Type |
---|---|---|
ApideckUnifySdk.Models.Errors.BadRequestResponse | 400 | application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse | 401 | application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse | 402 | application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse | 404 | application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse | 422 | application/json |
ApideckUnifySdk.Models.Errors.APIException | 4XX, 5XX | */* |
Update Time Off Request
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
HrisTimeOffRequestsUpdateRequest req = new HrisTimeOffRequestsUpdateRequest() {
Id = "<id>",
EmployeeId = "<id>",
TimeOffRequest = new TimeOffRequestInput() {
EmployeeId = "12345",
PolicyId = "12345",
Status = TimeOffRequestStatusStatus.Approved,
Description = "Enjoying some sun.",
StartDate = "2022-04-01",
EndDate = "2022-04-01",
RequestDate = "2022-03-21",
RequestType = RequestType.Vacation,
ApprovalDate = "2022-03-21",
Units = Units.Hours,
Amount = 3.5D,
DayPart = "morning",
Notes = new Models.Components.Notes() {
Employee = "Relaxing on the beach for a few hours.",
Manager = "Enjoy!",
},
PassThrough = new List<PassThroughBody>() {
new PassThroughBody() {
ServiceId = "<id>",
ExtendPaths = new List<ExtendPaths>() {
new ExtendPaths() {
Path = "$.nested.property",
Value = new Dictionary<string, object>() {
{ "TaxClassificationRef", new Dictionary<string, object>() {
{ "value", "EUC-99990201-V1-00020000" },
} },
},
},
},
},
},
PolicyType = "sick",
},
ServiceId = "salesforce",
};
var res = await sdk.Hris.TimeOffRequests.UpdateAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
HrisTimeOffRequestsUpdateRequest | ✔️ | The request object to use for the request. |
HrisTimeOffRequestsUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
ApideckUnifySdk.Models.Errors.BadRequestResponse | 400 | application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse | 401 | application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse | 402 | application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse | 404 | application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse | 422 | application/json |
ApideckUnifySdk.Models.Errors.APIException | 4XX, 5XX | */* |
Delete Time Off Request
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
HrisTimeOffRequestsDeleteRequest req = new HrisTimeOffRequestsDeleteRequest() {
Id = "<id>",
EmployeeId = "<id>",
ServiceId = "salesforce",
};
var res = await sdk.Hris.TimeOffRequests.DeleteAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
HrisTimeOffRequestsDeleteRequest | ✔️ | The request object to use for the request. |
HrisTimeOffRequestsDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
ApideckUnifySdk.Models.Errors.BadRequestResponse | 400 | application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse | 401 | application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse | 402 | application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse | 404 | application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse | 422 | application/json |
ApideckUnifySdk.Models.Errors.APIException | 4XX, 5XX | */* |