Space Fields REST API
This document provides REST API details for Space fields plugin.
Get Space Fields
GET http://localhost:8090/rest/spacefields/1.0/utility/list/fields?spaceKey={spaceKey}
Query Parameters:
- spaceKey (String) (Required)
- fieldId (Number)
- fieldName (String)
- search (String) e.g. %project%
Response: [Status: 200]
$ curl -u"user:pass" -XGET \
http://localhost:8090/rest/spacefields/1.0/utility/list/fields/?spaceKey=DT
{"fieldId":2,"spaceKey":"DT","fieldName":"project.owner.name","fieldValue":"Venkat Prasad",\
"lastUpdated":1524976091105,"accessType":"public"}
$
Get Space Fields History
GET http://localhost:8090/rest/spacefields/1.0/utility/list/fields/space/history/id/{fieldId}
Path Parameters:
- fieldId (Number) - Confluence Space Field ID
Add Space Field
POST http://localhost:8090/rest/spacefields/1.0/utility/add/field
Schema Fields:
- spaceKey (String)
- fieldName (String)
- fieldValue (String)
- accessType (String) - Optional
- history (Boolean) - Optional
Response: [Status: 200]
$ curl -u"user:pass" -XPOST -H "Content-Type: application/json" --data '{"spaceKey":"DT", \
"fieldName":"project.security.key", "fieldValue":"nxoedoew","accessType":"public"}' \
http://localhost:8090/rest/spacefields/1.0/utility/add/field
{"field":5,"message":"[Info] Added Space Field"}
$
Update Space Field
POST http://localhost:8090/rest/spacefields/1.0/utility/update/field
Schema Fields:
- spaceKey (String)
- fieldName (String)
- fieldValue (String)
- accessType (String) - Optional
- history (Boolean) - Optional
Response: [Status: 200]
$ curl -u"user:pass" -XPOST -H "Content-Type: application/json" --data '{"spaceKey":"DT", \
"fieldName":"project.security.key", "fieldValue":"xxxxxxx"}' \
http://localhost:8090/rest/spacefields/1.0/utility/update/field
{"field":5,"message":"[Info] Updated Space Field"}
$
Note. Update creates field if not exists.
Force Update Space Field
POST http://localhost:8090/rest/spacefields/1.0/utility/update/field/force
Schema Fields:
- spaceKey (String)
- fieldId (Number)
- fieldName (String)
- fieldValue (String)
- accessType (String) - Optional
- history (Boolean) - Optional
Response: [Status: 200]
Note. This API helps to rename field name.
$ curl -u"user:pass" -XPOST -H "Content-Type: application/json" --data '{"spaceKey":"DT", \
"fieldId":"5", "fieldName":"project.security.key", "fieldValue":"xxxxxxx"}' \
http://localhost:8090/rest/spacefields/1.0/utility/update/field
{"field":5,"message":"[Info] Updated Space Field"}
$
Delete Space Field
DELETE http://localhost:8090/rest/spacefields/1.0/utility/remove/field?spaceKey={spaceKey}&fieldId={fieldId}
$ curl -u"user:pass" -XDELETE \
http://localhost:8090/rest/spacefields/1.0/utility/remove/field?spaceKey=DT&fieldId=5
{"field":5,"message":"[Info] Removed Space Field"}
$