Skip to content

Account and sessions#

Four actions read account information and the running Viewer sessions: profileGet, uaGet, sessionIPs, sessionCount. All four are read-only, change nothing, and accept both GET and POST.

profileGet#

GET https://dash.9hits.com/api/profileGet?key=YOUR_API_KEY

No parameters. Returns information about the account that owns the API key.

{
    "status": "ok",
    "messages": null,
    "data": {
        "username": "daniel",
        "email": "[email protected]",
        "joined": "2015-02-21 15:32:44",
        "token": "1a8cb897ca8b97c897c98a7cbd880123",
        "funds": 38.288,
        "slots": {
            "used": 5,
            "available": 78
        },
        "points": 803.57,
        "membership": "VIP",
        "membershipEndDate": "2021-01-31 22:03:27"
    }
}
  • token is the App token, that is, the access key the Viewer app uses to log in. It is not the API key.
  • slots.used is the number of campaigns you have now, slots.available is the total number of available slots.
  • membershipEndDate can be null, for example for a REGULAR account.

uaGet#

GET https://dash.9hits.com/api/uaGet?key=YOUR_API_KEY

No parameters. Returns your custom user-agent groups. Use id as value in platform.custom when calling siteAdd/siteUpdate (see platform).

{
    "status": "ok",
    "messages": ["Fetched 2"],
    "data": [
        { "id": 743, "title": "My Customize Firefox" },
        { "id": 2467, "title": "iPhone6" }
    ]
}

sessionIPs#

GET https://dash.9hits.com/api/sessionIPs?key=YOUR_API_KEY

No parameters. data is an array with the IPs of all running Viewer sessions on your account, on every machine.

{
    "status": "ok",
    "messages": null,
    "data": ["203.0.113.10", "203.0.113.24", "198.51.100.7"]
}

sessionCount#

GET https://dash.9hits.com/api/sessionCount?key=YOUR_API_KEY

Optional parameter ip: count only the sessions running on the machine with this real IP. Without it, all sessions are counted.

GET https://dash.9hits.com/api/sessionCount?key=YOUR_API_KEY&ip=198.51.100.7

data is an integer, not an object:

{
    "status": "ok",
    "messages": null,
    "data": 3
}