Skip to content

Latest commit

 

History

History
451 lines (320 loc) · 14.3 KB

CourseEnrollmentApi.md

File metadata and controls

451 lines (320 loc) · 14.3 KB

Yoast\MyYoastApiClient\CourseEnrollmentApi

All URIs are relative to https://my.yoast.test

Method HTTP request Description
bulkInvite POST /api/CourseEnrollments/bulkInvite Bulk invite for Course Enrollment.
fromAcademy PUT /api/CourseEnrollments/fromAcademy Update a CourseEnrollment
getLegacyExpiring GET /api/CourseEnrollments/getLegacyExpiring Get legacy course enrollments that expire between two given dates
getMany GET /api/CourseEnrollments Get course enrollments
getManyPaged GET /api/CourseEnrollments/paged Get customers
getOne GET /api/CourseEnrollments/{id} Get a course enrollment
invite POST /api/CourseEnrollments/{id}/invite Invite a customer
transfer POST /api/CourseEnrollments/transfer Transfer course enrollments

bulkInvite

\Yoast\MyYoastApiClient\Model\CourseEnrollment[] bulkInvite($body)

Bulk invite for Course Enrollment.

Bulk invites another Customer by email to use this Course Enrollment.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\BulkInviteDto(); // \Yoast\MyYoastApiClient\Model\BulkInviteDto | 

try {
    $result = $apiInstance->bulkInvite($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CourseEnrollmentApi->bulkInvite: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\BulkInviteDto

Return type

\Yoast\MyYoastApiClient\Model\CourseEnrollment[]

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

fromAcademy

fromAcademy($body)

Update a CourseEnrollment

Updates the progress for a certain course and student with data from academy.yoast.com

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto(); // \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto | 

try {
    $apiInstance->fromAcademy($body);
} catch (Exception $e) {
    echo 'Exception when calling CourseEnrollmentApi->fromAcademy: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getLegacyExpiring

\Yoast\MyYoastApiClient\Model\CourseEnrollment[] getLegacyExpiring($from, $until)

Get legacy course enrollments that expire between two given dates

Gets a list of legacy course enrollments that expire between two dates. A legacy enrollment is a course enrollment that does not belong to a subscription, but is instead created as a direct result of placing an order.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi(
    // 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
);
$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 
$until = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 

try {
    $result = $apiInstance->getLegacyExpiring($from, $until);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CourseEnrollmentApi->getLegacyExpiring: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
from \DateTime
until \DateTime

Return type

\Yoast\MyYoastApiClient\Model\CourseEnrollment[]

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getMany

\Yoast\MyYoastApiClient\Model\CourseEnrollment[] getMany($filter)

Get course enrollments

Get and filter course enrollments

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi(
    // 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
);
$filter = new \stdClass; // object | Used for filtering/joining the results.

try {
    $result = $apiInstance->getMany($filter);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CourseEnrollmentApi->getMany: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
filter object Used for filtering/joining the results. [optional]

Return type

\Yoast\MyYoastApiClient\Model\CourseEnrollment[]

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getManyPaged

getManyPaged($filter)

Get customers

Get and filter customer

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi(
    // 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
);
$filter = new \stdClass; // object | Used for filtering/joining the results.

try {
    $apiInstance->getManyPaged($filter);
} catch (Exception $e) {
    echo 'Exception when calling CourseEnrollmentApi->getManyPaged: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
filter object Used for filtering/joining the results. [optional]

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getOne

\Yoast\MyYoastApiClient\Model\CourseEnrollment getOne($id, $filter)

Get a course enrollment

Get a single course enrollment

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi(
    // 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
);
$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 
$filter = new \stdClass; // object | Used for filtering/joining the results.

try {
    $result = $apiInstance->getOne($id, $filter);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CourseEnrollmentApi->getOne: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string
filter object Used for filtering/joining the results. [optional]

Return type

\Yoast\MyYoastApiClient\Model\CourseEnrollment

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

invite

\Yoast\MyYoastApiClient\Model\CourseEnrollment invite($body, $id)

Invite a customer

Invites another Customer by email to use this Course Enrollment

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\InviteDto(); // \Yoast\MyYoastApiClient\Model\InviteDto | 
$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 

try {
    $result = $apiInstance->invite($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CourseEnrollmentApi->invite: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\InviteDto
id string

Return type

\Yoast\MyYoastApiClient\Model\CourseEnrollment

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

transfer

\Yoast\MyYoastApiClient\Model\CourseEnrollment[] transfer($body)

Transfer course enrollments

Transfers all Course Enrollments from one Customer to another.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\TransferDto(); // \Yoast\MyYoastApiClient\Model\TransferDto | 

try {
    $result = $apiInstance->transfer($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CourseEnrollmentApi->transfer: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\TransferDto

Return type

\Yoast\MyYoastApiClient\Model\CourseEnrollment[]

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]