caplinked/caplinked-api-php

Caplinked API (PHP SDK) - Document Security and Sharing

dev-master 2018-04-20 01:20 UTC

This package is not auto-updated.

Last update: 2024-05-04 13:42:02 UTC


README

Overview

PHP SDK for the Caplinked API.

Core information security endpoints for managing your virtual data room capabilities around files/folders, users/groups and permissions, uploads/downloads, dynamic watermarking, DRM (digital rights management) and more.

Vist Caplinked for more information.

Requirements

PHP 5.4.0 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/caplinked-api-php/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

date_default_timezone_set('UTC');

$key = '0c1da72601ca7c39df77a317d93c1caefccxxxxx';
$secret_key = 'cad02b1a2593862c5f151a5b8496f6e60c8581c82697ad706d8930bbd56xxxxx';
$user_resource_key = '1b62543ca4f8311e9bd0e628705d76fb6acxxxxx';

$config = Caplinked\Configuration::getDefaultConfiguration();
$config->setApiKey('cl-api-key', $key);
$config->setApiKey('cl-api-secret-key', $secret_key);
$config->setApiKey('cl-api-user-token', $user_resource_key);
//$config->setDebug(true);
$api_client = new Caplinked\ApiClient($config);

$api_instance = new Caplinked\Api\UsersApi($api_client);

try {
    $result = $api_instance->getUsersMe();
    var_dump($result['first_name']); // string(23) "Arons"
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->getUsersMe: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://sandbox.caplinked.com/api/v1

Class Method HTTP request Description
ActivitiesApi getActivitiesWorkspaceWorkspaceId GET /activities/workspace/{workspace_id} Get workspace activities
DownloadsApi deleteDownloadsId DELETE /downloads/{id} Delete download
DownloadsApi getDownloadsFileFileId GET /downloads/file/{file_id} Get single file
DownloadsApi getDownloadsId GET /downloads/{id} Get zip
DownloadsApi getDownloadsStatusWorkspaceId GET /downloads/status/{workspace_id} Get status of downloads for current user
DownloadsApi postDownloads POST /downloads Create zip file
FilesApi deleteFilesId DELETE /files/{id} Delete file
FilesApi getFilesId GET /files/{id} Get file information
FilesApi postFilesIdCopy POST /files/{id}/copy Copy file
FilesApi postFilesIdMove POST /files/{id}/move Move file
FilesApi putFilesId PUT /files/{id} Update file information
FilesApi putFilesUpload PUT /files/upload Upload file
FoldersApi deleteFoldersId DELETE /folders/{id} Delete folder
FoldersApi getFoldersId GET /folders/{id} Get folder information
FoldersApi postFolders POST /folders Create new folder
FoldersApi postFoldersIdCopy POST /folders/{id}/copy Copy folder
FoldersApi postFoldersIdMove POST /folders/{id}/move Move folder
FoldersApi putFoldersId PUT /folders/{id} Update folder information
GroupsApi deleteGroupsId DELETE /groups/{id} Delete group
GroupsApi deleteGroupsIdMemberships DELETE /groups/{id}/memberships Remove a user from a group
GroupsApi getGroups GET /groups List all groups in workspace
GroupsApi getGroupsId GET /groups/{id} Get group information
GroupsApi getGroupsIdMemberships GET /groups/{id}/memberships List all memberships for a group
GroupsApi postGroups POST /groups Create group
GroupsApi postGroupsIdMemberships POST /groups/{id}/memberships Add user to group (adds to parent workspace if they are not already a member)
GroupsApi putGroupsId PUT /groups/{id} Update group
GroupsApi putGroupsIdDisableDrmExpiration PUT /groups/{id}/disable_drm_expiration Disable DRM expiration for group
GroupsApi putGroupsIdDisableExpireAccess PUT /groups/{id}/disable_expire_access Disable access expiration for a group
GroupsApi putGroupsIdDrm PUT /groups/{id}/drm Update DRM for group
GroupsApi putGroupsIdEnableExpireAccess PUT /groups/{id}/enable_expire_access Enable access expiration for a group
GroupsApi putGroupsIdWatermarking PUT /groups/{id}/watermarking Watermarking for group
OrganizationApi deleteOrganizationMemberships DELETE /organization/memberships Remove organization admin membership
OrganizationApi getOrganization GET /organization Get organization information
OrganizationApi getOrganizationMemberships GET /organization/memberships Show all organization members
OrganizationApi postOrganizationMemberships POST /organization/memberships Add organization admin membership
OrganizationApi putOrganization PUT /organization Update organization information
OrganizationApi putOrganizationSupportInformation PUT /organization/support_information Update support information of organization
PermissionsApi getPermissionsFoldersId GET /permissions/folders/{id} List subfolder permissions
PermissionsApi putPermissionsFoldersId PUT /permissions/folders/{id} Update folder permissions
TeamsApi deleteTeamsIdMemberships DELETE /teams/{id}/memberships Remove team member
TeamsApi getTeams GET /teams List all teams in organization
TeamsApi getTeamsId GET /teams/{id} Get team information
TeamsApi getTeamsIdMemberships GET /teams/{id}/memberships Get list of team members
TeamsApi getTeamsIdWatermarkSettings GET /teams/{id}/watermark_settings List custom watermarks for a team
TeamsApi postTeams POST /teams Create team
TeamsApi postTeamsIdMemberships POST /teams/{id}/memberships Add team member
TeamsApi putTeamsId PUT /teams/{id} Update team
UsersApi deleteUsers DELETE /users Delete user
UsersApi getUsersMe GET /users/me Get user information
UsersApi postUsers POST /users Create user
UsersApi putUsersMe PUT /users/me Update a user
WatermarkApi deleteWatermarkId DELETE /watermark/{id} Delete custom watermark
WatermarkApi getWatermarkId GET /watermark/{id} Get custom watermark setting
WatermarkApi postWatermark POST /watermark Add custom watermark
WatermarkApi putWatermarkId PUT /watermark/{id} Update custom watermark
WorkspacesApi getWorkspaces GET /workspaces List all workspaces for a team
WorkspacesApi getWorkspacesId GET /workspaces/{id} Get workspace information
WorkspacesApi postWorkspaces POST /workspaces Create workspace
WorkspacesApi putWorkspacesId PUT /workspaces/{id} Update workspace

Documentation For Models

Documentation For Authorization

See example on Getting Started