Represent a single method for the remote api.
More...
|
| __construct ($action, $url, $postparams, $requestexporter, $responseexporter, $multiple, $method, $json, $authrequired, $isuserbackpack, $backpackapiversion) |
| Create a mapping.
|
|
| is_match ($action) |
| Does the action match this mapping?
|
|
| request ($apiurl, $urlparam1, $urlparam2, $email, $password, $postparam, $backpackid) |
| Make an api request and parse the response.
|
|
|
string | $action |
| The action of this method.
|
|
boolean | $authrequired |
| Authentication is required for this request.
|
|
boolean | $json |
| json decode the response.
|
|
string | $method |
| get or post methods.
|
|
boolean | $multiple |
| This method returns an array of responses.
|
|
array | $params |
| List of parameters for this method.
|
|
string | $requestexporter |
| Name of a class to export parameters for this method.
|
|
string | $responseexporter |
| Name of a class to export response for this method.
|
|
|
int | $backpackapiversion |
| OpenBadges version 1 or 2.
|
|
mixed | $postparams |
| List of parameters for this method.
|
|
Represent a single method for the remote api.
- Copyright
- 2012 onwards Totara Learning Solutions Ltd
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_badges\backpack_api_mapping::__construct |
( |
| $action, |
|
|
| $url, |
|
|
| $postparams, |
|
|
| $requestexporter, |
|
|
| $responseexporter, |
|
|
| $multiple, |
|
|
| $method, |
|
|
| $json, |
|
|
| $authrequired, |
|
|
| $isuserbackpack, |
|
|
| $backpackapiversion ) |
Create a mapping.
- Parameters
-
string | $action | The action of this method. |
string | $url | The base url of this backpack. |
mixed | $postparams | List of parameters for this method. |
string | $requestexporter | Name of a class to export parameters for this method. |
string | $responseexporter | Name of a class to export response for this method. |
boolean | $multiple | This method returns an array of responses. |
string | $method | get or post methods. |
boolean | $json | json decode the response. |
boolean | $authrequired | Authentication is required for this request. |
boolean | $isuserbackpack | user backpack or a site backpack. |
integer | $backpackapiversion | OpenBadges version 1 or 2. |
◆ get_authentication_error()
static core_badges\backpack_api_mapping::get_authentication_error |
( |
| ) |
|
|
static |
Get the last authentication error in this request.
- Return values
-
◆ is_match()
core_badges\backpack_api_mapping::is_match |
( |
| $action | ) |
|
Does the action match this mapping?
- Parameters
-
- Return values
-
◆ request()
core_badges\backpack_api_mapping::request |
( |
| $apiurl, |
|
|
| $urlparam1, |
|
|
| $urlparam2, |
|
|
| $email, |
|
|
| $password, |
|
|
| $postparam, |
|
|
| $backpackid ) |
Make an api request and parse the response.
- Parameters
-
string | $apiurl | Raw request url. |
string | $urlparam1 | Parameter for the request. |
string | $urlparam2 | Parameter for the request. |
string | $email | User email for authentication. |
string | $password | for authentication. |
mixed | $postparam | Raw data for the post body. |
string | $backpackid | the id of the backpack to use. |
- Return values
-
◆ set_authentication_error()
static core_badges\backpack_api_mapping::set_authentication_error |
( |
| $msg | ) |
|
|
static |
Remember the error message in a static variable.
- Parameters
-
The documentation for this class was generated from the following file:
- badges/classes/backpack_api_mapping.php