Skip to content

YOURLS plugin: how to implement a custom API action

Notifications You must be signed in to change notification settings

YOURLS/API-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Plugin for YOURLS : Custom API Action Listed in Awesome YOURLS!

💡 This is a plugin sample. Build on it !

What for

Create custom API action, such as:
http://sho.rt/yourls-api.php?username=x&password=xx&action=do_crazy_stuff&format=json

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

License

Do whatever the hell you want with it.

About

YOURLS plugin: how to implement a custom API action

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages