YOURLS plugin: how to implement a custom API action
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
plugin.php Initial commit Nov 9, 2012 Initial commit Nov 9, 2012

Plugin for YOURLS 1.6+: Custom API Action

What for

Create custom API action, such as:

How to

  • In /user/plugins, create a new folder named api-action
  • Drop these files in that directory
  • Go to the Plugins administration page and activate the plugin
  • Have fun

Format your returns

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',