curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"params": {
"scale-axes": "10"
},
"store": true
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run"
payload = {
"params": { "scale-axes": "10" },
"store": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({params: {'scale-axes': '10'}, store: true})
};
fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'params' => [
'scale-axes' => '10'
],
'store' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run"
payload := strings.NewReader("{\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"store\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"store\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"store\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"features": [
123
],
"graphs": [
{
"name": "Frequency domain",
"type": "<string>",
"image": "<string>",
"imageMimeType": "<string>",
"X": {
"accX": [
3,
5,
7
],
"accY": [
2,
1,
5
]
},
"y": [
0,
0.5,
1
],
"suggestedXMin": 123,
"suggestedXMax": 123,
"suggestedYMin": 123,
"suggestedYMax": 123,
"lineWidth": 123,
"smoothing": true,
"axisLabels": {
"X": "<string>",
"y": "<string>"
},
"highlights": {}
}
],
"sample": {
"sample": {
"id": 2,
"filename": "idle01.d8Ae",
"signatureValidate": true,
"created": "2023-11-07T05:31:56Z",
"lastModified": "2023-11-07T05:31:56Z",
"category": "training",
"coldstorageFilename": "<string>",
"label": "healthy-machine",
"intervalMs": 16,
"frequency": 62.5,
"originalIntervalMs": 16,
"originalFrequency": 62.5,
"deviceType": "<string>",
"sensors": [
{
"index": 123,
"name": "accX",
"units": "<string>"
}
],
"valuesCount": 123,
"added": "2023-11-07T05:31:56Z",
"boundingBoxes": [
{
"label": "<string>",
"x": 123,
"y": 123,
"width": 123,
"height": 123
}
],
"isDisabled": true,
"isProcessing": true,
"processingError": true,
"isCropped": true,
"projectId": 123,
"sha256Hash": "<string>",
"datastreams": [
{
"index": 123,
"intervalMs": 123,
"frequencyHz": 123,
"sensors": [
{
"index": 123,
"name": "accX",
"units": "<string>"
}
],
"valuesCount": 123,
"totalLengthMs": 123,
"imageDimensions": {
"width": 123,
"height": 123
}
}
],
"signatureMethod": "HS256",
"signatureKey": "<string>",
"deviceName": "<string>",
"totalLengthMs": 123,
"thumbnailVideo": "<string>",
"thumbnailVideoFull": "<string>",
"processingJobId": 123,
"processingErrorString": "<string>",
"metadata": {},
"projectOwnerName": "<string>",
"projectName": "<string>",
"structuredLabels": [
{
"startIndex": 123,
"endIndex": 123,
"label": "<string>",
"labelMap": {
"type": "key-values",
"labels": {}
}
}
],
"structuredLabelsList": [
"<string>"
],
"createdBySyntheticDataJobId": 123,
"imageDimensions": {
"width": 123,
"height": 123
},
"videoUrl": "<string>",
"videoUrlFull": "<string>",
"labelMap": {
"type": "key-values",
"labels": {}
},
"lastUpdatedBy": {
"type": "user",
"id": 123
}
},
"payload": {
"device_type": "DISCO-L475VG-IOT01A",
"sensors": [
{
"index": 123,
"name": "accX",
"units": "<string>"
}
],
"values": [
[
123
]
],
"intervalMs": 16,
"frequencyHz": 62.5,
"device_name": "ac:87:a3:0a:2d:1b",
"cropStart": 0,
"cropEnd": 128
},
"totalPayloadLength": 123
},
"canProfilePerformance": true,
"error": "<string>",
"labels": [
"<string>"
],
"state_string": "<string>",
"labelAtEndOfWindow": "<string>",
"labelForWindow": "<string>",
"performance": {
"latency": 123,
"ram": 123,
"customDspString": "<string>"
}
}Get processed sample (slice)
Get slice of sample data, and run it through the DSP block. This only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out.
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"params": {
"scale-axes": "10"
},
"store": true
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run"
payload = {
"params": { "scale-axes": "10" },
"store": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({params: {'scale-axes': '10'}, store: true})
};
fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'params' => [
'scale-axes' => '10'
],
'store' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run"
payload := strings.NewReader("{\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"store\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"store\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/raw-data/{sampleId}/slice/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"store\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"features": [
123
],
"graphs": [
{
"name": "Frequency domain",
"type": "<string>",
"image": "<string>",
"imageMimeType": "<string>",
"X": {
"accX": [
3,
5,
7
],
"accY": [
2,
1,
5
]
},
"y": [
0,
0.5,
1
],
"suggestedXMin": 123,
"suggestedXMax": 123,
"suggestedYMin": 123,
"suggestedYMax": 123,
"lineWidth": 123,
"smoothing": true,
"axisLabels": {
"X": "<string>",
"y": "<string>"
},
"highlights": {}
}
],
"sample": {
"sample": {
"id": 2,
"filename": "idle01.d8Ae",
"signatureValidate": true,
"created": "2023-11-07T05:31:56Z",
"lastModified": "2023-11-07T05:31:56Z",
"category": "training",
"coldstorageFilename": "<string>",
"label": "healthy-machine",
"intervalMs": 16,
"frequency": 62.5,
"originalIntervalMs": 16,
"originalFrequency": 62.5,
"deviceType": "<string>",
"sensors": [
{
"index": 123,
"name": "accX",
"units": "<string>"
}
],
"valuesCount": 123,
"added": "2023-11-07T05:31:56Z",
"boundingBoxes": [
{
"label": "<string>",
"x": 123,
"y": 123,
"width": 123,
"height": 123
}
],
"isDisabled": true,
"isProcessing": true,
"processingError": true,
"isCropped": true,
"projectId": 123,
"sha256Hash": "<string>",
"datastreams": [
{
"index": 123,
"intervalMs": 123,
"frequencyHz": 123,
"sensors": [
{
"index": 123,
"name": "accX",
"units": "<string>"
}
],
"valuesCount": 123,
"totalLengthMs": 123,
"imageDimensions": {
"width": 123,
"height": 123
}
}
],
"signatureMethod": "HS256",
"signatureKey": "<string>",
"deviceName": "<string>",
"totalLengthMs": 123,
"thumbnailVideo": "<string>",
"thumbnailVideoFull": "<string>",
"processingJobId": 123,
"processingErrorString": "<string>",
"metadata": {},
"projectOwnerName": "<string>",
"projectName": "<string>",
"structuredLabels": [
{
"startIndex": 123,
"endIndex": 123,
"label": "<string>",
"labelMap": {
"type": "key-values",
"labels": {}
}
}
],
"structuredLabelsList": [
"<string>"
],
"createdBySyntheticDataJobId": 123,
"imageDimensions": {
"width": 123,
"height": 123
},
"videoUrl": "<string>",
"videoUrlFull": "<string>",
"labelMap": {
"type": "key-values",
"labels": {}
},
"lastUpdatedBy": {
"type": "user",
"id": 123
}
},
"payload": {
"device_type": "DISCO-L475VG-IOT01A",
"sensors": [
{
"index": 123,
"name": "accX",
"units": "<string>"
}
],
"values": [
[
123
]
],
"intervalMs": 16,
"frequencyHz": 62.5,
"device_name": "ac:87:a3:0a:2d:1b",
"cropStart": 0,
"cropEnd": 128
},
"totalPayloadLength": 123
},
"canProfilePerformance": true,
"error": "<string>",
"labels": [
"<string>"
],
"state_string": "<string>",
"labelAtEndOfWindow": "<string>",
"labelForWindow": "<string>",
"performance": {
"latency": 123,
"ram": 123,
"customDspString": "<string>"
}
}Authorizations
Path Parameters
Project ID
DSP Block ID, use the impulse functions to retrieve the ID
Sample ID
Query Parameters
Begin index of the slice
End index of the slice. If not given, the sample will be sliced to the same length as the impulse input block window length.
Body
Response
OK
Whether the operation succeeded
Array of processed features. Laid out according to the names in 'labels'
Graphs to plot to give an insight in how the DSP process ran
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Optional error description (set if 'success' was false)
Labels of the feature axes
String representation of the DSP state returned
DEPRECATED. Label at the end of the window (only present for time-series data)
Label for the window. How the label is chosen is dependent on the value of "labelingMethodMultiLabel" in the input block.
Show child attributes
Show child attributes
Was this page helpful?