stackone / client-sdk
Requires
- php: ^8.2
- brick/date-time: ^0.7.0
- brick/math: ^0.12.1
- 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.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-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: 2024-11-12 09:40:59 UTC
README
Summary
Marketing: The documentation for the StackOne Unified API - MARKETING
Table of Contents
- SDK Installation
- SDK Example Usage
- Available Resources and Operations
- Error Handling
- Server Selection
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,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\QueryParamFilter( updatedAfter: '2020-01-01T00:00:00.000Z', ), expand: 'company,employments,work_location,home_location,custom_fields,groups', include: 'avatar_url,avatar,custom_fields,job_description,benefits', ); $response = $sdk->hris->listEmployees( request: $request ); if ($response->employeesPaginated !== null) { // handle response }
Available Resources and Operations
Available methods
accounts
- listLinkedAccounts - List Accounts
- getAccount - Get Account
- deleteAccount - Delete Account
- updateAccount - Update Account
- getAccountMetaInfo - Get meta information of the account
ats
- listApplications - List Applications
- createApplication - Create Application
- getApplication - Get Application
- updateApplication - Update an Application
- listApplicationsOffers - List Application Offers
- moveApplication - Move Application
- rejectApplication - Reject Application
- getApplicationOffer - Get Application Offer
- listApplicationScorecards - List Application Scorecards
- getApplicationScorecard - Get Application Scorecard
- listApplicationsScheduledInterviews - List Applications scheduled interviews
- getApplicationScheduledInterview - Get Applications scheduled interview
- uploadApplicationDocument - Upload Application Document
- downloadApplicationDocument - Download Application Document
- listApplicationDocuments - List Application Documents
- getApplicationDocument - Get Application Document
- listCandidates - List Candidates
- createCandidate - Create Candidate
- getCandidate - Get Candidate
- updateCandidate - Update Candidate
- listCandidateNotes - List Candidate Notes
- createCandidateNote - Create Candidate Note
- getCandidateNote - Get Candidate Note
- listApplicationCustomFieldDefinitions - List Application Custom Field Definitions
- getApplicationCustomFieldDefinition - Get Application Custom Field Definition
- listCandidateCustomFieldDefinitions - List Candidate Custom Field Definitions
- getCandidateCustomFieldDefinition - Get Candidate Custom Field Definition
- listJobCustomFieldDefinitions - List Job Custom Field Definitions
- getJobCustomFieldDefinition - Get Job Custom Field Definition
- listDepartments - List Departments
- getDepartment - Get Department
- listInterviewStages - List Interview Stages
- getInterviewStage - Get Interview Stage
- listInterviews - List Interviews
- getInterview - Get Interview
- listJobs - List Jobs
- createJob - Create Job
- getJob - Get Job
- updateJob - Update Job
- listLists - Get all Lists
- getList - Get List
- listLocations - List locations
- getLocation - Get Location
- listRejectedReasons - List Rejected Reasons
- getRejectedReason - Get Rejected Reason
- listUsers - List Users
- getUser - Get User
- listJobPostings - List Job Postings
- getJobPosting - Get Job Posting
- listOffers - List Offers
- createOffer - Creates an offer
- getOffer - Get Offer
- listAssessmentsPackages - List Assessments Packages
- getAssessmentsPackage - Get Assessments Package
- getAssessmentsRequest - Get Assessments Requests
- getAssessmentsResult - Get Assessments Results
connectors
- listConnectorsMeta - List Connectors Meta Information for all providers
- getConnectorMeta - Get Connector Meta information for the given provider key
connectSessions
- createConnectSession - Create Connect Session
- authenticateConnectSession - Authenticate Connect Session
crm
- listContacts - List Contacts
- createContact - Creates a new Contact
- getContact - Get Contact
- updateContact - Update Contact (early access)
- listAccounts - List Accounts
- getAccount - Get Account
- listLists - Get all Lists
- getList - Get List
- listContactCustomFieldDefinitions - List Contact Custom Field Definitions
- getContactCustomFieldDefinition - Get Contact Custom Field Definition
hris
- listCompanies - List Companies
- getCompany - Get Company
- listEmployees - List Employees
- createEmployee - Creates an employee
- getEmployee - Get Employee
- updateEmployee - Updates an employee
- listEmployeeTimeOffRequests - List Employee Time Off Requests
- createEmployeeTimeOffRequest - Create Employee Time Off Request
- getEmployeesTimeOffRequest - Get Employees Time Off Request
- batchUploadEmployeeDocument - Batch Upload Employee Document
- uploadEmployeeDocument - Upload Employee Document
- downloadEmployeeDocument - Download Employee Document
- listEmployeeDocuments - List Employee Documents
- getEmployeeDocument - Get Employee Document
- listEmployeeCategories - List Employee Document Categories
- getEmployeeDocumentCategory - Get Employee Document Category
- listEmployeeWorkEligibility - List Employee Work Eligibility
- createEmployeeWorkEligibilityRequest - Create Employee Work Eligibility Request
- getEmployeesWorkEligibility - Get Employees Work Eligibility
- updateEmployeeWorkEligibilityRequest - Update Employee Work Eligibility Request
- listEmployments - List Employments
- getEmployment - Get Employment
- listEmployeeEmployments - List Employee Employments
- createEmployeeEmployment - Create Employee Employment
- getEmployeeEmployment - Get Employee Employment
- updateEmployeeEmployment - Update Employee Employment
- listLocations - List locations
- getLocation - Get Location
- listTimeOffRequests - List time off requests
- createTimeOffRequest - Creates a time off request
- getTimeOffRequest - Get time off request
- updateTimeOffRequest - Update time off request
- listTimeOffTypes - List time off types
- getTimeOffType - Get time off type
- listBenefits - List benefits
- getBenefit - Get Benefit
- listGroups - List Groups
- listDepartmentGroups - List Department Groups
- listCostCenterGroups - List Cost Center Groups
- getGroup - Get Group
- getDepartmentGroup - Get Department Group
- getCostCenterGroup - Get Cost Center Group
- listJobs - List Jobs
- getJob - Get Job
iam
- listUsers - List Users
- getUser - Get User
- listRoles - List Roles
- getRole - Get Role
- listGroups - List Groups
- getGroup - Get Group
- listPolicies - List Policies
- getPolicy - Get Policy
lms
- batchUpsertCourse - Batch Upsert Course
- listCourses - List Courses
- upsertCourse - Upsert Course
- getCourse - Get Course
- listUserAssignments - List User Assignments
- getUserAssignment - Get User Assignment
- batchUpsertContent - Batch Upsert Content
- listContent - List Content
- upsertContent - Upsert Content
- getContent - Get Content
- listUserCompletions - List User Completions
- createUserCompletion - Create User Completion
- getUserCompletion - Get User Completion
- listCompletions - List Completions
- getCompletion - Get Completion
- getCategory - Get Category
- listCategories - List Categories
- listUsers - List Users
- getUser - Get User
- getSkill - Get Skill
- listSkills - List Skills
- listAssignments - List Assignments
- getAssignment - Get Assignment
- createCollection - Create Collection
- updateCollection - Update Collection
marketing
- listEmailTemplates - List Email Templates
- createEmailTemplate - Create Email Templates
- getEmailTemplate - Get Email Templates
- updateEmailTemplate - Update Email Templates
- listInAppTemplates - List In-App Templates
- createInAppTemplate - Create In-App Template
- getInAppTemplate - Get In-App Template
- updateInAppTemplate - Update In-App Template
- listSmsTemplates - List SMS Templates
- createSmsTemplate - Create SMS Template
- getSmsTemplate - Get SMS Template
- updateSmsTemplate - Update SMS Template
listOmniChannelTemplates- List Omni-Channel Templates ⚠️ DeprecatedcreateOmniChannelTemplate- Create Omni-Channel Template ⚠️ DeprecatedgetOmniChannelTemplate- Get Omni-Channel Template ⚠️ DeprecatedupdateOmniChannelTemplate- Update Omni-Channel Template ⚠️ Deprecated- listPushTemplates - List Push Templates
- createPushTemplate - Create Push Template
- getPushTemplate - Get Push Template
- updatePushTemplate - Update Push Template
- listCampaigns - List campaigns
- getCampaign - Get campaign
- listContentBlocks - List Content Blocks
- createContentBlock - Create Content Block
- getContentBlock - Get Content Blocks
- updateContentBlock - Update Content Block
proxy
- proxyRequest - Proxy Request
webhooks
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 createConnectSession
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\ConnectSessionCreate( originOwnerId: '<id>', originOwnerName: '<value>', categories: [ Components\Categories::Ats, Components\Categories::Hris, Components\Categories::Crm, Components\Categories::Crm, Components\Categories::Iam, Components\Categories::Marketing, Components\Categories::Lms, Components\Categories::Ats, Components\Categories::Lms, ], ); $response = $sdk->connectSessions->createConnectSession( request: $request ); if ($response->connectSessionToken !== 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\ConnectSessionCreate( originOwnerId: '<id>', originOwnerName: '<value>', categories: [ Components\Categories::Ats, Components\Categories::Hris, Components\Categories::Crm, Components\Categories::Crm, Components\Categories::Iam, Components\Categories::Marketing, Components\Categories::Lms, Components\Categories::Ats, Components\Categories::Lms, ], ); $response = $sdk->connectSessions->createConnectSession( request: $request ); if ($response->connectSessionToken !== 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.