PHP code example of accredible / acms-api-php

1. Go to this page and download the library: Download accredible/acms-api-php 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/ */

    

accredible / acms-api-php example snippets


use ACMS\Api;

// Instantiate the API instance replacing APIKey with your API key
$api = new Api("APIKey");

// Get a Credential
$api->get_credential(10000005);

// Get an array of Credentials 
$api->get_credentials(null, "[email protected]");

// Create a Credential - Name, Email, Group ID
$api->create_credential("John Doe", "[email protected]", 54018);

// Update a Credential
$api->update_credential(10000005, "Jonathan Doe");

// Delete a Credential
$api->delete_credential(10000005);

// Get a Group
$api->get_group(100);

// Create a Group - Name, Course Name, Course Description, Course Link
$api->create_group("PHPTest", "Test course", "Test course description.", "http://www.example.com");

// Update a Group 
$api->update_group(100, 'PHPTest2');

// Delete a Group
$api->delete_group(100);