Metric logs
You can create metric logs without sending a notification. This can be helpfull when you have so many conversions that the notifications are just to much, of if you want to import historic data in to the dashboard.
The metric model
The metric model contains all the information about the metric you want to update.
Properties
- Name
metrics
- Type
- array
- Description
An array of all the metrics you wish to create a log for
- Name
metrics.*.id
- Type
- int
- Description
Unique identifier the metric. This can be found in your dashboard panel.
- Name
metrics.*.data.quantity
- Type
- int|float
- Description
I you have a counter metric, you should add the quantity parameter.
- Name
metrics.*.data.value
- Type
- int|float
- Description
I you have a value metric, you should add the value parameter.
- Name
metrics.*.created_at
- Type
- timestamp
- Description
The date on with this metric should be created at. If you leave this blank we will use the current datetime.
Create a Metric Log entry
This endpoint allows you to create new metric log entries. See the code examples for how to send the file to the Notifly API.
Required attributes
- Name
metrics
- Type
- array
- Description
An array of all the metrics you wish to create a log for
- Name
metrics.*.id
- Type
- int
- Description
Unique identifier the metric. This can be found in your dashboard panel.
- Name
metrics.*.data.quantity
- Type
- int|float
- Description
I you have a counter metric, you should add the quantity parameter. The quantity field, or the value field is required in this request.
- Name
metrics.*.data.value
- Type
- int|float
- Description
I you have a value metric, you should add the value parameter. The quantity field, or the value field is required in this request.
Optional attributes
- Name
metrics.*.created_at
- Type
- timestamp
- Description
The date on with this metric should be created at. If you leave this blank we will use the current datetime.
Request
$response = Http::withToken('YOUR BEARER TOKEN HERE')
->withHeaders([
"Accept" => "application/json"
])
->post("https://getnotifly.com/api/{$project_id}/metric-entry", [
"metrics" => [
[
"id" => $metric_id,
"data" => [
"quantity" => 1,
// "value" => 1000.94,
],
// Optional
"created_at" => '2024-05-10 10:05:59'
],
]
]);
Response
{
"success": true,
}