<< 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 \mvcnphpRequestParameters RequestParameters object

Return: \stdClass

No return type is defined

getDiff

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

Parameters (1)

Name Type Description
request \mvcnphpRequestParameters RequestParameters object

Return: \stdClass

No return type is defined

getReferrers

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

Parameters (1)

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

Return: \WikiVersion[]

No return type is defined

getVersions

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

Parameters (1)

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

Return: \stdClass

No return type is defined

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. Default is 'id'.
  • sort_dir: One of the order values defined in $appConf['query.pagsize'] from config-base.php. Default is 'asc'.
  • page_num: Requested page. By default page=0 is requested.
  • page_size: Size of the requested page. The value stored in $appConf['query.sortDirs'] from config-base.php is used by default.
  • user: user Id or UnixName. Filter user wiki pages of section type 'user' where refId equals the selected user id.
  • project: user Id or UnixName. Filter project wiki pages of section type 'project' where refId equals the selected project id.
  • Any of the public properties defined in apimodels\WikiPageBasic. If a valid field is defined it will be used as filter.

Parameters (1)

Name Type Description
request \mvcnphpRequestParameters 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)

No return type is defined

postOptions

Sets project wiki to be public or private /api/project/:unixName/publicwiki { public:1 }

Parameters (0)

Name Type Description
No parameters

Return: (none)

No return type is defined

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)

No return type is defined

PUT

DELETE