wiki Resources

Overview

The wiki resource provides functionality for getting information from pages in a Bitbucket wiki, creating new pages, and updating them.

GET the raw content of a Wiki page

Gets the contents of a wiki page and the current revision. You must supply the title of a page to get.  When getting a page, do not include the extension .wiki. If you do not supply a page value, the default is the Home page.

The response contains a markup field in that is one of:

  • markdown
  • creole
  • rest
  • textile
  • null

Bitbucket determines the mark up used in the Wiki based on the page extensions.  The file type may not always be correct in cases where there is no extension; these types appear as markdown.

curl --user accountname:password https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/wiki/{page}
  Click here to expand...

{

"data": "This is inline text: {{{<<file index.html>>}}} followed by more.\n\nTrying to get back to the tutorial for this project? It's here: https://confluence.atlassian.com/display/BITBUCKET/Bitbucket+101\n\n[Two](Two)",

"markup": "markdown",

"rev": "e9247a427a2eba5fa01158ea4aedb6045f2a59dc"

}

POST a new page

Creates a new wiki page. You must supply the following parameters:

Parameter Description
page Title of the page.
data Content of the page.

The caller must authenticate with an account that has access to the wiki.

curl --user accountname:password https://api.bitbucket.org/1.0/repositories/ {accountname}/{repo_slug}/wiki/{page} --data "content=string"
  Click here to expand...
OK

PUT a page update

Updates an existng wiki page. You can supply the following parameters:

Parameter Required Description
page Yes Title of the page.
path Yes Path to the page.
data Yes Content of the page.
rev No

The revision of the file before it was modified. Omit this value to overwrite any contents that currently exist.

Provide this parameter to stop concurrent modifications to an individual wiki page. If you provide the rev and the wiki pages current rev does not match then your edit will fail.

The caller must authenticate with an account that has access to the wiki.

curl --user accountname:password https://api.bitbucket.org/1.0/repositories/ accountname/repo_name/wiki/{page} --data "path={path}&data=string" --data "rev=value"
  Click here to expand...
OK

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport