ο»Ώ[8x8 Work Analytics Historical](πŸ”—ο»Ώ) access is via this multi step process. For any of the endpoints the same process is followed.

You will need a working API key to begin

You can generate API credentials from [How to get API Keys](πŸ”—ο»Ώ)ο»Ώ

The `8x8-api-key` will be the `Key` generated. For Work Analytics the Secret from Admin Console is not required.

Use the following base URL during this process:

  • `https://api.8x8.com/analytics/work`

# 1. Authenticate to retrieve access token

You will use your API key combined with the user credentials of a user with permission and access to Work Analytics to authenticate, this user **does not need to be** the one who generated the API credentials

User must access Analytics at least once via browser

The users credentials will not be able to leverage the API until they have used Work Analytics via browser at least once

## Parameters

**Method: POST**

#### Headers

NameRequiredDescriptionExample
8x8-apikeyβœ“The 8x8-api key providedtest_key_kjdfidj238jf9123df221
Content-Typeβœ“Set content type to form-urlencodedapplication/x-www-form-urlencoded

#### Body

NameRequiredDescriptionExample
usernameβœ“The 8x8 username of a user with Work Analytics access privileges[email protected]
passwordβœ“The 8x8 password of the user with Work Analytics access privilegesRrnp5QBW6dTbx^TP

### Authentication Request:

ο»Ώ

### Authentication Response:

**Response**

ο»Ώ

**Outputs For Next Step:**

  • access_token

  • expires_in

The token will expire in the number of seconds specified in expires_in.

The following steps will use the access_token as a Bearer Token form of authentication. This takes the form of the `Authorization` header being set to `Bearer access_token` (Space between Bearer and the access_token)

## 2. Run Report

### Parameters

**Method:** GET

#### Headers

NameRequiredDescriptionExample
8x8-apikeyβœ“The 8x8-api key providedtest_key_kjdfidj238jf9123df221
Authorizationβœ“Pass the access_token returned from the authentication request as a Bearer token `Bearer {access_token}`Bearer eyJhbGciOiJSUzI1NiJ9.yyyyyyyy.zzzzzzzzzz

#### Path

NameRequiredDescriptionExample
versionβœ“The current version for company summary is v1v1

#### Query

NameRequiredDescriptionExample
pbxIdβœ“Pass the pbxId (PBX Name) of the requested pbx or comma separated list of pbxIds or `allpbxes` for all of the pbxs in the customer account. PBX names can be found [here in Admin Console](πŸ”—ο»Ώ)ο»Ώacmecorp,acmecorp2
startTimeβœ“The interval start time for CDR searches - the format is YYYY-MM-DD HH:MM:SS.2022-10-20 08:30:00
endTimeβœ“The interval end time for CDR searches - the format is YYYY-MM-DD HH:MM:SS.2022-10-20 19:00:00
timeZoneβœ“ο»Ώ[IANA Time Zones](πŸ”—ο»Ώ). Examples America/New_York, Europe/London [Wikipedia Time Zone List](πŸ”—ο»Ώ)ο»ΏAmerica/New_York

### Company Summary Request

Try out the Company Summary

You can try the company summary API from the [reference](πŸ”—ο»Ώ)ο»Ώ

ο»Ώ

### Company Summary Response

For details on the company summary metrics please refer to [Company Summary Glossary](πŸ”—ο»Ώ)ο»Ώ

Durations are in milliseconds

ο»Ώ