-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassets.http
60 lines (52 loc) · 1.66 KB
/
assets.http
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
### [Assets] List assets with filters and expansions (read-only)
GET {{api-server}}/v2/assets HTTP/1.1
X-Api-Key: {{read-only-token}}
### [Assets] Create a new asset with optional fields (read–write)
PUT {{api-server}}/v2/assets HTTP/1.1
X-Api-Key: {{read-write-token}}
Content-Type: application/json
{
"globalAssetIdentifier": "zurich_swiss",
"name": "Station Zurich",
"assetType": "weather_location",
"latitude": 47.3667,
"longitude": 8.55,
"projectId": "99",
"tags": ["weather", "location"],
"resourceId": "123e4567-e89b-12d3-a456-426655440000"
}
### [Assets] Get asset by id with expansions (read-only)
GET {{api-server}}/v2/assets/64378?expansions=Asset.childrenInfo HTTP/1.1
X-Api-Key: {{read-only-token}}
### [Assets] Delete an asset by id (read–write)
DELETE {{api-server}}/v2/assets/64378 HTTP/1.1
X-Api-Key: {{read-write-token}}
### [Assets] Delete a list of assets in bulk (read–write)
DELETE {{api-server}}/v2/assets-bulk?identifyBy=id HTTP/1.1
X-Api-Key: {{read-write-token}}
Content-Type: application/json
[ "64380", "64379" ]
### [Assets] Create or update a list of assets in bulk (read–write)
PUT {{api-server}}/v2/assets-bulk?identifyBy=gai-projId HTTP/1.1
X-Api-Key: {{read-write-token}}
Content-Type: application/json
[
{
"globalAssetIdentifier": "asset_1",
"name": "Asset One",
"assetType": "weather_location",
"latitude": 47.123,
"longitude": 8.456,
"projectId": "99",
"resourceId": "device-001"
},
{
"globalAssetIdentifier": "asset_2",
"name": "Asset Two",
"assetType": "weather_location",
"latitude": 47.124,
"longitude": 8.457,
"projectId": "99",
"resourceId": "device-002"
}
]