Back to Collection Items
var
http: HCkHttp;
success: Boolean;
json: HCkJsonObject;
resp: HCkHttpResponse;
begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http := CkHttp_Create();
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {}
json := CkJsonObject_Create();
CkHttp_SetRequestHeader(http,'Content-Type','application/json');
resp := CkHttp_PostJson3(http,'https://your-domain.atlassian.net/wiki/rest/atlassian-connect/1/app/module/dynamic','application/json',json);
if (CkHttp_getLastMethodSuccess(http) = False) then
begin
Memo1.Lines.Add(CkHttp__lastErrorText(http));
Exit;
end;
Memo1.Lines.Add(IntToStr(CkHttpResponse_getStatusCode(resp)));
Memo1.Lines.Add(CkHttpResponse__bodyStr(resp));
CkHttpResponse_Dispose(resp);
CkHttp_Dispose(http);
CkJsonObject_Dispose(json);
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": ""
}
]
}