Manage data source logins
Data source logins are user authentications to the data source APIs.
List logins
GET
https://api.supermetrics.com/enterprise/v2/ds/logins
Response
Property | Type | Description |
meta > request_id | string | API request ID |
data | ds_login[] | Partial data source objects. See example for included properties. |
HTTP 200 OK
{
"meta": {
"request_id": "WnjTGeKqOXTnkZQMbZCfVMdmswv2wAzx"
},
"data": [
{
"@type": "ds_login",
"login_id": "dsl_1",
"login_type": "oauth",
"username": "info@supermetrics.com",
"display_name": "info@supermetrics.com",
"ds_info": {
"@type": "ds",
"ds_id": "AW",
"name": "Google Ads"
},
"auth_time": "2022-01-21T12:05:49+00:00",
"auth_user_info": {
"@type": "user",
"user_id": "usr_1",
"email": "info@supermetrics.com"
},
"expiry_time": null,
"revoked_time": null,
"is_refreshable": true,
"is_shared": true
}
]
}
Errors
Permissions
ds_logins_read
Get login
GET
https://api.supermetrics.com/enterprise/v2/ds/login/:login_id
-
login_id
string
Supermetrics login ID
Response
Property | Type | Description |
meta > request_id | string | API request ID |
data | ds_login | Data source login object |
HTTP 200 OK
{
"meta": {
"request_id": "WnjTGeKqOXTnkZQMbZCfVMdmswv2wAzx"
},
"data": [
{
"@type": "ds_login",
"login_id": "dsl_1",
"login_type": "oauth",
"username": "info@supermetrics.com",
"display_name": "info@supermetrics.com",
"ds_info": {
"@type": "ds",
"ds_id": "AW",
"name": "Google Ads"
},
"default_scopes": [
"email",
"https://adwords.google.com/api/adwords/",
"https://www.googleapis.com/auth/userinfo.email"
],
"additional_scopes": [],
"auth_time": "2022-01-21T12:05:49+00:00",
"auth_user_info": {
"@type": "user",
"user_id": "usr_1",
"email": "info@supermetrics.com"
},
"expiry_time": null,
"revoked_time": null,
"is_refreshable": true,
"is_shared": true
}
]
}
Errors
LOGIN_NOT_FOUND, LOGIN_SEARCH_FAILED
Permissions
ds_logins_read
Revoke login
DELETE
https://api.supermetrics.com/enterprise/v2/ds/login/:login_id
-
login_id
string
Supermetrics login ID
HTTP 200 OK
{
"meta": {
"request_id": "SDewAQBWCrdTBFyahLTrdyaUY5epvruN"
},
"data": {
"result": true
}
}
Errors
LOGIN_NOT_FOUND, LOGIN_REVOKE_FAILED
Permissions
ds_logins_write
List login accounts
GET
https://api.supermetrics.com/enterprise/v2/ds/login/:login_id/accounts
-
login_id
string
Supermetrics login ID
-
offset
int
Optional. Pagination offset for the number of accounts to return. Defaults to 0.
-
limit
int
Optional. Maximum number of accounts to return. Defaults to 100, maximum of 1000 is enforced.
Response
Property | Type | Description |
meta > request_id | string | API request ID |
meta > paginate > offset | int | Used pagination offset |
meta > paginate > limit | int | Used pagination limit |
meta > paginate > total | int | Total number of accounts available |
data | ds_account[] | Data source account objects |
HTTP 200 OK
{
"meta": {
"request_id": "cMvdUppkwqwanbjhhfSuZeRRFSjevq0K",
"paginate": {
"offset": 0,
"limit": 100,
"total": 2
}
},
"data": [
{
"@type": "ds_account",
"account_id": "35135152",
"name": "Website tracking",
"group": "Supermetrics MCC"
},
{
"@type": "ds_account",
"account_id": "2513515",
"name": "Application tracking",
"group": "Supermetrics MCC"
}
]
}
Errors
Permissions
ds_accounts_read
Object reference
ds_login
Property | Type | Description | ||||
login_id | string | Supermetrics login ID | ||||
login_type | string | Authentication type. Note that some data sources support multiple types, and user can choose between them.
| ||||
username | string | Authenticated username, used in queries as ds_user | ||||
display_name | string | Visible name for this authentication in product UIs | ||||
ds_info | ds | Authenticated data source | ||||
default_scopes | string[] | List of default source API scopes used in authentication | ||||
additional_scopes | string[] | List of additional source API scopes user has granted to access more data | ||||
auth_time | string | ISO 8601 datetime for when last user authentication occurred | ||||
auth_user_info | user | Supermetrics user who last authenticated | ||||
expiry_time | string | ISO 8601 datetime for when authentication expires, if any | ||||
revoked_time | string | ISO 8601 datetime for when authentication was revoked, if any | ||||
is_refreshable | bool | Whether authentication can be automatically refreshed after expiry time, without user involvement | ||||
is_shared | bool | Whether login is shared with all team users |
ds
Property | Type | Description |
ds_id | string | Data source ID. See data sources for more. |
name | string | Data source name |
ds_account
Property | Type | Description |
account_id | string | Data source account ID, as used in ds_accounts parameter |
name | string | Data source account name |
group | string | Group name for account in Supermetrics products |
user
Property | Type | Description |
user_id | string | Supermetrics user ID |
string | Supermetrics user email |
Errors
Status | Error | Description |
404 | LOGIN_NOT_FOUND | Requested data source login was not found. |
500 | LOGIN_SEARCH_FAILED | Failed to find data source logins due to an internal error. Please try again. |
Last updated 2022-09-20 UTC.