Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

pageId is a very important parameter and should be supplied always, as all the methods are executed when PAGE is known/defined, otherwise a NOT FOUND error is shown

...


Info

Adding "_skipIfParamIsEmpty" parameter with value "true" to your request helps to bypass setting all the fields - useful when you have field definitions with validations and you dont want to set / reset those with your REST API call

Code Block
_skipIfParamIsEmpty=true
Method / URL

Create entry

Code Block
http(s)://CONFLUENCE_SERVER/ajax/confiforms/rest/save.action?pageId=<PAGE_ID>&f=<FORM_NAME>&fields...
PAGE_ID - where the ConfiForms form is configured
FORM_NAME - name of ConfiForms form
fields... - fields here is a set of key-value pairs for ConfiForms form's fields you want to set (separated with '&' as HTTP parameters). For example if the form has a field with a name 'bookTitle' defined then you will need to write bookTitle=Book Title

Update entry

 


Code Block
http(s)://CONFLUENCE_SERVER/ajax/confiforms/rest/save.action?pageId=<PAGE_ID>&f=<FORM_NAME>&entryId=ID&fields...

 


PAGE_ID - where the ConfiForms form is configured
FORM_NAME - name of ConfiForms form
ID - entity id you would like to update, if not given then a new entity is created
fields... - fields here is a set of key-value pairs for ConfiForms form's fields you want to set (separated with '&' as HTTP parameters). For example if the form has a field with a name 'bookTitle' defined then you will need to write bookTitle=Book Title

 


Delete entry

Code Block
http(s)://CONFLUENCE_SERVER/ajax/confiforms/delete.action?pageId=<PAGE_ID>&registrationFormName=<FORM_NAME>&entryId=<ID>
 


PAGE_ID - where the ConfiForms form is configured
FORM_NAME - name of ConfiForms form
ID - entity id you would like to delete

Delete entries

Code Block
http(s)://CONFLUENCE_SERVER/ajax/confiforms/remove.action?pageId=<PAGE_ID>&f=<FORM_NAME>&q=<FILTER>
PAGE_ID - where the ConfiForms form is configured
FORM_NAME - name of ConfiForms form
FILTER - filter to match records you want to delete. Same syntax as the filter itself uses. See Using filters section in documentation

Update specific field

 


Code Block
http(s)://CONFLUENCE_SERVER/ajax/confiforms/rest/update.action?pageId=<PAGE_ID>&f=<FORM_NAME>&q=<FILTER>&fv=field:value
PAGE_ID - where the ConfiForms form is configured
FORM_NAME - name of ConfiForms form
FILTER - filter to match records you want to update. Same syntax as the filter itself uses. See Using filters section in documentation
fv=field:value - parameter fv shows which form's field to update and it's new value

 


Validate entry

 


Code Block
http(s)://CONFLUENCE_SERVER/ajax/confiforms/rest/validate.action?pageId=<PAGE_ID>&f=<FORM_NAME>&fields...

 


This method only validates if the data could be saved

PAGE_ID - where the ConfiForms form is configured
FORM_NAME - name of ConfiForms form
fields... - fields here is a set of key-value pairs for ConfiForms form's fields you want to set (separated with '&' as HTTP parameters). For example if the form has a field with a name 'bookTitle' defined then you will need to write bookTitle=Book Title

Search entries

Code Block
http(s)://CONFLUENCE_SERVER/ajax/confiforms/rest/filter.action?pageId=<PAGE_ID>&f=<FORM_NAME>&q=<QUERY>

 


PAGE_ID - where the ConfiForms form is configured
FORM_NAME - name of ConfiForms form
QUERY - search query in Lucene format, For example to search for books which have a title ('bookTitle' field on the form) set to 'Catching fire' you would need to write the following expression: &q=bookTitle:Catching fire.
Take a look at Using filters tutorial to learn more by example

Get form definition

Code Block
http(s)://CONFLUENCE_SERVER/ajax/confiforms/rest/definition.action?pageId=<PAGE_ID>&f=<FORM_NAME>

 


PAGE_ID - where the ConfiForms form is configured
FORM_NAME - name of ConfiForms form

Upload file to ConfiForms field

Since ConfiForms version 1.20 you are now able to attach files to ConfiForms records via REST API. Make sure you create a POST request

File should be encoded as BASE64 string

Code Block
http(s)://CONFLUENCE_SERVER/ajax/confiforms/rest/upload.action?pageId=<PAGE_ID>&f=<FORM_NAME>&q=<FILTER>&fv=<FIELD_NAME>:<BASE64ENCODED_STRING>&fileContentType=<CONTENT_TYPE>&fileName=<NAMEOFFILE>
PAGE_ID - where the ConfiForms form is configured
FORM_NAME - name of ConfiForms form
FILTER - filter to find the entry you want to upload this file to (for example: id:GUID, id:39554293-f4c6-4ae5-9d34-cb34db1f44a0 to upload to a particular entry, filter can be anything ConfiForms supports ConfiForms Filters)

FIELD_NAME - name of the file followed by : and file contents encoded as BASE64 string

CONTENT_TYPE - file content type which you are trying to upload, expecting mime type, see https://www.sitepoint.com/web-foundations/mime-types-complete-list/

NAMEOFFILE - name of the file (will be visible as the name in attachments)