> For the complete documentation index, see [llms.txt](https://ajuda.rnp.br/eduplay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajuda.rnp.br/eduplay/video-sob-demanda/manual-de-integracoes/envio-de-estatisticas-a-partir-de-player-externo/estatisticas-de-acesso-simultaneo-a-fluxos-ao-vivo.md).

# Estatísticas de acesso simultâneo a fluxos ao vivo

<mark style="color:green;">`POST`</mark> `https://eduplay.rnp.br/collector/accessManager`

#### Request Body

| Name                                               | Type    | Description                                                                                                                                                  |
| -------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| idContent<mark style="color:red;">\*</mark>        | String  | identificador numérico da transmissão, TV ou rádio                                                                                                           |
| retrieveInterval<mark style="color:red;">\*</mark> | Boolean | define quando é para retornar os valores mínimos e máximos a partir dos quais deve gerar o valor aleatório para envio da próxima chamada de estou assistindo |
| session<mark style="color:red;">\*</mark>          | String  | identificador da sessão do usuário que está assistindo o conteúdo ao vivo                                                                                    |
| type                                               | String  | definir qual tipo do conteúdo ao vivo.                                                                                                                       |

Os valores possíveis para o parâmetro <mark style="color:red;">`type`</mark> do corpo da requisição são:

* <mark style="color:red;">`transmission`</mark>: para definir que é um fluxo de vídeo ao vivo
* <mark style="color:red;">`channel`</mark>: para definir que é um fluxo de TV ou rádio
* <mark style="color:red;">`audio`</mark>: para definir que é um fluxo de áudio ao vivo

O corpo da requisição deve ser enviado no formato json. Exemplo:

```json
{
    "session":"xpto",
    "idContent":"176611",
    "type":"channel",
    "retrieveInterval":true
}
```

A resposta da requisição também será no formato json:

```json
{
    "success":true,
    "error":"",
    "live":41,
    "minInterval":60000,
    "maxInterval":600000
}
```

em que:

* <mark style="color:red;">`success`</mark>: flag para informar se o registro do acesso foi realizado com sucesso;
* <mark style="color:red;">`error`</mark>: em caso de erro no registro, nesse campo é enviado detalhes do erro quando existir;
* <mark style="color:red;">`live`</mark>: audiência do fluxo ao vivo no momento
* <mark style="color:red;">`minInterval`</mark> e <mark style="color:red;">`maxInterval`</mark>: são os valores mínimos e máximos, em milissegundos, dentro do qual deve ser definido um instante aleatório para agendar o próximo envio da informação que o usuário está assistindo. Esses valores são retornados apenas se na requisição foi definido o <mark style="color:red;">`retrieveInterval`</mark> for igual a true.
  * **IMPORTANTE:** os valores de mínimo e máximo são configurações que raramente mudam e por isso ficam cacheadas na aplicação de coleta de estatísticas. Dessa forma, não é necessário solicitar esse valor em todas as requisições. Seria suficiente buscar apenas uma vez para a sessão do usuário e armazenar temporariamente no cliente para uso nas próximas requisições.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ajuda.rnp.br/eduplay/video-sob-demanda/manual-de-integracoes/envio-de-estatisticas-a-partir-de-player-externo/estatisticas-de-acesso-simultaneo-a-fluxos-ao-vivo.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
