stackone / client-sdk
Requires
- php: ^8.2
- brick/date-time: ^0.7.0
- brick/math: ^0.12.1
- galbar/jsonpath: ^3.0
- guzzlehttp/guzzle: ^7.0
- phpdocumentor/type-resolver: ^1.8
- speakeasy/serializer: ^4.0.0
Requires (Dev)
- laravel/pint: ^1.18.1
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^10
- rector/rector: ^0.19
- roave/security-advisories: dev-latest
- dev-main
- v0.23.0
- v0.22.2
- v0.22.1
- v0.22.0
- v0.21.0
- v0.19.0
- v0.17.0
- v0.15.0
- v0.13.0
- v0.11.0
- v0.9.0
- v0.7.0
- v0.5.0
- v0.3.0
- v0.1.1
- dev-speakeasy-sdk-regen-1731801831
- dev-speakeasy-sdk-regen-1730420735
- dev-speakeasy-sdk-regen-1730309622
- dev-speakeasy-sdk-regen-1730247786
- dev-update-workflow
- dev-speakeasy-sdk-regen-1730198670
- dev-speakeasy-sdk-regen-1730197321
- dev-speakeasy-sdk-regen-1730161408
- dev-speakeasy-sdk-regen-1730055318
- dev-speakeasy-sdk-regen-1729902135
- dev-speakeasy-sdk-regen-1729753501
- dev-speakeasy-sdk-regen-1729642971
- dev-speakeasy-sdk-regen-1729038171
- dev-speakeasy-sdk-regen-1728980686
- dev-speakeasy-sdk-regen-1728939372
- dev-speakeasy-sdk-regen-1728388554
- dev-speakeasy-sdk-regen-1728382823
This package is auto-updated.
Last update: 2025-01-06 14:22:51 UTC
README
Summary
Marketing: The documentation for the StackOne Unified API - MARKETING
Table of Contents
SDK Installation
The SDK relies on Composer to manage its dependencies.
To install the SDK and add it as a dependency to an existing composer.json
file:
composer require "stackone/client-sdk"
SDK Example Usage
List Employees
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; use StackOne\client\Models\Operations; $security = new Components\Security( username: '', password: '', ); $sdk = client\StackOne::builder()->setSecurity($security)->build(); $request = new Operations\HrisListEmployeesRequest( xAccountId: '<id>', fields: 'id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,benefits,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,employee_number,national_identity_number', filter: new Operations\HrisListEmployeesQueryParamFilter( updatedAfter: '2020-01-01T00:00:00.000Z', ), expand: 'company,employments,work_location,home_location,groups', include: 'avatar_url,avatar,custom_fields,job_description,benefits', ); $responses = $sdk->hris->listEmployees( request: $request ); foreach ($responses as $response) { if ($response->statusCode === 200) { // handle response } }
Available Resources and Operations
Available methods
accounts
- deleteAccount - Delete Account
- getAccount - Get Account
- getAccountMetaInfo - Get meta information of the account
- listLinkedAccounts - List Accounts
- updateAccount - Update Account
ats
- createApplication - Create Application
- createBackgroundCheckPackage - Create Background Check Package
- createCandidate - Create Candidate
- createCandidateNote - Create Candidate Note
- createJob - Create Job
- createOffer - Creates an offer
- downloadApplicationDocument - Download Application Document
- getApplication - Get Application
- getApplicationCustomFieldDefinition - Get Application Custom Field Definition
- getApplicationDocument - Get Application Document
- getApplicationOffer - Get Application Offer
- getApplicationScheduledInterview - Get Applications scheduled interview
- getApplicationScorecard - Get Application Scorecard
- getAssessmentsPackage - Get Assessments Package
- getAssessmentsRequest - Get Assessments Requests
- getAssessmentsResult - Get Assessments Results
- getBackgroundCheckPackage - Get Background Check Package
- getBackgroundCheckRequest - Get Background Check Request
- getBackgroundCheckResult - Get Background Check Results
- getCandidate - Get Candidate
- getCandidateCustomFieldDefinition - Get Candidate Custom Field Definition
- getCandidateNote - Get Candidate Note
- getDepartment - Get Department
- getInterview - Get Interview
- getInterviewStage - Get Interview Stage
- getJob - Get Job
- getJobCustomFieldDefinition - Get Job Custom Field Definition
- getJobPosting - Get Job Posting
- getList - Get List
- getLocation - Get Location
- getOffer - Get Offer
- getRejectedReason - Get Rejected Reason
- getUser - Get User
- listApplicationCustomFieldDefinitions - List Application Custom Field Definitions
- listApplicationDocuments - List Application Documents
- listApplicationScorecards - List Application Scorecards
- listApplications - List Applications
- listApplicationsOffers - List Application Offers
- listApplicationsScheduledInterviews - List Applications scheduled interviews
- listAssessmentsPackages - List Assessments Packages
- listBackgroundCheckPackages - List Background Check Packages
- listBackgroundCheckRequest - List Background Check Request
- listCandidateCustomFieldDefinitions - List Candidate Custom Field Definitions
- listCandidateNotes - List Candidate Notes
- listCandidates - List Candidates
- listDepartments - List Departments
- listInterviewStages - List Interview Stages
- listInterviews - List Interviews
- listJobCustomFieldDefinitions - List Job Custom Field Definitions
- listJobPostings - List Job Postings
- listJobs - List Jobs
- listLists - Get all Lists
- listLocations - List locations
- listOffers - List Offers
- listRejectedReasons - List Rejected Reasons
- listUsers - List Users
- moveApplication - Move Application
- rejectApplication - Reject Application
- updateApplication - Update an Application
- updateCandidate - Update Candidate
- updateJob - Update Job
- uploadApplicationDocument - Upload Application Document
connectors
- getConnectorMeta - Get Connector Meta information for the given provider key
- listConnectorsMeta - List Connectors Meta Information for all providers
connectSessions
- authenticateConnectSession - Authenticate Connect Session
- createConnectSession - Create Connect Session
crm
- createContact - Creates a new Contact
- getAccount - Get Account
- getContact - Get Contact
- getContactCustomFieldDefinition - Get Contact Custom Field Definition
- getList - Get List
- listAccounts - List Accounts
- listContactCustomFieldDefinitions - List Contact Custom Field Definitions
- listContacts - List Contacts
- listLists - Get all Lists
- updateContact - Update Contact (early access)
hris
- batchUploadEmployeeDocument - Batch Upload Employee Document
- createEmployee - Creates an employee
- createEmployeeEmployment - Create Employee Employment
- createEmployeeTimeOffRequest - Create Employee Time Off Request
- createEmployeeWorkEligibilityRequest - Create Employee Work Eligibility Request
- createTimeOffRequest - Creates a time off request
- downloadEmployeeDocument - Download Employee Document
- getBenefit - Get Benefit
- getCompany - Get Company
- getCostCenterGroup - Get Cost Center Group
- getDepartmentGroup - Get Department Group
- getEmployee - Get Employee
- getEmployeeCustomFieldDefinition - Get employee Custom Field Definition
- getEmployeeDocument - Get Employee Document
- getEmployeeDocumentCategory - Get Employee Document Category
- getEmployeeEmployment - Get Employee Employment
- getEmployeesTimeOffRequest - Get Employees Time Off Request
- getEmployeesWorkEligibility - Get Employees Work Eligibility
- getEmployment - Get Employment
- getGroup - Get Group
- getJob - Get Job
- getLocation - Get Location
- getTimeOffRequest - Get time off request
- getTimeOffType - Get time off type
- listBenefits - List benefits
- listCompanies - List Companies
- listCostCenterGroups - List Cost Center Groups
- listDepartmentGroups - List Department Groups
- listEmployeeCategories - List Employee Document Categories
- listEmployeeCustomFieldDefinitions - List employee Custom Field Definitions
- listEmployeeDocuments - List Employee Documents
- listEmployeeEmployments - List Employee Employments
- listEmployeeTimeOffRequests - List Employee Time Off Requests
- listEmployeeWorkEligibility - List Employee Work Eligibility
- listEmployees - List Employees
- listEmployments - List Employments
- listGroups - List Groups
- listJobs - List Jobs
- listLocations - List locations
- listTimeOffRequests - List time off requests
- listTimeOffTypes - List time off types
- updateEmployee - Updates an employee
- updateEmployeeEmployment - Update Employee Employment
- updateEmployeeWorkEligibilityRequest - Update Employee Work Eligibility Request
- updateTimeOffRequest - Update time off request
- uploadEmployeeDocument - Upload Employee Document
iam
- getGroup - Get Group
- getPolicy - Get Policy
- getRole - Get Role
- getUser - Get User
- listGroups - List Groups
- listPolicies - List Policies
- listRoles - List Roles
- listUsers - List Users
lms
- batchUpsertContent - Batch Upsert Content
- batchUpsertCourse - Batch Upsert Course
- createCollection - Create Collection
- createUserAssignment - Create User Assignment
- createUserCompletion - Create User Completion
- getAssignment - Get Assignment
- getCategory - Get Category
- getCompletion - Get Completion
- getContent - Get Content
- getCourse - Get Course
- getSkill - Get Skill
- getUser - Get User
- getUserAssignment - Get User Assignment
- getUserCompletion - Get User Completion
- listAssignments - List Assignments
- listCategories - List Categories
- listCompletions - List Completions
- listContent - List Content
- listCourses - List Courses
- listSkills - List Skills
- listUserAssignments - List User Assignments
- listUserCompletions - List User Completions
- listUsers - List Users
- updateCollection - Update Collection
- upsertContent - Upsert Content
- upsertCourse - Upsert Course
marketing
- createContentBlock - Create Content Block
- createEmailTemplate - Create Email Templates
- createInAppTemplate - Create In-App Template
createOmniChannelTemplate- Create Omni-Channel Template ⚠️ Deprecated- createPushTemplate - Create Push Template
- createSmsTemplate - Create SMS Template
- getCampaign - Get campaign
- getContentBlock - Get Content Blocks
- getEmailTemplate - Get Email Templates
- getInAppTemplate - Get In-App Template
getOmniChannelTemplate- Get Omni-Channel Template ⚠️ Deprecated- getPushTemplate - Get Push Template
- getSmsTemplate - Get SMS Template
- listCampaigns - List campaigns
- listContentBlocks - List Content Blocks
- listEmailTemplates - List Email Templates
- listInAppTemplates - List In-App Templates
listOmniChannelTemplates- List Omni-Channel Templates ⚠️ Deprecated- listPushTemplates - List Push Templates
- listSmsTemplates - List SMS Templates
- updateContentBlock - Update Content Block
- updateEmailTemplate - Update Email Templates
- updateInAppTemplate - Update In-App Template
updateOmniChannelTemplate- Update Omni-Channel Template ⚠️ Deprecated- updatePushTemplate - Update Push Template
- updateSmsTemplate - Update SMS Template
proxy
- proxyRequest - Proxy Request
webhooks
Pagination
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned object will be a Generator
instead of an individual response.
Working with generators is as simple as iterating over the responses in a foreach
loop, and you can see an example below:
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; use StackOne\client\Models\Operations; $security = new Components\Security( username: '', password: '', ); $sdk = client\StackOne::builder()->setSecurity($security)->build(); $request = new Operations\HrisListEmployeesRequest( xAccountId: '<id>', fields: 'id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,benefits,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,employee_number,national_identity_number', filter: new Operations\HrisListEmployeesQueryParamFilter( updatedAfter: '2020-01-01T00:00:00.000Z', ), expand: 'company,employments,work_location,home_location,groups', include: 'avatar_url,avatar,custom_fields,job_description,benefits', ); $responses = $sdk->hris->listEmployees( request: $request ); foreach ($responses as $response) { if ($response->statusCode === 200) { // handle response } }
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
By default an API error will raise a Errors\SDKException
exception, which has the following properties:
When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the authenticateConnectSession
method throws the following exceptions:
Example
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; $security = new Components\Security( username: '', password: '', ); $sdk = client\StackOne::builder()->setSecurity($security)->build(); try { $request = new Components\ConnectSessionAuthenticate( token: '<value>', ); $response = $sdk->connectSessions->authenticateConnectSession( request: $request ); if ($response->connectSession !== null) { // handle response } } catch (Errors\SDKException $e) { // handle default exception throw $e; }
Server Selection
Override Server URL Per-Client
The default server can also be overridden globally using the setServerUrl(string $serverUrl)
builder method when initializing the SDK client instance. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use StackOne\client; use StackOne\client\Models\Components; $security = new Components\Security( username: '', password: '', ); $sdk = client\StackOne::builder() ->setServerURL('https://api.stackone.com') ->setSecurity($security)->build(); $request = new Components\ConnectSessionAuthenticate( token: '<value>', ); $response = $sdk->connectSessions->authenticateConnectSession( request: $request ); if ($response->connectSession !== null) { // handle response }
Development
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.