We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

How to retrieve the device and browser information of a user's registration via API?

We currently don't have a Piano dashboard report available that would contain this information for all registered users.

But we have an API endpoint, which response contains the information about the user agent that was present during the Identity Management user registration.

Potentially, you could create a custom script that would loop through all your registered users and obtain this information.

Below is a sample curl request for your test user with a redacted API token.

curl --location --request GET 'https://api.piano.io/id/api/v1/publisher/audit/user?aid=<AID>&amp;api_token=<api_token>&amp;uid=<UID>&amp;action_type=REGISTERED' \
--header 'api_token: <YOUR_API_TOKEN>' \

And the response would look like this:

{
 "data": [
        {
 "aid": "<AID>",
 "entity_type": "USER",
 "entity_id": "<UID>",
 "action_type": "REGISTERED",
 "actor_id": "<UID>",
 "actor_type": "CUSTOMER",
 "country": "United Kingdom",
 "city": "London",
 "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Mobile/15E148 Safari/604.1",
 "ip_address": "<IP_ADDRESS>",
 "date": "2022-01-06 13:08:09",
 "changes": []
        }
    ],
 "offset": 0,
 "limit": 1,
 "total": 1
}

You can parse the user agent value from the response to get the device or browser information.

More documentation about this API endpoint is available under the following link.

Last updated: