Calculate widget positioning
Endpoint
/o/content/iframeDim
Ⓔ Enterprise Only
This API is available exclusively in Countly Enterprise.
Overview
Calculates widget geometry for one or more device inputs.
Authentication
- Authentication methods:
- API Key (parameter):
api_key=YOUR_API_KEY - Auth Token (parameter):
auth_token=YOUR_AUTH_TOKEN - Auth Token (header):
countly-token: YOUR_AUTH_TOKEN
- API Key (parameter):
Permissions
- Required permission:
Readon thecontentfeature
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes (or auth_token) | API key for authentication |
| auth_token | String | Yes (or api_key) | Auth token for authentication |
| app_id | String | Yes | Application identifier |
| devices | String | Yes | JSON stringified array of device definitions |
devices object format before stringifying:
[
{
"resolution": {
"width": 1920,
"height": 1080
},
"position": "bRight",
"type": "modal",
"heightMultiplier": 0.8,
"fullScreenOverride": false
}
]
Response
Success Response
[
{
"x": 100,
"y": 200,
"ww": 800,
"wh": 400,
"maxAllowedHeight": 600,
"baseHeight": 400
}
]
Response Fields
| Field | Type | Description |
|---|---|---|
| x | Number | X coordinate |
| y | Number | Y coordinate |
| ww | Number | Widget width |
| wh | Number | Widget height |
| maxAllowedHeight | Number | Max allowed height for layout |
| baseHeight | Number | Base height used in sizing |
Error Responses
| HTTP Status | Response |
|---|---|
| 400 | "Missing devices array object parameter" |
| 400 | "Missing resolution parameter" |
| 400 | "Missing position parameter" |
| 400 | "Missing type parameter" |
| 400 | "Invalid pos request" or underlying error message |
Behavior/Processing
- Parses
devicesJSON payload. - Validates each device has
resolution,position, andtype. - Computes geometry for each item and returns output array in matching order.
Database Collections
This endpoint does not read or write database collections.
Examples
Example 1: Single Device Calculation
/o/content/iframeDim?api_key=YOUR_API_KEY&app_id=5be987d7b93798516eb5289a&devices=<JSON_STRING>
devices object before stringifying:
[
{
"resolution": {
"width": 390,
"height": 844
},
"position": "center",
"type": "modal",
"heightMultiplier": 1,
"fullScreenOverride": false
}
]
Example 2: Multi-Device Preview Calculation
/o/content/iframeDim?api_key=YOUR_API_KEY&app_id=5be987d7b93798516eb5289a&devices=<JSON_STRING>
devices object before stringifying:
[
{
"resolution": {
"width": 390,
"height": 844
},
"position": "center",
"type": "modal"
},
{
"resolution": {
"width": 1280,
"height": 800
},
"position": "bRight",
"type": "banner",
"heightMultiplier": 0.8
}
]
Related Endpoints
- Content Blocks - Create: Create content with placement settings
- Content Blocks - Update: Update content with placement settings
Ⓔ Enterprise
This feature is part of Countly Enterprise.
Get Access:
Already a Customer? Use support portal if you have any questions
Last Updated
2026-02-16