Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a new page using json-RPC on Pyhton.

Dominik
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 1, 2017

I do it so.

import requests
import json

session = requests.Session()
session.auth = ('name', 'pass')

headers = {'content-type': 'application/json'}
page = {"space": "~spacekey", 'title': 'title', 'content': 'content', "parentId": 1234567}
payload = json.dumps({"jsonrpc" : "2.0", "method": "storePage", "params": [page], "id": 1})
response = session.post('https://example.com/rpc/json-rpc/confluenceservice-v2', headers=headers, data=payload)

But that's not enough. I need to create a page using a template.  Using 'templateId=123456789'

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events