<< Back to GForge REST API

Entity: Wiki

GET

getContent

Method returns wiki page file content. Url: ../api/wiki/[ID]/content

Parameters (1)

Name Type Description
request \RequestParameters RequestParameters object

Return: \stdClass

getDiff

Method returns wiki page file content. Url: ../api/wiki/[ID]/content

Parameters (1)

Name Type Description
request \RequestParameters RequestParameters object

Return: \stdClass

getReferrers

Method returns wiki page versions info. Url: ../api/wiki/[ID]/referrers?project=[project]

Parameters (1)

Name Type Description
request \RequestParameters RequestParameters object
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \WikiVersion[]

getVersions

Method returns wiki page versions info. Url: ../api/wiki/[ID]/versions?project=[project]

Parameters (1)

Name Type Description
request \RequestParameters RequestParameters object
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \stdClass

getWiki

User needs to be authenticated to use this service.
Returns 0 or more WikiPageBasic models in an array. If an 'id' is received as parameter it will search for that record. Otherwise the method will process a search request using the expected parameters in the query string:

  • sort_field: One of the fields defined in apimodels\WikiPageBasic.

Parameters (1)

Name Type Description
request \RequestParameters See description for details about expected properties.
Sortable
Use the sort_field and sort_dir parameters to control the order in which records are returned.
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: mixed

A WikiPageBasic model if 'id' defined, models array otherwise

Example 1

Find a wikipage by id:
  GET http://api.mygforge.tld/api/wiki/1234

  {
  id: 55,
  section: "project",
  refId: 134,
  pagename: "FrontPage",
  flags: 0,
  latestVersion: 1,
  pageViews: 1,
  html_url: "/gf/project/msproject/wiki/?pagename=FrontPage",
  content_url: "/api/wiki/55/content"
  }

Example 2

Find wikipages with project id 134, return 3 elements, page 1, sort by 'pagename' DESC:
  GET http://api.mygforge.tld/api/wiki/?refId=134&page_size=3&page_num=1&sort_field=pagename&sort_dir=desc

[
  {"id":61,"section":"project","refId":134,"pagename":"MostPopular","flags":0,"latestVersion":1,"pageViews":0},
  {"id":57,"section":"project","refId":134,"pagename":"HowToUseWiki","flags":0,"latestVersion":1,"pageViews":0},
  {"id":63,"section":"project","refId":134,"pagename":"GoodStyle","flags":0,"latestVersion":1,"pageViews":0}
]

Example 3

Find wikipages with project unixname 'gforge5', pagename 'FrontPage':
  GET http://api.mygforge.tld/api/wiki/?project=gforge5&pagename=FrontPage

Example 4

Find wikipages with user id 123, pagename 'My User Wiki':
  GET http://api.mygforge.tld/api/wiki/?user=123&pagename=My+User+Wiki

[
  {"id":68,"section":"user","refId":123,"pagename":"My+User+Wiki","flags":0,"latestVersion":1,"pageViews":1},
]

POST

postCreate

Create a new wiki page entry if necessary

Parameters (2)

Name Type Description
id string In route this should be the pagename. Required
project string Project associated with wiki. Required

Return: (none)

postOptions

Sets project wiki to be public or private

Parameters (0)

Name Type Description
No parameters

Return: (none)

postWiki

Create a new build and an associated job if necessary

Parameters (2)

Name Type Description
id string Database ID for the wiki. Required
content string Content to be saved for the wiki page. Required

Return: (none)

PUT

DELETE