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
PropertyTypeDescription
meta > request_idstring API request ID
datads_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

LOGIN_SEARCH_FAILED

Permissions

ds_logins_read


Get login

GET https://api.supermetrics.com/enterprise/v2/ds/login/:login_id
  • login_id string
    Supermetrics login ID
Response
PropertyTypeDescription
meta > request_idstring API request ID
datads_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


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
PropertyTypeDescription
meta > request_idstring API request ID
meta > paginate > offsetint Used pagination offset
meta > paginate > limitint Used pagination limit
meta > paginate > totalint Total number of accounts available
datads_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

LOGIN_NOT_FOUND

Permissions

ds_accounts_read


Object reference

ds_login
PropertyTypeDescription
login_idstring Supermetrics login ID
login_typestring
Authentication type. Note that some data sources support multiple types, and user can choose between them.
oauthLogin uses oAuth credentials
loginLogin uses another type of credentials, e.g. API key
usernamestring Authenticated username, used in queries as ds_user
display_namestring Visible name for this authentication in product UIs
ds_infods Authenticated data source
default_scopesstring[] List of default source API scopes used in authentication
additional_scopesstring[] List of additional source API scopes user has granted to access more data
auth_timestring ISO 8601 datetime for when last user authentication occurred
auth_user_infouser Supermetrics user who last authenticated
expiry_timestring ISO 8601 datetime for when authentication expires, if any
revoked_timestring ISO 8601 datetime for when authentication was revoked, if any
is_refreshablebool Whether authentication can be automatically refreshed after expiry time, without user involvement
is_sharedbool Whether login is shared with all team users

ds
PropertyTypeDescription
ds_idstring Data source ID. See data sources for more.
namestring Data source name

ds_account
PropertyTypeDescription
account_idstring Data source account ID, as used in ds_accounts parameter
namestring Data source account name
groupstring Group name for account in Supermetrics products

user
PropertyTypeDescription
user_idstring Supermetrics user ID
emailstring Supermetrics user email

Errors

StatusErrorDescription
404LOGIN_NOT_FOUNDRequested data source login was not found.
500LOGIN_SEARCH_FAILEDFailed to find data source logins due to an internal error. Please try again.
Last updated 2022-09-20 UTC.