Context
Description
Contexts are used to represent the logical campaign placement
Fields
Name | Description | Type | Supported Methods |
---|---|---|---|
id | Id of the context node. | string | GET |
type | Type of the context node. | string | GET |
path | Path of the context node ib the context tree. | string | GET |
schema | Json string containing values used when rendering context node. | string | GET |
customData | Json string containing values used for filtering context nodes in request. | string | GET |
children | Collection of children context nodes. | array of contextNode | GET |
Get by Id
Get context node selectable by an id value and it's children to given depth.
Endpoint
GET https://api.crowdmanager.io/v2/{organization-id}/mypage/contexts/{id}
:::warning
The endpoint uses application/json
content type instead of application/vnd.api+json
used by most other endpoints in the API. The Accept
header is entirely optional.
:::
QUERY Parameters
Name | Description | Required |
---|---|---|
depth | Depth of the children nodes to be included into the response. Lack of this parameters will return whole tree from selected node. | False |
Example
Request
GET https://api.crowdmanager.io/v2/1201/mypage/contexts/MyPage
Authorization: Basic aaabbbccc111222333
Response
{
"id":"MyPage",
"type":"mypage",
"tenantId":102,
"schema":"{}",
"customData":null,
"path":"MyPage",
"isRoot":true,
"parent":null,
"children":[
{
"id":"FanBattle",
"type":"tab",
"tenantId":102,
"schema":"{\"label\": \"Fan Battle\"}",
"customData":"{\"id\": 1}",
"path":"MyPage.FanBattle",
"isRoot":false,
"children":[
{
"id":"Rounds",
"type":"carousel",
"tenantId":102,
"schema":"{\"defaultStrategy\": \"earliestDateInTheFuture\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds",
"isRoot":false,
"children":[
{
"id":"Round1",
"type":"carouselItem",
"tenantId":102,
"schema":"{\"date\": \"2022-01-01\", \"label\": \"Round1\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds.Round1",
"isRoot":false,
"children":[
]
},
{
"id":"Round2",
"type":"carouselItem",
"tenantId":102,
"schema":"{\"date\": \"2022-02-01\", \"label\": \"Round2\"}",
"customData":"{\"id\": 1}",
"path":"MyPage.FanBattle.Rounds.Round2",
"isRoot":false,
"children":[
{
"id":"GTO",
"type":"campaign",
"tenantId":102,
"schema":"{\"url\": \"https://...\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds.Round2.GTO",
"isRoot":false,
"children":[
]
},
{
"id":"GTI",
"type":"campaign",
"tenantId":102,
"schema":"{\"url\": \"https://...\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds.Round2.GTI",
"isRoot":false,
"children":[
]
}
]
}
]
},
{
"id":"KQ1",
"type":"campaign",
"tenantId":102,
"schema":"{\"url\": \"https://...\"}",
"customData":null,
"path":"MyPage.FanBattle.KQ1",
"isRoot":false,
"children":[
]
}
]
}
]
}
Request
GET https://api.crowdmanager.io/v2/1201/mypage/contexts/MyPage?depth=1
Authorization: Basic aaabbbccc111222333
Response
{
"id":"MyPage",
"type":"mypage",
"tenantId":102,
"schema":"{}",
"customData":null,
"path":"MyPage",
"isRoot":true,
"parent":null,
"children":[
{
"id":"FanBattle",
"type":"tab",
"tenantId":102,
"schema":"{\"label\": \"Fan Battle\"}",
"customData":"{\"id\": 1}",
"path":"MyPage.FanBattle",
"isRoot":false,
"children":[
]
}
]
}
Get by Field
Get context node selectable by an field stored in CustomData json and it's children to given depth.
Endpoint
GET https://api.crowdmanager.io/v2/{organization-id}/mypage/context
:::warning
The endpoint uses application/json
content type instead of application/vnd.api+json
used by most other endpoints in the API. The Accept
header is entirely optional.
:::
QUERY Parameters
Name | Description | Required |
---|---|---|
fieldType | Name of the field in CustomData json object. | True |
fieldValue | Name of the field in CustomData json object. | True |
depth | Depth of the children nodes to be included into the response. Lack of this parameters will return whole tree from selected node. | False |
Request
GET https://api.crowdmanager.io/v2/1201/mypage/contexts/MyPage?fieldName=id&fieldValue=1
Authorization: Basic aaabbbccc111222333
Response
[
{
"id":"FanBattle",
"type":"tab",
"tenantId":102,
"schema":"{\"label\": \"Fan Battle\"}",
"customData":"{\"id\": 1}",
"path":"MyPage.FanBattle",
"isRoot":true,
"parent":null,
"children":[
{
"id":"Rounds",
"type":"carousel",
"tenantId":102,
"schema":"{\"defaultStrategy\": \"earliestDateInTheFuture\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds",
"isRoot":false,
"children":[
{
"id":"Round1",
"type":"carouselItem",
"tenantId":102,
"schema":"{\"date\": \"2022-01-01\", \"label\": \"Round1\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds.Round1",
"isRoot":false,
"children":[
]
},
{
"id":"Round2",
"type":"carouselItem",
"tenantId":102,
"schema":"{\"date\": \"2022-02-01\", \"label\": \"Round2\"}",
"customData":"{\"id\": 1}",
"path":"MyPage.FanBattle.Rounds.Round2",
"isRoot":true,
"children":[
{
"id":"GTO",
"type":"campaign",
"tenantId":102,
"schema":"{\"url\": \"https://...\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds.Round2.GTO",
"isRoot":false,
"children":[
]
},
{
"id":"GTI",
"type":"campaign",
"tenantId":102,
"schema":"{\"url\": \"https://...\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds.Round2.GTI",
"isRoot":false,
"children":[
]
}
]
}
]
},
{
"id":"KQ1",
"type":"campaign",
"tenantId":102,
"schema":"{\"url\": \"https://...\"}",
"customData":null,
"path":"MyPage.FanBattle.KQ1",
"isRoot":false,
"children":[
]
}
]
},
{
"id":"Round2",
"type":"carouselItem",
"tenantId":102,
"schema":"{\"date\": \"2022-02-01\", \"label\": \"Round2\"}",
"customData":"{\"id\": 1}",
"path":"MyPage.FanBattle.Rounds.Round2",
"isRoot":true,
"parent":{
"id":"Rounds",
"type":"carousel",
"tenantId":102,
"schema":"{\"defaultStrategy\": \"earliestDateInTheFuture\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds",
"isRoot":false,
"parent":{
"id":"FanBattle",
"type":"tab",
"tenantId":102,
"schema":"{\"label\": \"Fan Battle\"}",
"customData":"{\"id\": 1}",
"path":"MyPage.FanBattle",
"isRoot":true,
"parent":null,
"children":[
{
"id":"KQ1",
"type":"campaign",
"tenantId":102,
"schema":"{\"url\": \"https://...\"}",
"customData":null,
"path":"MyPage.FanBattle.KQ1",
"isRoot":false,
"children":[
]
}
]
},
"children":[
{
"id":"Round1",
"type":"carouselItem",
"tenantId":102,
"schema":"{\"date\": \"2022-01-01\", \"label\": \"Round1\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds.Round1",
"isRoot":false,
"children":[
]
}
]
},
"children":[
{
"id":"GTO",
"type":"campaign",
"tenantId":102,
"schema":"{\"url\": \"https://...\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds.Round2.GTO",
"isRoot":false,
"children":[
]
},
{
"id":"GTI",
"type":"campaign",
"tenantId":102,
"schema":"{\"url\": \"https://...\"}",
"customData":null,
"path":"MyPage.FanBattle.Rounds.Round2.GTI",
"isRoot":false,
"children":[
]
}
]
}
]