projectdoc Toolbox

Module page to collect tips for using the Web API REST Examples.

Iteration
Facade

Description

Collection of Tips for using the Web API Examples.

.netrc File

 

Using curl -n assumes you are using a .netrc file to authenticate. Please see REST Login to Confluence with cURL for more options.

Alternative to curls -d option for files

 

The cURL option -d @filename assumes the data that shall be used to PATCH the given resources is in the given file. If you prefer a one-liner the escaped content of the file must follow directly the -d option:

curl -n -X PATCH  -H "Content-Type: application/json" \
	https://www.smartics.eu/confluence/rest/projectdoc/1/document.json?id-list=70189553 \
	-d '{"property":[{"name":"Customer Support URL","value":"<a href=\"https://example.atlassian.net/servicedesk/customer/portal/1\">Customer Support</a>","controls":"","position":"after","ref":"Short Name"}, "name":"Service Contact","value":"<a href=\"mailto:support@example.com\">support@example.com</a>","controls":"","position":"after","ref":"Iteration"}]}' 

urlencode strings

 

Using cURL it is necessary that the strings of the Query-part of an URL are correctly urlencoded.

e.g. ?where=$<Dokumenttyp>=[it-service] is not a valid query string

So the string following the equal sign must be urlencoded e.g using the linux-urlencode command:

myuser@home ~ # urlencode "$<Dokumenttyp>=[it-service]"
%24%3CDokumenttyp%3E%3D%5Bit-service%5D

This results to the following complete query string:

?where=%24%3CDokumenttyp%3E%3D%5Bit-service%5D



Transcluded By

NameShort DescriptionDoctype
Deleting Properties
Delete properties for a set of documents specified by their IDs.
section
Fetching Document IDs
Specify a query to fetch document IDs. Pass this list of IDs to other service calls (e.g. to patch properties or sections).
section
Adding Properties
Add properties for a set of documents specified by their IDs.
section