Campaign Folders
This chapter focuses on services for the campaign folders.
Get all campaign folders
A GET
to /campaign-folders
returns all the campaigns folders that the client is allowed to read.
HTTP request
GET /api/rest/latest/campaign-folders?page=1&size=3&page=1&size=3 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which attributes of the returned entities should be sorted on (optional) |
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1390
{
"_embedded" : {
"campaign-folders" : [ {
"_type" : "campaign-folder",
"id" : 100,
"name" : "qualification",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders/100"
}
}
}, {
"_type" : "campaign-folder",
"id" : 101,
"name" : "CP-18.01",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders/101"
}
}
}, {
"_type" : "campaign-folder",
"id" : 102,
"name" : "DX-U17",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders/102"
}
}
} ]
},
"_links" : {
"first" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders?page=0&size=3"
},
"prev" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders?page=0&size=3"
},
"self" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders?page=1&size=3"
},
"next" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders?page=2&size=3"
},
"last" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders?page=3&size=3"
}
},
"page" : {
"size" : 3,
"totalElements" : 10,
"totalPages" : 4,
"number" : 1
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements the client is allowed to read |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Get campaign folder
A GET
to /campaign-folders/{id}
returns the campaign folder with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the campaign case folder |
HTTP request
GET /api/rest/latest/campaign-folders/24 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1158
{
"_type" : "campaign-folder",
"id" : 24,
"name" : "old",
"project" : {
"_type" : "project",
"id" : 10,
"name" : "Mangrove",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/10"
}
}
},
"path" : "/Mangrove/old",
"parent" : {
"_type" : "project",
"id" : 10,
"name" : "Mangrove",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/10"
}
}
},
"created_by" : "User-1",
"created_on" : "2011-09-30T10:00:00Z",
"last_modified_by" : "admin",
"last_modified_on" : "2017-06-16T10:00:00Z",
"description" : "<p>where all the old campaigns go</p>",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders/24"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/10"
},
"content" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders/24/content"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders/24/attachments"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the entity |
|
|
the type of the entity |
|
|
name of the entity |
|
|
project of the entity |
|
|
the location of the entity (either a folder or the project if located at the root of the library) |
|
|
the path of the entity |
|
|
user that created the entity |
|
|
timestamp of the creation (ISO 8601) |
|
|
user that modified the entity the most recently |
|
|
timestamp of last modification (ISO 8601) |
|
|
description of that entity (html) |
|
|
the attachments of that entity |
|
|
related links |
Links
Relation | Description |
---|---|
|
the link to this folder |
|
the link to its project |
|
the link to its content |
|
the link to its attachments |
Get campaign folder contents
A GET
to /campaign-folders/{id}/content
returns the contents of the campaign folder with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the campaign-folder |
HTTP request
GET /api/rest/latest/campaign-folders/180/content HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which attributes of the returned entities should be sorted on (optional) |
|
which fields of the elements should be returned (optional) |
|
level of depth of the content that should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1006
{
"_embedded" : {
"content" : [ {
"_type" : "campaign",
"id" : 13,
"name" : "non regression",
"reference" : "",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/campaigns/13"
}
}
}, {
"_type" : "campaign",
"id" : 150,
"name" : "new features",
"reference" : "",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/campaigns/150"
}
}
}, {
"_type" : "campaign-folder",
"id" : 1467,
"name" : "non-standard environment acceptance tests",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders/1467"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/campaign-folders/180/content"
}
},
"page" : {
"size" : 20,
"totalElements" : 3,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements the client is allowed to read |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |