List connector fields
GET /teams/{teamId}/connectors/{connectorId}/fields
Returns the fields a connector exposes, split into dimensions and metrics. Each is an array of field groups, { groupId, groupName, fields }, where fields is a list of { id, queryId, name, description } entries. The response also has a rules array that says which fields you should not select together.
Pass one or more accountIds to additionally include the custom conversions (custom dimensions and metrics) defined on those accounts. For connectors without custom fields, accountIds has no effect.
To see which common fields a connector fills, use the common fields endpoint.
connectors:read · Rate limit: default (120 / 60s)This endpoint needs no team permission. The key holder must be a member of the team.
Path parameters
gadw). A value that is not a recognized connector returns 400 BAD_REQUEST.Query parameters
?accountIds=gadw_1234567890,gadw_2345678901. Up to 100 IDs, each up to 255 characters. Send each ID with or without the connector prefix: 1234567890 and gadw_1234567890 are the same account.accountIds. Omit it to get just the connector's built-in dimensions and metrics. Send the accounts you plan to query, so that their custom fields are in the list.Request
curl "https://api.twominutereports.com/v1/teams/0190f8b0-1a2b-7c3d-8e4f-5a6b7c8d9e0f/connectors/gadw/fields?accountIds=gadw_1234567890,gadw_2345678901" \
-H "Authorization: Bearer tmrc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Response
{
"success": true,
"data": {
"dimensions": [
{
"groupId": "campaign",
"groupName": "Campaign",
"fields": [
{ "id": "campaign_name", "queryId": "gadw_campaign_name", "name": "Campaign name", "description": "Group results by campaign name" }
]
},
{
"groupId": "time",
"groupName": "Time",
"fields": [
{ "id": "date", "queryId": "gadw_date", "name": "Date", "description": "Group results by Date" }
]
}
],
"metrics": [
{
"groupId": "performance",
"groupName": "Performance",
"fields": [
{ "id": "metrics_clicks", "queryId": "gadw_metrics_clicks", "name": "Clicks", "description": "The number of clicks" },
{ "id": "metrics_cost_micros", "queryId": "gadw_metrics_cost_micros", "name": "Amount spent" }
]
}
],
"rules": [
{
"ruleType": "FIELDS",
"rule": "SHOULD_NOT_SELECT_WITH",
"fieldA": ["week", "week_start_date"],
"fieldB": ["week_iso", "week_iso_start_date"]
}
]
}
}
{
"success": false,
"error": { "code": "BAD_REQUEST", "message": "Invalid connector ID: \"gads\"" }
}
{
"success": false,
"error": { "code": "UNAUTHORIZED", "message": "Invalid or expired session" }
}
Returned when the key holder is not a member of the team.
{
"success": false,
"error": { "code": "FORBIDDEN", "message": "Access denied" }
}
{
"success": false,
"error": { "code": "NOT_FOUND", "message": "No field metadata found for connector \"gadw\"" }
}
The field group object
Performance.id: the field ID inside this connector. Therulesarray refers to fields byid.queryId: the ID to send to run query. It is the connector ID, an underscore and theid. For example,idmetrics_clickshasqueryIdgadw_metrics_clicks.name: the display label.description: an optional field description.
The rules array
rules lists combinations of fields and groups that do not work together in one query. Each rule has a ruleType and a rule. The fields in a rule are id values, and the groups are groupId values. Use id here, not queryId.
ruleType | Keys | Meaning |
|---|---|---|
GROUPS | groupA, groupB | Relates the groups in groupA to the groups in groupB |
FIELDS | fieldA, fieldB | Relates the fields in fieldA to the fields in fieldB |
FIELDS_WITH_GROUPS | fields, groups | Relates the fields in fields to the groups in groups |
rule says how the two sides relate. The values are SHOULD_NOT_SELECT_WITH (do not select them together), REQUIRES (the first side needs the second) and CAN_ONLY_SELECT_WITH_METRICS (the first side only works with the listed metrics). A connector can return an empty rules array.
[
{ "ruleType": "GROUPS", "rule": "SHOULD_NOT_SELECT_WITH", "groupA": ["ad_group"], "groupB": ["budget"] },
{ "ruleType": "FIELDS", "rule": "SHOULD_NOT_SELECT_WITH", "fieldA": ["week", "week_start_date"], "fieldB": ["week_iso", "week_iso_start_date"] },
{ "ruleType": "FIELDS_WITH_GROUPS", "rule": "SHOULD_NOT_SELECT_WITH", "fields": ["month_name"], "groups": ["conversions"] }
]