Respondido

ERRO NA API analitics


Tento fazer a solicitação porem me retorno esse erro no parâmetro {{interval}},

como deve ser configurado?

 

{
"method": "get",
"status": "failure",
"reason": {
"code": 61,
"description": "Informed interval type was not recognized. (Parameter 'value')"
},
"id": "64ca41687ebdf",
"from": "[email protected]/#msging-application-analytics-ldl49",
"to": "[email protected]/!msging-server-5pdvd-h0zc4q6n",
"metadata": {
"traceparent": "00-ea1e68648ee447b8996c2a6be4082772-fdd33e3460c1bd75-01",
"#command.uri": "lime://[email protected]/metrics/received-messages/last-7-days"
}
}

 

meu codigo

 

    public function get_dados_blip()
{
$contractId = env('BLIP_CONTRATO');
$yourToken = config('services.blip.token'); // Fetch token from config
$guid = uniqid(); // Gere um identificador exclusivo para $guid

$response = Http::withHeaders([
'Content-Type' => 'application/json',
'Authorization' => 'Key ' . $yourToken,
])->post("https://{$contractId}.http.msging.net/commands", [
'id' => $guid,
'to' => '[email protected]',
'method' => 'get',
'uri' => '/metrics/received-messages/last-7-days',
]);

return $response->json();
}

 

icon

Melhor resposta por Rafael_Figueiredo 2 August 2023, 14:36

Veja o original

2 comentários

Reputação 7
Crachá +3

Olá @iaguy2 tudo bem ? 

 

O problema é o intervalo, ele tem que ser descrito com date time exemplo : 

startDate=2023-07-26T00:00:00.000Z&endDate=2023-08-01T00:00:00.000Z

 

Olá @iaguy2 tudo bem ? 

 

O problema é o intervalo, ele tem que ser descrito com date time exemplo : 

startDate=2023-07-26T00:00:00.000Z&endDate=2023-08-01T00:00:00.000Z

 

Muito obrigado amigo, deu certo aqui

Comente