Versions Compared

Key

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


https://jsoneditoronline.org/

https://jsonformatter.org/


PS 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



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:~$ curl -X POST -H 'Content-Type: application/json' -d '{": 200
StatusDescription : OK
Content           : {"id":"13172807","type":"page","status":"current","title":"page4",               page7","space":{"id":13238319,"key":"TEST","name":"test","type":"global","s
                                "space":{"key":"TEST"},"bodytatus":"current","_expandable":{"storagesettings":{"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
  % Total    % Received % Xferd  Average Speed   Time    Time"/rest/api/space/TEST/s...
RawContent        : HTTP/1.1 200 OK
                    Vary: Accept-Encoding
    Time  Current              Strict-Transport-Security: max-age=315360000; includeSubDomains; preload
                Dload   Upload ATL-TraceId: 8f579c96f93fecd7
Total   Spent    Left  Speed 100  4632    0  4460  100   172X-XSS-Protection: 1; mode=block
   4000    154  0:00:01  0:00:01 --:--:--  4154 {     "id": "13238405",
Transfer-Encoding: chu...
Forms    "type": "page",         "status": "current",{}
Headers     "title": "page4",     "space": {[Vary, Accept-Encoding], [Strict-Transport-Security, max-age=315360000; includeSubDomains; preload], [ATL-TraceId,
   "id": 13238319,         "key": "TEST",       8f579c96f93fecd7], [X-XSS-Protection, 1; mode=block]...}
Images  "name": "test",         "type": "global",
{}
InputFields        "status": "current",: {}
Links         "_expandable": {   : {}
ParsedHtml        "settings": "/rest/api/space/TEST/settings",
            "metadata: mshtml.HTMLDocumentClass
RawContentLength  : 4460

Code Block
titlepage
{
  "type": "page",
  "title": "page4",
  "space": {
    "key": "TEST"
  },
  "operationsbody": "",{
    "storage": {
      "lookAndFeelvalue": "/rest/api/settings/lookandfeel?spaceKey=TEST",
            "permissions": "",
 <p>This is a new page from curl Linux<br/> a new page</p>",
          "iconrepresentation": "storage",
    }
  }
}


Code Block
titlePOST HTTP REQUEST
collapsetrue
myplex@batpc2:~$ curl -X  "description": "",
            "theme": "/rest/api/space/TEST/themePOST -H 'Content-Type: application/json' -d '{"type":"page","title":"page4",             "history": "",                "homepage": "/rest/api/content/13238386"         },         "_linksspace": {
            "webui"key": "/spaces/TEST"},"body":{"storage":{"value":"<p>This is a new page from curl Linux<br/> a     "selfnew page</p>","representation":
"storage"}}}' https://thefreetelecomuni.atlassian.net/wiki/rest/api/spacecontent/TEST" | python3 -mjson.tool
  % Total    % }Received % Xferd  Average Speed  }, Time    Time  "history": {  Time  Current
    "latest": true,         "createdBy": {             "type": "anonymous",    Dload  Upload   Total   Spent "profilePicture": {  Left  Speed
100  4632    0  4460  100  "path": "/wiki/s/-1234050512/6452/df79d7c6182c8a1ae71bb90a94d2018702e70afa/_/images/icons/profilepics/anonymous.png", 172   4000    154  0:00:01  0:00:01 --:--:--  4154
{
    "widthid": 48"13238405",
    "type": "page",
    "status": "current",
    "heighttitle": 48"page4",
    "space": {
          "isDefaultid": true13238319,
        "key": "TEST",
     },   "name": "test",
        "displayNametype": "Anonymousglobal",
        "status": "current",
        "_expandable": {
                "operationssettings": "/rest/api/space/TEST/settings",
            }
"metadata": "",
       },         "createdDate"operations": "2018-12-08T13:14:16.076Z",
            "_expandablelookAndFeel": {"/rest/api/settings/lookandfeel?spaceKey=TEST",
            "lastUpdatedpermissions": "",
            "previousVersionicon": "",
            "contributorsdescription": "",
            "nextVersiontheme": "/rest/api/space/TEST/theme",
        },         "_linkshistory": {"",
            "selfhomepage": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238405/history13238386"
        }
,
   },     "version_links": {
            "bywebui": {"/spaces/TEST",
            "typeself": "anonymous",https://thefreetelecomuni.atlassian.net/wiki/rest/api/space/TEST"
        }
   "profilePicture": { },
    "history":  {
         "pathlatest": "/wiki/s/-1234050512/6452/df79d7c6182c8a1ae71bb90a94d2018702e70afa/_/images/icons/profilepics/anonymous.png"true,
                "width"createdBy": 48,
  {
             "heighttype": 48"anonymous",
                "isDefaultprofilePicture": true
      {
     },             "displayNamepath": "Anonymous",/wiki/s/-1234050512/6452/df79d7c6182c8a1ae71bb90a94d2018702e70afa/_/images/icons/profilepics/anonymous.png",
                "_expandablewidth": {48,
                "operationsheight": ""48,
                "isDefault": true
}            },
            "whendisplayName": "2018-12-08T13:14:16.076ZAnonymous",
        "friendlyWhen    "_expandable": "just a moment ago", {
                "messageoperations": "",
          "number": 1, }
       "minorEdit": false},
        "confRevcreatedDate": "confluence$content$13238405.22018-12-08T13:14:16.076Z",
        "_expandable": {
            "collaboratorslastUpdated": "",
            "contentpreviousVersion": "/rest/api/content/13238405"",
        },         "_linkscontributors": {"",
            "nextVersion": ""
        },
        "_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,
            "extensions": {   "isDefault": 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,
        "childrenminorEdit": "/rest/api/content/13238386/child"false,
        "confRev": "confluence$content$13238405.2",
        "restrictions_expandable": "/rest/api/content/13238386/restriction/byOperation",{
                "historycollaborators": "/rest/api/content/13238386/history",
                "ancestorscontent": "",/rest/api/content/13238405"
        },
        "body_links": "",{
                "version": "","self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238405/version/1"
        }
    },
    "descendantsancestors": "/rest/api/content/13238386/descendant", [
        {
            "spaceid": "/rest/api/space/TEST"13238386",
            },
"type": "page",
            "_linksstatus": {"current",
                "selftitle": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238386test",
                "tinyuimacroRenderedOutput": "/x/cgDK"{},
                "edituiextensions": "/pages/resumedraft.action?draftId=13238386",{
                "webuiposition": "/spaces/TEST/overview"1610612735
            },
        }     ],
    "container"_expandable": {
        "id": 13238319,         "keychildTypes": "TEST",
        "name": "test",         "typecontainer": "global/rest/api/space/TEST",
        "status": "current",         "historymetadata": {"",
            "createdBy": {   "operations": "",
                "typechildren": "known/rest/api/content/13238386/child",
                "usernamerestrictions": "admin/rest/api/content/13238386/restriction/byOperation",
                "userKeyhistory": "8a7f808567194a3501671de3af320095/rest/api/content/13238386/history",
                "accountIdancestors": "557058:df961624-d453-4a63-922a-c947135a743b",
                "profilePicturebody": {"",
                    "path"version": "",
                "descendants": "/rest/api/wikicontent/aa-avatar/b9367cb79e7f68e074e75e375f80b718?s=48&d=https%3A%2F%2Fthefreetelecomuni.atlassian.net%2Fwiki%2Fimages%2Ficons%2Fprofilepics%2Fdefault.png%3FnoRedirect%3Dtrue13238386/descendant",
                "space": "/rest/api/space/TEST"
  "width": 48,          },
            "height_links": 48,{
                    "isDefault": false"self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238386",
                 }"tinyui": "/x/cgDK",
                "displayNameeditui": "Jean-luc KRIKER/pages/resumedraft.action?draftId=13238386",
                "_expandablewebui": {"/spaces/TEST/overview"
            }
       "operations": "",
 }
    ],
    "container": {
          "id": 13238319,
        "detailskey": "TEST",
           "name": "test",
        "personalSpacetype": "global",
        "status": "current",
      },  "history": {
             "_linkscreatedBy": {
                    "selftype": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/user?accountId=557058:df961624-d453-4a63-922a-c947135a743b""known",
                "username": "admin",
  }               }"userKey": "8a7f808567194a3501671de3af320095",
                "createdDateaccountId": "2018-12-08T06:44:35.315Z"557058:df961624-d453-4a63-922a-c947135a743b",
        },          "_expandableprofilePicture": {
            "settings        "path": "/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",
             "metadata       "width": ""48,
            "operations        "height": ""48,
            "lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=TEST",        "isDefault": false
     "permissions": "",          },
  "icon": "",             "descriptiondisplayName": "Jean-luc KRIKER",
                "theme_expandable": "/rest/api/space/TEST/theme",{
                    "homepageoperations": "/rest/api/content/13238386""",
           },         "_linksdetails": { "",
                    "webuipersonalSpace": "/spaces/TEST",
             "self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/space/TEST"  },
      }     },     "macroRenderedOutput_links": {},
      "body": {              "storageself": {"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>"},
            "representationcreatedDate": "storage",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": "/pages/resumedraft.action?draftId=13238405",
        "webui": "/spaces/TEST/pages/13238405/page4",         "context": "/wiki",
        "self": "https://thefreetelecomuni.atlassian.net/wiki/rest/api/content/13238405",
        "tinyui": "/x/hQDK",
        "collection": "/rest/api/content",
        "base": "https://thefreetelecomuni.atlassian.net/wiki"
    }
}
Code Block
titleon Windows Powershell
collapsetrue
"_expandable": {
                "content": "/rest/api/content/13238405"
            }
        },
     
:
 
200
 
StatusDescription
 "_expandable": 
OK
{
Content
           
:
 
{"id":"13172807","type":"page","status":"current","title":"page7","space":{"id":13238319,"key":"TEST","name":"test","type":"global","s
"editor": "",
            "atlas_doc_format": "",
            
tatus
"view": "
current
",
            "export_
expandable
view":
{
 "
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"
    }
}