Versions Compared

Key

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

...

PS



create a page:     "page4"


Content:

<p>This is a new page from curl Linux<br/>

a new page</p>


Code Block
titlePOST using linux curl
collapsetrue
curl 
-X POST 
-H 'Content-Type: application/json' 
-d '{"type":"page","title":"page4","space":{"key":"TEST"},"body":{"storage":{"value":"<p>This is a new page from curl Linux<br/> a new page</p>","representation":"storage"}}}' 
https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/ | python3 -mjson.tool


{
Code Block
titlepage
POST with curl on Windows Powershell
collapsetrue
PS C:\Users\jkriker> curl -Method POST -ContentType 'application/json'  -Body '{"type": "page",
  "title": "page4page7",
 >> "space": {
    "key": "TEST"
  },
  "body": {
    "storage": {
      "value": "<p>This is a new page from curl Linux<br/> a new page</p>",
      "representation":
>> "storage"}}}' https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/


StatusCode    }   } }
Code Block
titlePOST HTTP REQUEST
collapsetrue
myplex@batpc2:~$ curl200
-XStatusDescription POST: -HOK
'Content-Type: application/json' -d '{Content           : {"id":"13172807","type":"page","status":"current","title":"page4",page7","space":{"id":13238319,"key":"TEST","name":"test","type":"global","s
                      tatus":"current","_expandable":{"settings":"/rest/api/space/TEST/s...
RawContent        : HTTP/1.1 200 OK
             "space":{"key":"TEST"},"body":{"storage":{"value":"<p>This is a new page from curl Linux<br/> a new page</p>","representation":
"storage"}}}' https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/ | python3 -mjson.tool
  % TotalVary: Accept-Encoding
              % Received % Xferd  Average Speed   Time Strict-Transport-Security: max-age=315360000; includeSubDomains; preload
   Time     Time  Current          ATL-TraceId: 8f579c96f93fecd7
                    X-XSS-Protection: 1; mode=block
Dload  Upload   Total   Spent    Left  Speed 100  4632    0  4460Transfer-Encoding: chu...
Forms   100   172   4000    154:  0:00:01{}
Headers  0:00:01 --:--:--  4154 {     "id": "13238405"{[Vary, Accept-Encoding], [Strict-Transport-Security, max-age=315360000;  "type": "page",
    "status": "current"includeSubDomains; preload], [ATL-TraceId,
    "title": "page4",     "space": {         "id": 13238319,
  8f579c96f93fecd7], [X-XSS-Protection, 1; mode=block]...}
Images      "key": "TEST",     : {}
InputFields  "name": "test",    : {}
Links   "type": "global",         "status": "current",
{}
ParsedHtml        "_expandable": {mshtml.HTMLDocumentClass
RawContentLength  : 4460

Code Block
titlepage
{
  "type": "page",
  "title":  "settingspage4":,
  "/rest/api/space/TEST/settings",: {
    "key": "TEST"
  },
  "metadatabody": "",{
    "storage": {
      "operationsvalue": "",
     <p>This is a new page from curl Linux<br/> a new page</p>",
      "lookAndFeelrepresentation": "/rest/api/settings/lookandfeel?spaceKey=TEST",storage"
    }
  }
}


Code Block
titlePOST HTTP REQUEST
collapsetrue
myplex@batpc2:~$ curl -X POST -H "permissions": "",'Content-Type: application/json' -d '{"type":"page","title":"page4",              "icon": "",             "description": "",                    "themespace":{"key": "/rest/api/space/TEST/theme"},"body":{"storage":{"value":"<p>This is a new page from curl Linux<br/> a     "historynew page</p>","representation":
"storage",
  }}}' https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/ | python3 -mjson.tool
  % Total    % Received "homepage": "/rest/api/content/13238386"% Xferd  Average Speed   Time   }, Time     Time  Current
"_links": {             "webui": "/spaces/TEST",             "self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/space/TEST"    Dload  Upload   }Total   Spent  },  Left  Speed
"history":100 { 4632    0  4460  "latest": true,100   172   4000    "createdBy":154 { 0:00:01  0:00:01 --:--:--  4154
 {
    "typeid": "anonymous13238405",
    "type": "page",
      "profilePicturestatus": {
    "current",
           "path"title": "/wiki/s/-1234050512/6452/df79d7c6182c8a1ae71bb90a94d2018702e70afa/_/images/icons/profilepics/anonymous.pngpage4",
       "space": {
        "widthid": 4813238319,
          "key": "TEST",
        "heightname": 48"test",
        "type": "global",
        "isDefaultstatus": true"current",
        "_expandable":  {
 },             "displayNamesettings": "Anonymous/rest/api/space/TEST/settings",
            "_expandablemetadata": {"",
                "operations": "",
            }
  "lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=TEST",
     },         "createdDatepermissions": "2018-12-08T13:14:16.076Z",
        "_expandable    "icon": {"",
            "lastUpdateddescription": "",
            "previousVersiontheme": "/rest/api/space/TEST/theme",
            "contributorshistory": "",
            "nextVersionhomepage": "/rest/api/content/13238386"
        },
        "_links": {
            "selfwebui": "https://thefreetelecomuni.spaces/TEST",
            "self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/contentspace/13238405/historyTEST"
        }
    },
    "versionhistory": {
        "bylatest": true,
        "createdBy": {
            "type": "anonymous",
            "profilePicture": {
                "path": "/wiki/s/-1234050512/6452/df79d7c6182c8a1ae71bb90a94d2018702e70afa/_/images/icons/profilepics/anonymous.png",
                "width": 48,
                "height": 48,
                "isDefault": true
            },
            "displayName": "Anonymous",
            "_expandable": {
                "operations": ""
            }
        },
        "whencreatedDate": "2018-12-08T13:14:16.076Z",
        "friendlyWhen_expandable": "just{
 a moment ago",         "messagelastUpdated": "",
            "numberpreviousVersion": 1,
        "minorEdit": false,
    
   "confRev": "confluence$content$13238405.2",         "_expandablecontributors": {
            "collaborators": "",
            "contentnextVersion": "/rest/api/content/13238405"
        },
        "_links": {
            "self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238405/version/1history"
        }
    },
    "ancestorsversion": [{
        "by": {
            "idtype": "13238386anonymous",
            "typeprofilePicture": "page",{
                "statuspath": "current",/wiki/s/-1234050512/6452/df79d7c6182c8a1ae71bb90a94d2018702e70afa/_/images/icons/profilepics/anonymous.png",
                "titlewidth": "test"48,
                "macroRenderedOutputheight": {}48,
                "extensionsisDefault": {true
            },
   "position": 1610612735             }"displayName": "Anonymous",
            "_expandable": {
                "childTypesoperations": "",
                "container": "/rest/api/space/TEST",}
         },
        "metadatawhen": "2018-12-08T13:14:16.076Z",
        "friendlyWhen": "just a moment ago",
        "operationsmessage": "",
        "number": 1,
       "children "minorEdit": false,
        "confRev": "/rest/api/content/13238386/childconfluence$content$13238405.2",
        "_expandable": {
      "restrictions      "collaborators": "/rest/api/content/13238386/restriction/byOperation",
                "historycontent": "/rest/api/content/13238386/history13238405",
        },
        "ancestors_links": "",
 {
              "bodyself": "",https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238405/version/1"
        }
    },
    "versionancestors": "", [
        {
            "descendantsid": "/rest/api/content/13238386/descendant",
   
            "spacetype": "/rest/api/space/TEST"page",
             }"status": "current",
            "_linkstitle": {
  "test",
             "selfmacroRenderedOutput": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238386"{},
                "tinyuiextensions": "/x/cgDK",{
                "edituiposition": "/pages/resumedraft.action?draftId=13238386",1610612735
            },
            "webui_expandable": "/spaces/TEST/overview"{
             }   "childTypes": "",
    }       ],     "container": {"/rest/api/space/TEST",
        "id": 13238319,         "keymetadata": "TEST",
        "name": "test",         "type"operations": "global",
        "status": "current",        "children": "history": {/rest/api/content/13238386/child",
                "createdByrestrictions": {"/rest/api/content/13238386/restriction/byOperation",
                "typehistory": "known/rest/api/content/13238386/history",
                "usernameancestors": "admin",
                "userKeybody": "8a7f808567194a3501671de3af320095",
                "accountIdversion": "557058:df961624-d453-4a63-922a-c947135a743b",
                "profilePicturedescendants": {"/rest/api/content/13238386/descendant",
                    "pathspace": "/wiki/aa-avatar/b9367cb79e7f68e074e75e375f80b718?s=48&d=https%3A%2F%2Fthefreetelecomuni.atlassian.net%2Fwiki%2Fimages%2Ficons%2Fprofilepics%2Fdefault.png%3FnoRedirect%3Dtrue",rest/api/space/TEST"
            },
       "width": 48,     "_links": {
                "heightself": 48,
  "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238386",
                 "isDefaulttinyui": false"/x/cgDK",
                }"editui": "/pages/resumedraft.action?draftId=13238386",
                "displayNamewebui": "Jean-luc KRIKER",/spaces/TEST/overview"
            }
   "_expandable": {    }
    ],
    "container": {
        "operationsid": ""13238319,
          "key": "TEST",
         "detailsname": "test",
        "type": "global",
          "personalSpacestatus": "current",
        "history": {
      },      "createdBy": {
          "_links": {      "type": "known",
                "selfusername": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/user?accountId=557058:df961624-d453-4a63-922a-c947135a743b"admin",
                }
  "userKey": "8a7f808567194a3501671de3af320095",
         },             "createdDate"accountId": "2018-12-08T06:44:35.315Z"
557058:df961624-d453-4a63-922a-c947135a743b",
       },         "_expandableprofilePicture": {
                    "settingspath": "/restwiki/api/space/TEST/settings",aa-avatar/b9367cb79e7f68e074e75e375f80b718?s=48&d=https%3A%2F%2Fthefreetelecomuni.atlassian.net%2Fwiki%2Fimages%2Ficons%2Fprofilepics%2Fdefault.png%3FnoRedirect%3Dtrue",
                    "metadatawidth": ""48,
            "operations        "height": ""48,
              "lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=TEST",      "isDefault": false
               "permissions": "" },
                "icondisplayName": "Jean-luc KRIKER",
            "description    "_expandable": "",{
                    "themeoperations": "/rest/api/space/TEST/theme",
            "homepage": "/rest/api/content/13238386"            },
"details": "",
       "_links": {             "webuipersonalSpace": "/spaces/TEST",
             "self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/space/TEST"  },
      }     },     "macroRenderedOutput_links": {},
    "body": {         "storage": {     "self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/user?accountId=557058:df961624-d453-4a63-922a-c947135a743b"
      "value": "<p>This is a new page from curl Linux<br /> a}
new page</p>",           },
 "representation": "storage",          "createdDate": "2018-12-08T06:44:35.315Z"
   "embeddedContent": [],    },
        "_expandable": {
                "contentsettings": "/rest/api/contentspace/TEST/13238405settings"
  ,
         }         },
        "_expandable"metadata": {"",
            "editoroperations": "",
            "atlas_doc_format"lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=TEST",
            "viewpermissions": "",
            "export_viewicon": "",
            "styled_viewdescription": "",
            "editor2theme": "/rest/api/space/TEST/theme",
            "anonymous_export_viewhomepage": "/rest/api/content/13238386"
        },
    },
    "extensions_links": {
            "positionwebui": 2013265919"/spaces/TEST",
    },        "_expandableself": {"https://thefreetelecomuni.atlassian.net/wiki/rest/api/space/TEST"
        "childTypes": "",}
    },
    "metadatamacroRenderedOutput": ""{},
        "operationsbody": "",{
        "childrenstorage": "/rest/api/content/13238405/child",{
            "restrictionsvalue": "/rest/api/content/13238405/restriction/byOperation",<p>This is a new page from curl Linux<br /> a new page</p>",
            "descendantsrepresentation": "/rest/api/content/13238405/descendant"storage",
    },        "_linksembeddedContent": { [],
            "editui_expandable": "/pages/resumedraft.action?draftId=13238405", {
                "webuicontent": "/spacesrest/TESTapi/pagescontent/13238405/page4",
          "context": "/wiki", }
       "self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238405" },
        "tinyui_expandable": "/x/hQDK",{
            "collectioneditor": "/rest/api/content",
            "baseatlas_doc_format": "https://thefreetelecomuni.atlassian.net/wiki"",
    } }
Code Block
titleon Windows Powershell
collapsetrue
 
C:\Users\jkriker>
 
curl
 
-Method
 
POST
 
-ContentType
 
'application/json' -Body '{"type":"page","title":"page7", >> "space":{"key":"TEST"},"body":{"storage":{"value":"<p>This is a new page from curl Linux<br/> a new page</p>","representation": >> "storage"}}}' https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/ StatusCode : 200 StatusDescription : OK Content : {"id":"13172807","type":"page","status":"current","title":"page7","space":{"id":13238319,"key":"TEST","name":"test","type":"global","s
 "view": "",
            "export_view": "",
            
tatus":"current","_expandable":{"settings":"/rest/api/space/TEST/s... RawContent
"styled_view": "",
       
:
 
HTTP/1.1
 
200
 
OK
  "editor2": "",
            "anonymous_export_view": ""
   
Vary:
 
Accept-Encoding
    }
    },
    "extensions": {
     
Strict-Transport-Security:
 
max-age=315360000;
 
includeSubDomains; preload
 "position": 2013265919
    },
    "_expandable": {
        
ATL-TraceId
"childTypes": 
8f579c96f93fecd7
"",
        "metadata": "",
        
X-XSS-Protection: 1; mode=block
"operations": "",
        "children": "/rest/api/content/13238405/child",
        
Transfer-Encoding: chu... Forms
"restrictions": "/rest/api/content/13238405/restriction/byOperation",
        "descendants": "/rest/api/content/13238405/descendant"
   
:
 
{
},
Headers
    "_links": {
     
:
 
{[Vary,
 
Accept-Encoding], [Strict-Transport-Security, max-age=315360000; includeSubDomains; preload], [ATL-TraceId
 "editui": "/pages/resumedraft.action?draftId=13238405",
        "webui": "/spaces/TEST/pages/13238405/page4",
        "context": 
8f579c96f93fecd7], [X-XSS-Protection, 1; mode=block]...} Images
"/wiki",
        "self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238405",
      
:
 
{} InputFields : {} Links
 "tinyui": "/x/hQDK",
        
: {} ParsedHtml
"collection": "/rest/api/content",
        "base": 
mshtml.HTMLDocumentClass RawContentLength : 4460
"https://thefreetelecomuni.atlassian.net/wiki"
    }
}