deschutesdesigngroupllc/perscom-php-sdk

The PERSCOM PHP SDK is a powerful tool that enables seamless integration with the PERSCOM platform, allowing you to interact with PERSCOM's personnel data programmatically.

v1.0.12 2024-04-20 22:09 UTC

README

Logo

The Official PERSCOM PHP SDK

A PHP package that helps kickstart your next PERSCOM integration.

Test Suite Downloads Packagist Version GitHub License codecov

Documentation

Introduction

The PERSCOM PHP SDK is a powerful tool that enables seamless integration with the PERSCOM platform, allowing you to interact with PERSCOM's personnel data programmatically.

<?php

$perscom = new PerscomConnection('api-token', 'perscom-id');

// Get a list of a specific resource
$response = $perscom->users()->all();

// Creating a resource
$response = $perscom->users()->create(data: [
    'name' => 'My New User'
])

// Updating a resource
$response = $perscom->users()->update(id: 1, data: [
    'name' => 'My New Name'
])

// Deleting a resource
$response = $perscom->users()->delete(id: 1)

// Searching for a resource
$response = $perscom->users()->search(
    value: 'foobar', 
    sort: new SortObject('first_name', 'asc'), 
    filter: new FilterObject('created_at', '<', '2024-01-01')
)

// Other examples
$response = $perscom->users()->profile_photo(id: 1)->create(filePath: 'image.jpg')
$response = $perscom->users()->assignment_records(id: 1)->delete();

// Parse the response into a usable array
$data = $response->json();

Getting Started

You can install the package using Composer:

composer require deschutesdesigngroupllc/perscom-php-sdk

Documentation

Visit our documentation here to get started.

Contributing

Please see here for more details about contributing.