Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
core_badges\backpack_api2p1 Class Reference

To process badges with backpack and control api request and this class using for Open Badge API v2.1 methods. More...

Public Member Functions

 __construct ($externalbackpack)
 backpack_api2p1 constructor. More...
 
 curl_request ($action, $postdata=null)
 Make an api request. More...
 
 disconnect_backpack ($backpack)
 Disconnect the backpack from this user. More...
 
 put_assertions ($hash)
 Export a badge to the backpack site. More...
 

Protected Member Functions

 get_stored_token ($externalbackpackid)
 Get token. More...
 

Protected Attributes

null $backpackapiurl = ''
 api URL of the backpack.
 
null $backpackapiversion
 version api of the backpack.
 

Detailed Description

To process badges with backpack and control api request and this class using for Open Badge API v2.1 methods.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core_badges\backpack_api2p1::__construct (   $externalbackpack)

backpack_api2p1 constructor.

Parameters
object$externalbackpackobject
Exceptions
coding_exceptionerror message

Member Function Documentation

◆ curl_request()

core_badges\backpack_api2p1::curl_request (   $action,
  $postdata = null 
)

Make an api request.

Parameters
string$actionThe api function.
string$postdataThe body of the api request.
Return values
mixed

◆ disconnect_backpack()

core_badges\backpack_api2p1::disconnect_backpack (   $backpack)

Disconnect the backpack from this user.

Parameters
object$backpackto disconnect.
Return values
bool
Exceptions
dml_exception

◆ get_stored_token()

core_badges\backpack_api2p1::get_stored_token (   $externalbackpackid)
protected

Get token.

Parameters
int$externalbackpackidID of external backpack.
Return values
oauth2::badge_backpack_oauth2|false|stdClass|null

◆ put_assertions()

core_badges\backpack_api2p1::put_assertions (   $hash)

Export a badge to the backpack site.

Parameters
string$hashof badge issued.
Return values
array
Exceptions
moodle_exception
coding_exception

The documentation for this class was generated from the following file: