Back to Collection Items
Use ChilkatAx-9.5.0-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vJson
Handle hoJson
Variant vResp
Handle hoResp
String sTemp1
Integer iTemp1
Boolean bTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {}
Get Create (RefClass(cComChilkatJsonObject)) To hoJson
If (Not(IsComObjectCreated(hoJson))) Begin
Send CreateComObject of hoJson
End
Send ComSetRequestHeader To hoHttp "Content-Type" "application/json"
Get pvComObject of hoJson to vJson
Get ComPostJson3 Of hoHttp "https://your-domain.atlassian.net/wiki/rest/atlassian-connect/1/app/module/dynamic" "application/json" vJson To vResp
If (IsComObject(vResp)) Begin
Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
Set pvComObject Of hoResp To vResp
End
Get ComLastMethodSuccess Of hoHttp To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComStatusCode Of hoResp To iTemp1
Showln iTemp1
Get ComBodyStr Of hoResp To sTemp1
Showln sTemp1
Send Destroy of hoResp
End_Procedure
Curl Command
curl -X POST
-H "Content-Type: application/json"
-d '"<object>"'
https://your-domain.atlassian.net/wiki/rest/atlassian-connect/1/app/module/dynamic
Postman Collection Item JSON
{
"name": "Register modules",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "\"<object>\""
},
"url": {
"raw": "{{baseUrl}}/atlassian-connect/1/app/module/dynamic",
"host": [
"{{baseUrl}}"
],
"path": [
"atlassian-connect",
"1",
"app",
"module",
"dynamic"
]
},
"description": "Registers a list of modules. For the list of modules that support dynamic registration, see [Dynamic modules](https://developer.atlassian.com/cloud/confluence/dynamic-modules/).\n\n**[Permissions](#permissions) required:** Only Connect apps can make this request."
},
"response": [
{
"name": "Returned if the request is successful.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"webItems\": [\n {\n \"key\": \"my-webitem\",\n \"location\": \"system.admin/globalsettings\",\n \"url\": \"/my-web-item\",\n \"name\": {\n \"value\": \"My Web Item\"\n }\n }\n ],\n \"adminPages\": [\n {\n \"key\": \"my-admin-page\",\n \"name\": {\n \"value\": \"My Admin Page\"\n },\n \"url\": \"/my-admin-page\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/atlassian-connect/1/app/module/dynamic",
"host": [
"{{baseUrl}}"
],
"path": [
"atlassian-connect",
"1",
"app",
"module",
"dynamic"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Returned if:\n* any of the provided modules is invalid. For example, required properties are missing.\n* any of the modules conflict with registered dynamic modules or modules defined in the app descriptor. For example, there are duplicate keys.\n\nDetails of",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"webItems\": [\n {\n \"key\": \"my-webitem\",\n \"location\": \"system.admin/globalsettings\",\n \"url\": \"/my-web-item\",\n \"name\": {\n \"value\": \"My Web Item\"\n }\n }\n ],\n \"adminPages\": [\n {\n \"key\": \"my-admin-page\",\n \"name\": {\n \"value\": \"My Admin Page\"\n },\n \"url\": \"/my-admin-page\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/atlassian-connect/1/app/module/dynamic",
"host": [
"{{baseUrl}}"
],
"path": [
"atlassian-connect",
"1",
"app",
"module",
"dynamic"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "*/*"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Returned if the call is not from a Connect app.",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"webItems\": [\n {\n \"key\": \"my-webitem\",\n \"location\": \"system.admin/globalsettings\",\n \"url\": \"/my-web-item\",\n \"name\": {\n \"value\": \"My Web Item\"\n }\n }\n ],\n \"adminPages\": [\n {\n \"key\": \"my-admin-page\",\n \"name\": {\n \"value\": \"My Admin Page\"\n },\n \"url\": \"/my-admin-page\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/atlassian-connect/1/app/module/dynamic",
"host": [
"{{baseUrl}}"
],
"path": [
"atlassian-connect",
"1",
"app",
"module",
"dynamic"
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "*/*"
}
],
"cookie": [
],
"body": ""
}
]
}