(hris->departments)
- create - Create Department
- list - List Departments
- delete - Delete Department
- get - Get Department
- update - Update Department
Create Department
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\HrisDepartmentsAddRequest(
department: new Components\DepartmentInput(
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
name: 'R&D',
code: '2',
description: 'R&D',
),
serviceId: 'salesforce',
);
$response = $sdk->hris->departments->create(
request: $request
);
if ($response->createDepartmentResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\HrisDepartmentsAddRequest | ✔️ | The request object to use for the request. |
?Operations\HrisDepartmentsAddResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
List Departments
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\HrisDepartmentsAllRequest(
serviceId: 'salesforce',
passThrough: [
'search' => 'San Francisco',
],
fields: 'id,updated_at',
);
$responses = $sdk->hris->departments->list(
request: $request
);
foreach ($responses as $response) {
if ($response->httpMeta->response->getStatusCode() === 200) {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\HrisDepartmentsAllRequest | ✔️ | The request object to use for the request. |
?Operations\HrisDepartmentsAllResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Delete Department
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\HrisDepartmentsDeleteRequest(
id: '<id>',
serviceId: 'salesforce',
);
$response = $sdk->hris->departments->delete(
request: $request
);
if ($response->deleteDepartmentResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\HrisDepartmentsDeleteRequest | ✔️ | The request object to use for the request. |
?Operations\HrisDepartmentsDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get Department
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\HrisDepartmentsOneRequest(
id: '<id>',
serviceId: 'salesforce',
fields: 'id,updated_at',
);
$response = $sdk->hris->departments->get(
request: $request
);
if ($response->getDepartmentResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\HrisDepartmentsOneRequest | ✔️ | The request object to use for the request. |
?Operations\HrisDepartmentsOneResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Update Department
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\HrisDepartmentsUpdateRequest(
id: '<id>',
department: new Components\DepartmentInput(
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
name: 'R&D',
code: '2',
description: 'R&D',
),
serviceId: 'salesforce',
);
$response = $sdk->hris->departments->update(
request: $request
);
if ($response->updateDepartmentResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\HrisDepartmentsUpdateRequest | ✔️ | The request object to use for the request. |
?Operations\HrisDepartmentsUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |