Preset a timeline reason
Allows users to preset a timeline reason for a machine. It is useful for real-time or pre-scheduled event labeling, ensuring accurate machine activity tracking.
curl -X POST "https://wm.novoai.de/v2/timeline/reason_preset" \
-H "Content-Type: application/json" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"machine_id": 1,
"reason_id": 1,
"meta_frontend": {},
"idx": 1
}'
import requests
import json
url = "https://wm.novoai.de/v2/timeline/reason_preset"
headers = {
"Content-Type": "application/json",
"accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)",
"X-API-KEY": "YOUR_API_KEY"
}
data = {
"machine_id": 1,
"reason_id": 1,
"meta_frontend": {},
"idx": 1
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://wm.novoai.de/v2/timeline/reason_preset", {
method: "POST",
headers: {
"Content-Type": "application/json",
"accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)",
"X-API-KEY": "YOUR_API_KEY"
},
body: JSON.stringify({
"machine_id": 1,
"reason_id": 1,
"meta_frontend": {},
"idx": 1
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"machine_id": 1,
"reason_id": 1,
"meta_frontend": {},
"idx": 1
}`)
req, err := http.NewRequest("POST", "https://wm.novoai.de/v2/timeline/reason_preset", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("accept", "application/json")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (JWT)")
req.Header.Set("X-API-KEY", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://wm.novoai.de/v2/timeline/reason_preset')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['accept'] = 'application/json'
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (JWT)'
request['X-API-KEY'] = 'YOUR_API_KEY'
request.body = '{
"machine_id": 1,
"reason_id": 1,
"meta_frontend": {},
"idx": 1
}'
response = http.request(request)
puts response.body
{
"status": 1,
"message": "Live Timeline Reason Set Successfully"
}
{
"status": 0,
"message": "Machine ID is required."
}
{
"status": 0,
"message": "Reason ID is required."
}
{
"status": 0,
"message": "Unauthorized access."
}
{
"status": 0,
"message": "Machine with ID 1 not found for the current company."
}
{
"status": 0,
"message": "Timeline reason with ID 1 not found for the current company."
}
{
"status": 0,
"message": "An unexpected error occurred."
}
/v2/timeline/reason_preset
Target server for requests. Edit to use your own host.
JWT Bearer token authentication. Include in the Authorization header as Bearer <token>.
Bearer <token>.API-Access Key authentication. Include the generated key in the X-API-KEY header.
X-API-KEY header.The media type of the request body
Must be application/json.
Must be application/json for POST requests.
The machine to which the timeline reason is assigned.
The ID of the timeline reason being preset.
Additional frontend metadata.
The timeline entry index for reference.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token (JWT). JWT Bearer token authentication. Include in the Authorization header as Bearer \<token\>.
API Key for authentication. API-Access Key authentication. Include the generated key in the X-API-KEY header.
Headers
Body
The machine to which the timeline reason is assigned.
The ID of the timeline reason being preset.
Additional frontend metadata.
The timeline entry index for reference.
Responses
Indicates the success of the request. 1 for success, 0 for failure.
Success confirmation message.