CodeHub x callback url API

Dillon Buchanan edited this page Mar 15, 2014 · 1 revision

The following is a document outlining the support for x-callback-url actions CodeHub currently implements. Currently, the application operates on the details described in the 1.0 DRAFT Spec found on the x-callback-url website.

URL Scheme

The registered URL schema for CodeHub is codehub://

URL Format

Per the 1.0 Spec, the URL format implemented in CodeHub follows:

codehub://x-callback-url/[action]?[x-callback parameters]&[action parameters]

All x-callback-parameters are support except for x-source which is not used within CodeHub (yet) and is silently ignored. The action is defined below and the action parameters are specific to the action, also defined below.

Actions

The following lists the current actions available via x-callback. This list is not permanant and will be extended as user's request additional support.

Create New Gist

This action will create a new Gist on Github.com

Action

/gist/create

Parameters

  • description: A string description of the Gist. Default is empty
  • public: A boolean value indicating whether the gist is public or not. Default is false.
  • fileN: This parameter can be defined multiple times. The "N" in the name is a placeholder for a unique name for the file. The value of the argument is the content of the file

Examples

The following example will create a public Gist with a description of "Hello" and two files.

codehub://x-callback-url/gist/create?description=Hello&public=true&file1=This%20is%20file%20one&file2=CodeHub%20Rocks

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.