Use this endpoint to get all ad accounts' IDs and names of each organization, grouped by organization ID and organization name. The users should only be able to get the list of ad accounts that they have access to.
Request
End Point https://business.newsbreak.com/business-api/v1/ad-account/getGroupsByOrgIds
Method GET
Header
| Field | Required | Data Type | Description |
|---|---|---|---|
| Access-Token | Y | string | Authorized access token. |
Request Parameters
| Field | Required | Data Type | Description |
|---|---|---|---|
| orgIds | Y | string[] | IDs of organizations. |
Example
curl --location --request GET 'https://business.newsbreak.com/business-api/v1/ad-account/getGroupsByOrgIds?orgIds=123&orgIds=234' \
-H 'Content-Type: application/json' \
-H 'Access-Token:{{Access-Token}}'
Response
Response Parameters
| Field | Data Type | Description |
|---|---|---|
| code | int | Status code, see Return Codes |
| errMsg | string | Error message when code!=0 |
| data | object | Response object. |
| └── list | object[] | Each row is an organization. |
| └── id | string | Organization ID |
| └── name | string | Organization name |
| └── adAccounts | object[] | Each row is an ad account. |
| └── id | string | Ad account ID |
| └── name | string | Ad account name |
| └── createTime | string | Create time of the ad account |
Example
{
"code": 0,
"data": {
"list": [
{
"id": "123",
"name": "my organization example 1",
"adAccounts": [
{
"id": "123456",
"name": "my ad account example 1",
"createTime": "1700000000"
},
{
"id": "234567",
"name": "my ad account example 2",
"createTime": "1710000000"
}
]
},
{
"id": "234",
"name": "my organization example 2",
"adAccounts": [
{
"id": "345678",
"name": "my ad account example 3",
"createTime": "1650000000"
}
]
}
]
}
}