-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo-test.http
More file actions
134 lines (117 loc) · 4.15 KB
/
Copy pathdemo-test.http
File metadata and controls
134 lines (117 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# NudgingTool - demo manual HTTP tests
# Use with VSCode REST Client or IntelliJ HTTP Client.
#
# Flow:
# 1. Run "Get access token"
# 2. Run "imported_up [it]"
#
# Copy the access_token from "Get access token" into @accessToken manually.
@baseUrl = http://localhost:8016
@keycloakUrl = http://keycloak.celine.localhost
@realm = celine
@clientId = svc-digital-twin
@clientSecret = svc-digital-twin
@communityId = example_rec
@userId = ah-00003
@accessToken = eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIxODdDWUZCR2ZITUNyeDlMRXJIenNRVFhaMlNzTjlvQ3lYTVZZc0FDcF9FIn0.eyJleHAiOjE3Nzc4NzcyNjQsImlhdCI6MTc3Nzg3Njk2NCwianRpIjoidHJydGNjOmYwNDlmOGRjLTNkMDItZjk2NC03ZTI3LTA5Y2I4NjczNGFlZSIsImlzcyI6Imh0dHA6Ly9rZXljbG9hay5jZWxpbmUubG9jYWxob3N0L3JlYWxtcy9jZWxpbmUiLCJhdWQiOlsic3ZjLXJlYy1yZWdpc3RyeSIsInN2Yy1udWRnaW5nIiwic3ZjLXBpcGVsaW5lcyIsInN2Yy1kYXRhc2V0LWFwaSIsInN2Yy1mbGV4aWJpbGl0eSJdLCJzdWIiOiI5NzM1NjgxOC01YmNjLTQ2NGUtYWI5OC02YjliZWE4ZGU1NjAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJzdmMtZGlnaXRhbC10d2luIiwic2NvcGUiOiJmbGV4aWJpbGl0eS5jb21taXR0ZWQud3JpdGUgZGF0YXNldC5xdWVyeSBmbGV4aWJpbGl0eS5jb21taXR0ZWQucmVhZCBkaWdpdGFsLXR3aW4uYWRtaW4gbnVkZ2luZy5pbmdlc3QgcmVjLXJlZ2lzdHJ5Lmxvb2t1cCBwaXBlbGluZXMucnVucy5yZWFkIiwiY2xpZW50SG9zdCI6IjE3Mi4yNS4wLjEiLCJjbGllbnRBZGRyZXNzIjoiMTcyLjI1LjAuMSIsImNsaWVudF9pZCI6InN2Yy1kaWdpdGFsLXR3aW4ifQ.KCbw4kuso9xAR12HhCMbFNCDSlGaKbqaNOF5fExC_F00o7CAmzdkvdCYg6VJc8DkCLyHYW2i66OxEMn_vhGsH26TFdj7QIyh_H-8SGeDaz7gDMBFGwULiWcf85WCuoSAbO82SLCrowAlQx3Dyb6EK5e1utYFLlPGSbKlzL_o4DmmymEvcL8RHNtaXoqLM6X0RZhkU9faTHSHVkfER2Ga4Al0GoO4oPXqyWonqW8kG3mZvvI7oxNkG5SKyC4ysgae-arMQAxHEUwMR6Yc_C_IiQzVLYoIWqSrM5OcQVDgyCoIyz4z8iwDV-P9WHLts7ExoqbZSBxqVxyHCa6bY8Iesg
### Healthcheck
GET {{baseUrl}}/health
### Get access token
POST {{keycloakUrl}}/realms/{{realm}}/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&
client_id={{clientId}}&
client_secret={{clientSecret}}
### send-test tracked push
POST {{baseUrl}}/webpush/send-test
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"user_id": "{{userId}}",
"community_id": "{{communityId}}",
"title": "Tracked push test",
"body": "Cliccami per verificare il tracking.",
"url": "/"
}
### imported_up [it]
POST {{baseUrl}}/admin/ingest-event
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"event_type": "imported_up",
"user_id": "{{userId}}",
"community_id": "{{communityId}}",
"facts": {
"facts_version": "1.0",
"scenario": "imported_up",
"time": "2026-04-05",
"delta_pct": 35,
"cur": 135,
"prev": 100,
"lang": "it"
}
}
### inverter_error_critical_daily_v1 [it]
POST {{baseUrl}}/admin/ingest-event
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"event_type": "inverter_error_critical_daily_v1",
"user_id": "{{userId}}",
"community_id": "{{communityId}}",
"facts": {
"facts_version": "1.0",
"scenario": "inverter_error_critical_daily_v1",
"time": "2026-03-08",
"system_status_error_last_day_total": 2,
"lang": "it"
}
}
### extr_event [it] - active kind, should not be suppressed as kind_disabled
POST {{baseUrl}}/admin/ingest-event
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"event_type": "extr_event",
"user_id": "{{userId}}",
"community_id": "{{communityId}}",
"facts": {
"facts_version": "1.0",
"scenario": "extr_event",
"period": "2026-05-09",
"window_start": "2026-04-30T08:00:00Z",
"window_end": "2026-04-30T20:00:00Z",
"event_type": "storm_alert",
"lang": "it"
}
}
### spring [it]
POST {{baseUrl}}/admin/ingest-event
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"event_type": "spring",
"user_id": "{{userId}}",
"community_id": "{{communityId}}",
"facts": {
"facts_version": "1.0",
"scenario": "spring",
"time": "2026",
"lang": "it"
}
}
### summer [it]
POST {{baseUrl}}/admin/ingest-event
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"event_type": "summmer",
"user_id": "{{userId}}",
"community_id": "{{communityId}}",
"facts": {
"facts_version": "1.0",
"scenario": "spring",
"time": "2026",
"lang": "it"
}
}