💡 This is a plugin sample. Build on it !
Create custom API action
, such as:
https://sho.rt/yourls-api.php?username=x&password=xx&action=do_crazy_stuff&format=json
- In
/user/plugins
, create a new folder namedapi-action
- Drop these files in that directory
- Go to the Plugins administration page and activate the plugin
- Have fun
Your API function should, ideally, return an array like this one:
$return = array(
'statusCode' => 200, // HTTP-like status code
'simple' => "a human readable one liner, if 'format=simple'",
'message' => 'a return status',
'your_action' => array(
'something' => 'some value', // anything function wants to return
'otherthing' => 'other value',
),
);
Do whatever the hell you want with it.