API Requests - Xiphe/WP-Project-Update-API GitHub Wiki

The api can handle 4 different request types that are explaned in detail on this site.

Possible Parameters

  • action:* The action key (basic_check, plugin_information, project_details or download_latest).
  • slug:* The slug of the requesting plugin or theme. This have to be a valid json file in /projectSettings/[slug].json.
  • apikey:* A string that is compared to the allowed api-keys in the project files. If you do not validate the api key this can be anything but it needs to be passed.
  • version: The version of the installed plugin/theme. This value will be compared with the remotes project version. Required for the basic_check action.
  • branch: The branchname of the remote project. Default: "Master".
  • type: The project type. Default: "plugin". You can set the project settings "info" key to some .css file if you want to set the project type on the api site.

* Required

Basic Check

[http://updates.example.org/api]?action=basic_check&slug=[slug]&apikey=[apikey]&version=[version]
The result will be the php-serialized update information or a "no-update-needed-hint".
This should be called on Wordpress "pre_set_site_transient_update_plugins" filter hook.

Plugin Information

[http://updates.example.org/api]?action=plugin_information&slug=[slug]&apikey=[apikey]
This request will return php-serialized data about the plugin/theme that is used for the "details for this version"-link of Wordpress.
This should be called on Wordpress "plugins_api" filter hook.

Project Details

[http://updates.example.org/api]?action=project_details&slug=[slug]&apikey=[apikey]
This request will show the remote projects readme file and will be called by the "details for this version"-link for wordpress themes.
This link will be automaticaly added to basic_check requests for themes.

Download Latest

[http://updates.example.org/api]?action=download_latest&slug=[slug]&apikey=[apikey]
This will send the latest project archive.
This link will be passed to Wordpress by the basic_check and plugin_information requests and will be used by Wordpress to download the update.