Byword x-callback-url API

Byword allows creating, opening and adding content to files through the x-callback-url specification.

URL Scheme

The registered URL scheme is byword://.

URL Format

You can use the x-callback-url format:

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

or without the x-callback-url host:

byword://[action]?[x-callback parameters]&[action parameters]

The x-callback parameters are defined by the x-callback-url protocol and are optional for all actions. If available, these parameters will be called by Byword. The action parameters are described below.

Actions

New

Create a new file in Byword.

Parameters

Examples

Create a new file ‘Test.md’ in the root of ‘dropbox’ location, with the ‘sample’ text:

byword://new?location=dropbox&name=Test.md&text=sample

Open

Open and existing file. Fails if the file does not exist.

Parameters

Examples

Open the file ‘Test.md’ in the ‘samples’ directory of the ‘icloud’ location:

byword://open?location=icloud&path=samples&name=Test.md

Append or Prepend

Append or preprend content to an existing file. If the file does not exist a new one is created.

Parameters

Examples

Append ‘sample content’ to the file ‘Test.md’ in the ‘samples’ directory of the ‘dropbox’ location:

byword://x-callback-url/append?location=dropbox&path=samples&name=Test.md&text=sample%20content

Prepend ‘sample’ to the file ‘Test.md’ in the root of the ‘local’ location:

byword://prepend?location=local&name=Test.md&text=sample

Replace

Replace the contents of an existing file. If the file doesn’t exist a new one is created.

Parameters

Examples

Replace the content of the file ‘Test.md’ with ‘replaced’ in the location and folder being browsed:

byword://replace?name=Test.md&text=replaced