attempts

This deprecated metric returns a list of the attempted plays associated with the authenticating user's credentials.

Updated 2026-08-03 attempts

attempts

Deprecated: This API (insights/2.5) is deprecated and no longer supported. Only version 3.0 (insights/3.0) is supported. Use the Metrics V3 API Guide instead.

Gets a list of the attempted plays associated with the authenticating user's credentials.

Key:

attempts

Resource URI:

/metrics.json

Method:

GET

Query Parameters

Example Query String:

?metrics=attempts&filter_ids={{filter id}}&day={{day}}

Required:

  • metrics=attempts - Gets the number of attempts.
  • filter_ids={{filter_ids}} - The call must specify one or more comma-separated filter IDs. To get filter IDs, call the /filters endpoint.

Optional:

Specify one of the following time periods for historical data. No time parameter specifies live data.

  • day={{yyyy-mm-dd}}
  • month={{yyyy-mm}}
  • start_day={{yyyy-mm-dd}}&{{end_day=yyyy-mm-dd}}
  • start_time={{yyyy-mm-dd:hh}}&{{end_time=yyyy-mm-dd:hh}}

If you specify the current month, the period extends from the first day of the month to today or yesterday.

For an hourly range, specify both the start and end times including the hour of the beginning and ending day for which to return data.

Each API call returns up to 30 days of data.

Data is available for up to 13 months.

Note: The Experience Insights APIs return data in the time zone for the c3 account.

Example Request

Copy
  curl
  'https://api.conviva.com/insights/2.5/metrics.json?metrics=attempts&filter_ids={{filter_ids}}&day={{day}}' \
  -H 'Cache-Control: no-cache' \
  -u `client_ID:secret` \

Copy
import base64
import http.client

conn = http.client.HTTPSConnection("api.conviva.com")

encoded = b64encode(b"webapps").decode("ascii")
headers = {
    'Cache-Control': 'no-cache',
    'Authorization': 'Basic %s' % encoded
    }

api = "/insights/2.5/metrics.json"
query = "?metrics=attempts&filter_ids={{filter_ids}}&day={{day}}"
path = api + query
conn.request("GET", path, headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

Copy
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.conviva.com/insights/2.5/metrics.json?metrics=attempts&filter_ids={{filter_ids}}&day={{day}}");
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.setRequestHeader("Authorization", "Basic " + btoa("user@email.com:pass"));

xhr.send(data);

<?php

$request = new HttpRequest();
$request->setUrl('https://api.conviva.com/insights/2.5/metrics.json?metrics=attempts&filter_ids={{filter_ids}}&day={{day}}');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'account' => 'c3.Demo'
));

$request->setHeaders(array(
  'Cache-Control' => 'no-cache'
  'Authorization' => 'Basic'.base64_encode("$username:$password")
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

Copy
OkHttpClient client = new
OkHttpClient.Builder().authenticator(new Authenticator() {
    public Request authenticate(Route route, Response response) 
throws IOException {
        String credential = Credentials.basic(username, password);
        return 
response.request().newBuilder().header("Authorization", credential).build();
    }
}).build();

Request request = new Request.Builder()
  .url("https://api.conviva.com/insights/2.5/metrics.json?metrics=attempts&filter_ids={{filter_ids}}&day={{day}}")
  .get()
  .addHeader("Cache-Control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

Success Response

Response Code:

200

Response Type:

application/json

Response Description:

Live, Historical

Time Series

Returns JSON that lists the time series of attempts.

Example JSON Response

{
 "attempts": {
     "timestamps": [
         1518494400000,
         1518494700000,
         1518495000000
     ],
     "meta": {
         "status": 0
     },
     "type": "time_series",
     "filters": {
         "250": [
             5017,
             5251,
             4075
         ]
     }
 }
}

Common Error Responses

Code: 400 Bad request
Content: { reason : "At least one filter_id should be provided." }
Content: { reason : "The credentials you used are not valid. Please check your credentials and try again." }
Content: { reason : "Time range is not valid for metric <metric>. Invalid day format"}

Code: 401 UNAUTHORIZED
Content: { error : "Log in" }

Code: 422 UNPROCESSABLE ENTRY
Content: { error : "Email Invalid" }

Code: 429 Too Many Requests
Content: { error : "Too Many Requests" }

More Information

See Metrics.