汇合 6.15.2
我需要使用 REST API 将宏插入现有页面。
curl -s -u user:pasw -X POST -H 'Content-Type: application/json'
'-d{"id":"246341155",
"type":"page",
"space":{"key":"TST"},
"body":{"value":"<ac:structured-macro ac:name="attachments"><ac:parameter ac:name="old">false</ac:parameter><ac:parameter ac:name="sortBy">name</ac:parameter><ac:parameter ac:name="upload">true</ac:parameter></ac:structured-macro>","representation":"storage"}}'
https://localhost:8080/rest/api/content/
响应:
{"statusCode":500,"message":"","reason":"Internal Server Error"}
使用宏创建页面时,出现同样的错误,页面没有创建:
curl -s -u user:pasw -X POST -H 'Content-Type: application/json' -H 'Accept: application/json'
'-d{"type":"page",
"ancestors":[{"id":246324831}],
"title":"New Page",
"space":{"key":"TST"},
"body":{"storage":{"value":"<ac:structured-macro ac:name="attachments"><ac:parameter ac:name="old">false</ac:parameter><ac:parameter ac:name="sortBy">name</ac:parameter><ac:parameter ac:name="upload">true</ac:parameter></ac:structured-macro>",
"representation":"storage"}}}'
'https://localhost:8080/rest/api/content/?os_authType=basic'