PHP code example of oscar-team / sproom

1. Go to this page and download the library: Download oscar-team/sproom library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

oscar-team / sproom example snippets




$client = new \OscarTeam\Sproom\SproomClient(token: 'token', environment: 'test');


// Get the list of child companies
$client->childCompanies()->list();

// Create new child company
$client->childCompanies()->create($requestData);

// Delete child company
$client->childCompanies()->delete($childCompanyId);

// Enroll child company
$client->childCompanies()->enroll($requestData);

// Get child company
$client->childCompanies()->get($childCompanyId);

// Get child company token
$client->childCompanies()->getToken($childCompanyId);



// Search for a company in sproom
$client->childCompanies()->search('DK:CVR:1234');



// List all the documents
$client->documents()->list();

// Send document to sproom
$client->documents()->send($filePath);

// Update already sent document
$client->documents()->update($documentId, []);

// Get sent document format
$client->documents()->getFormat($documentId, $format);

// Set response for the document
$client->documents()->setResponse($documentId, []);

// Get response for the document
$client->documents()->getResponse($documentId);

// Set state of the document
$client->documents()->setState($documentId, []);

// Get state of the document
$client->documents()->getState($documentId);



// List all the verifications
$client->peppolParticipantVerifications()->list();

// Initiate the verification
$client->peppolParticipantVerifications()->initiate([]);

// Get the verification
$client->peppolParticipantVerifications()->get($verificationId);

// Revoke the verification
$client->peppolParticipantVerifications()->revoke($verificationId);

// Download the verification document
$client->peppolParticipantVerifications()->downloadDocument($verificationId, []);

// Preview the verification document
$client->peppolParticipantVerifications()->previewDocument([]);



// Check if the recipients can reveie the document
$client->recipients()->check('DK:CVR:123');

// Bulk check
$client->recipients()->bulkCheck([
  'DK:CVR:123'
]);



// List all the webhooks
$client->webhooks()->list();

// Create new webhook
$client->webhooks()->create($requestData);

// Delete webhook
$client->webhooks()->delete($webhookId);

// Update webhook
$client->webhooks()->update($requestData);

// Get webhook
$client->webhooks()->get($webhookId);

// Test webhook
$client->webhooks()->test($webhookId);