### Manual Installation of Yousign PHP SDK Source: https://github.com/valerius21/yousign-php/blob/main/README.md This snippet demonstrates the manual installation process for the Yousign PHP SDK by including the autoload.php file. This is an alternative to using Composer. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiUserApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $after = 'after_example'; // string | After cursor (pagination) $limit = 100; // int | The limit of items count to retrieve. $email = {"eq":["user@example.com"]}; // object | Filter by `email`. Allowed operators: `eq`. Example: `email[eq]=user@example.com` try { $result = $apiInstance->getUsers($after, $limit, $email); print_r($result); } catch (Exception $e) { echo 'Exception when calling UserApi->getUsers: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### List Bank Account Verifications - PHP Source: https://github.com/valerius21/yousign-php/blob/main/README.md Lists all bank account verifications. This is a GET request. ```PHP getVerificationsBankAccounts(); ?> ``` -------------------------------- ### List Bank Account Lookup Verifications - PHP Source: https://github.com/valerius21/yousign-php/blob/main/README.md Lists all bank account lookup verifications. This is a GET request. ```PHP getVerificationsBankAccountLookups(); ?> ``` -------------------------------- ### List Bank Account Connection Verifications - PHP Source: https://github.com/valerius21/yousign-php/blob/main/README.md Lists all bank account connection verifications. This is a GET request to the relevant endpoint. ```PHP getVerificationsBankAccountConnections(); ?> ``` -------------------------------- ### Template API: List Templates Source: https://github.com/valerius21/yousign-php/blob/main/README.md Retrieves a list of all available templates. This endpoint uses the GET method and is part of the Template API. ```PHP getTemplates(); print_r($templates); } catch (Exception $e) { echo 'Exception when calling getTemplates: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Get Signature Request by ID (PHP) Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/SignatureRequestApi.md Retrieves a specific signature request using its ID. This example shows how to configure the API client with an access token and make the GET request. It handles potential exceptions during the API call. ```PHP setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiSignatureRequestApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $signature_request_id = 'signature_request_id_example'; // string | Signature Request Id try { $result = $apiInstance->getSignatureRequestsSignatureRequestId($signature_request_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling SignatureRequestApi->getSignatureRequestsSignatureRequestId: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Remove User from Workspace - PHP Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/UserApi.md Removes a User from a specified Workspace. The example shows the setup for the API client and the execution of the deleteWorkspaceWorkspaceIdUsersUserId method with workspace and user IDs. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPI\Client\Api\UserApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $workspace_id = 'workspace_id_example'; // string | Workspace Id $user_id = 'user_id_example'; // string | User Id try { $apiInstance->deleteWorkspaceWorkspaceIdUsersUserId($workspace_id, $user_id); } catch (Exception $e) { echo 'Exception when calling UserApi->deleteWorkspaceWorkspaceIdUsersUserId: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Get Consumptions with Yousign PHP Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/ConsumptionApi.md Retrieves consumption data from the Yousign API. Requires specifying start and end dates, and an authentication key. The data can be filtered by workspace IDs and grouped by organization or workspace. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiConsumptionApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $from = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The "from" date must not be more than 1 year in the past $to = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | The "to" date must be more recent than the "from" date $authentication_key = 'authentication_key_example'; // string | The API authentication key to use to retrieve the data try { $result = $apiInstance->getConsumptions($from, $to, $authentication_key); print_r($result); } catch (Exception $e) { echo 'Exception when calling ConsumptionApi->getConsumptions: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### CreateCustomExperience Model Properties Source: https://github.com/valerius21/yousign-php/blob/main/docs/Model/CreateCustomExperience.md Defines the properties for creating a custom experience, including visual elements like colors and layout, as well as functional aspects like notification and download settings. It specifies data types, descriptions, and optional parameters for each property. ```PHP namespace OpenAPI\Client\Model; use \ArrayAccess; class CreateCustomExperience implements \ArrayAccess { // ... properties and methods ... /** * @return mixed */ public function getName() { return $this->container['name']; } /** * @param mixed $name * @return self */ public function setName($name) { // ... validation ... $this->container['name'] = $name; return $this; } /** * @return bool|null */ public function getLandingPageDisabled() { return $this->container['landing_page_disabled']; } /** * @param bool|null $landing_page_disabled * @return self */ public function setLandingPageDisabled($landing_page_disabled = null) { // ... validation ... $this->container['landing_page_disabled'] = $landing_page_disabled; return $this; } // ... other properties like side_panel_disabled, background_color, etc. ... /** * @return \OpenAPI\Client\Model\CustomExperienceDisabledNotificationsType[]|null */ public function getDisabledNotifications() { return $this->container['disabled_notifications']; } /** * @param \OpenAPI\Client\Model\CustomExperienceDisabledNotificationsType[]|null $disabled_notifications * @return self */ public function setDisabledNotifications($disabled_notifications = null) { // ... validation ... $this->container['disabled_notifications'] = $disabled_notifications; return $this; } /** * @return bool|null */ public function getDownloadDocumentsDisabled() { return $this->container['download_documents_disabled']; } /** * @param bool|null $download_documents_disabled * @return self */ public function setDownloadDocumentsDisabled($download_documents_disabled = null) { // ... validation ... $this->container['download_documents_disabled'] = $download_documents_disabled; return $this; } /** * @return \OpenAPI\Client\Model\CreateCustomExperienceRedirectUrls|null */ public function getRedirectUrls() { return $this->container['redirect_urls']; } /** * @param \OpenAPI\Client\Model\CreateCustomExperienceRedirectUrls|null $redirect_urls * @return self */ public function setRedirectUrls($redirect_urls = null) { // ... validation ... $this->container['redirect_urls'] = $redirect_urls; return $this; } /** * @return \OpenAPI\Client\Model\LogoLayout|null */ public function getLogoLayout() { return $this->container['logo_layout']; } /** * @param \OpenAPI\Client\Model\LogoLayout|null $logo_layout * @return self */ public function setLogoLayout($logo_layout = null) { // ... validation ... $this->container['logo_layout'] = $logo_layout; return $this; } // ... ArrayAccess methods ... } ``` -------------------------------- ### Get Electronic Seal - PHP Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/ElectronicSealApi.md Retrieves a specific Electronic Seal using its ID. Requires Bearer token authentication and returns an ElectronicSeal model. The example demonstrates setting up the API client and handling potential exceptions. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiElectronicSealApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $electronic_seal_id = 'electronic_seal_id_example'; // string | Electronic Seal Id try { $result = $apiInstance->getElectronicSeal($electronic_seal_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ElectronicSealApi->getElectronicSeal: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Initiate Bank Account Connection (PHP) Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/BankAccountConnectionVerificationApi.md Initiates a new bank account connection resource. This example demonstrates setting up the SDK, creating an API client instance, and making a POST request to create a new connection, including how to handle potential exceptions. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiBankAccountConnectionVerificationApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $post_verifications_bank_account_connections_request = new OpenAPIClientModelPostVerificationsBankAccountConnectionsRequest(); // OpenAPIClientModelPostVerificationsBankAccountConnectionsRequest try { $result = $apiInstance->postVerificationsBankAccountConnections($post_verifications_bank_account_connections_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling BankAccountConnectionVerificationApi->postVerificationsBankAccountConnections: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Get Workspace by ID (PHP) Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/WorkspaceApi.md Retrieves a specific workspace by its ID using the YouSign PHP SDK. The example shows how to configure authentication, instantiate the WorkspaceApi, and call the `getWorkspacesWorkspaceId` method with the workspace ID. It includes error handling for the API request. ```PHP setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiWorkspaceApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $workspace_id = 'workspace_id_example'; // string | Workspace Id try { $result = $apiInstance->getWorkspacesWorkspaceId($workspace_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling WorkspaceApi->getWorkspacesWorkspaceId: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Install Yousign PHP SDK via Composer Source: https://github.com/valerius21/yousign-php/blob/main/README.md This snippet shows how to add the Yousign PHP SDK to your project using Composer by specifying the repository and requiring the package. It assumes you are using a development version. ```json { "repositories": [ { "type": "vcs", "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" } ], "require": { "GIT_USER_ID/GIT_REPO_ID": "*@dev" } } ``` -------------------------------- ### Initiate Identity Video Verification Source: https://github.com/valerius21/yousign-php/blob/main/docs/Model/InitiateIdentityVideo.md This snippet demonstrates how to initiate an identity video verification process using the Yousign PHP SDK. It includes setting essential user information such as first name, last name, and a redirection URL. Optional parameters like face recognition and workspace ID can also be configured. ```PHP setFirstName('John'); $identityVideo->setLastName('Doe'); $identityVideo->setRedirectionUrl('https://example.com/redirect'); $identityVideo->setFaceRecognition(true); $identityVideo->setWorkspaceId('your_workspace_id'); // Now you can use $identityVideo object to create a signature request or similar operation. ``` -------------------------------- ### Get ID Document Verification Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/DeprecatedApi.md This example shows how to retrieve a specific ID document verification using the YouSign PHP SDK. It includes API configuration with bearer token authorization and demonstrates how to call the `getIdDocumentVerification` method, handling potential exceptions. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiDeprecatedApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $id_document_verification_id = 'id_document_verification_id_example'; // string | The ID document verification ID try { $result = $apiInstance->getIdDocumentVerification($id_document_verification_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling DeprecatedApi->getIdDocumentVerification: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Get Bank Account Connection Verification (PHP) Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/BankAccountConnectionVerificationApi.md Retrieves a specific bank account connection verification by its ID. This example shows how to configure the SDK with an access token, instantiate the relevant API client, and make the API call, including error handling. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiBankAccountConnectionVerificationApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $verification_id = 'verification_id_example'; // string | Bank Account Connection Verification Id try { $result = $apiInstance->getVerificationsBankAccountConnectionsId($verification_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling BankAccountConnectionVerificationApi->getVerificationsBankAccountConnectionsId: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Initiate Identity Video Verification API Source: https://github.com/valerius21/yousign-php/blob/main/README.md Starts a new identity video verification process. This is performed using a POST request to the /verifications/identity_videos endpoint. ```PHP 'standard' ]; // Assuming you have an API client instance $response = $identityVideoVerificationApi->postVerificationsIdentityVideos($videoVerificationData); ?> ``` -------------------------------- ### Initiate Identity Video Verification (PHP) Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/IdentityVideoVerificationApi.md Example of initiating an identity video verification process using the Yousign PHP client. It demonstrates setting up Bearer authentication, creating an API client instance, and making the POST request to verify identity videos. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPI\Client\Api\IdentityVideoVerificationApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $initiate_identity_video = new OpenAPIClientModelInitiateIdentityVideo(); // OpenAPIClientModelInitiateIdentityVideo try { $result = $apiInstance->postVerificationsIdentityVideos($initiate_identity_video); print_r($result); } catch (Exception $e) { echo 'Exception when calling IdentityVideoVerificationApi->postVerificationsIdentityVideos: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Get User by ID (PHP) Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/UserApi.md This example shows how to retrieve a specific user's details using their unique User ID. It sets up the API client with bearer token authentication and makes a call to the `getUsersUserId` method. The code includes error handling for potential exceptions during the API request. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiUserApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $user_id = 'user_id_example'; // string | User Id try { $result = $apiInstance->getUsersUserId($user_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling UserApi->getUsersUserId: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### List Custom Experiences (PHP) Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/CustomExperienceApi.md Retrieves a list of custom experiences with optional pagination parameters. It requires the bearer token for authentication and uses the `CustomExperienceApi` to fetch data. The response is printed, or an exception is caught and displayed. ```PHP setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiCustomExperienceApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $after = 'after_example'; // string | After cursor (pagination) $limit = 100; // int | The limit of items count to retrieve. try { $result = $apiInstance->getCustomExperiences($after, $limit); print_r($result); } catch (Exception $e) { echo 'Exception when calling CustomExperienceApi->getCustomExperiences: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Get Labels with Filtering and Pagination (PHP) Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/LabelApi.md This example demonstrates how to retrieve a list of labels using the YouSign PHP SDK. It includes configuration for bearer token authentication, setting pagination parameters like 'after' and 'limit', and applying a filter by 'name'. Error handling is included for API exceptions. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiLabelApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $after = 'after_example'; // string | After cursor (pagination) $limit = 100; // int | The limit of items count to retrieve. $name = {"eq":["Miscellaneous"]}; // object | Filter by `name`. Allowed operators: `eq`, `in`. Example: `name[eq]=Miscellaneous` try { $result = $apiInstance->getLabels($after, $limit, $name); print_r($result); } catch (Exception $e) { echo 'Exception when calling LabelApi->getLabels: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Initiate Bank Account Connection - PHP Source: https://github.com/valerius21/yousign-php/blob/main/README.md Initiates a new bank account connection verification process. Uses the POST method. ```PHP postVerificationsBankAccountConnections($body); ?> ``` -------------------------------- ### Get Label by ID (PHP) Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/LabelApi.md This PHP example shows how to fetch a specific label from the YouSign API using its ID. It configures the API client with a bearer token and calls the `getLabelsId` method, passing the label ID as a parameter. The code includes error handling for potential exceptions during the API call. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPIClientApiLabelApi( // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`. // This is optional, `GuzzleHttpClient` will be used as default. new GuzzleHttpClient(), $config ); $label_id = 'label_id_example'; // string | Label Id try { $result = $apiInstance->getLabelsId($label_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling LabelApi->getLabelsId: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Initiate Bank Account Verification - PHP Source: https://github.com/valerius21/yousign-php/blob/main/README.md Initiates a new bank account verification. Uses the POST method. ```PHP postVerificationsBankAccounts($body); ?> ``` -------------------------------- ### Get a Label API Source: https://github.com/valerius21/yousign-php/blob/main/README.md Fetches the details of a specific label by its ID. The endpoint used is /labels/{labelId} with a GET request. ```PHP getLabelsId($labelId); ?> ``` -------------------------------- ### Initiate Bank Account Lookup Verification - PHP Source: https://github.com/valerius21/yousign-php/blob/main/README.md Initiates a new bank account lookup verification. Uses the POST method. ```PHP postVerificationsBankAccountLookups($body); ?> ``` -------------------------------- ### Get Custom Experiences List - PHP Source: https://github.com/valerius21/yousign-php/blob/main/docs/Api/CustomExperienceApi.md Retrieves a list of all Custom Experiences within an organization. Supports pagination using 'after' and 'limit' parameters. The response is a model of type `GetCustomExperiences200Response`. ```php getCustomExperiences($after, $limit): \OpenAPI\Client\Model\GetCustomExperiences200Response ``` -------------------------------- ### Workspace API: Get Default Workspace Source: https://github.com/valerius21/yousign-php/blob/main/README.md Retrieves the default workspace. This endpoint uses the GET method and is part of the Workspace API. ```PHP getWorkspacesDefault(); print_r($defaultWorkspace); } catch (Exception $e) { echo 'Exception when calling getWorkspacesDefault: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### User API: Create User Source: https://github.com/valerius21/yousign-php/blob/main/README.md Creates a new user. This endpoint uses the POST method and is part of the User API. ```PHP "new.user@example.com", "firstName" => "John", "lastName" => "Doe"]; // Replace with new user data try { $newUser = $userApi->postUsers($userData); print_r($newUser); } catch (Exception $e) { echo 'Exception when calling postUsers: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Workspace API: Get Workspace by ID Source: https://github.com/valerius21/yousign-php/blob/main/README.md Retrieves details for a specific workspace identified by its workspaceId. This endpoint uses the GET method and is part of the Workspace API. ```PHP getWorkspacesWorkspaceId($workspaceId); print_r($workspace); } catch (Exception $e) { echo 'Exception when calling getWorkspacesWorkspaceId: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Initiate Identity Document Verification API Source: https://github.com/valerius21/yousign-php/blob/main/README.md Starts a new identity document verification process. This is done via a POST request to the /verifications/identity_documents endpoint. ```PHP 'passport', 'country' => 'FR' ]; // Assuming you have an API client instance $response = $identityDocumentVerificationApi->postVerificationsIdentityDocuments($verificationData); ?> ```