curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/run \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"features": [
123
],
"params": {
"scale-axes": "10"
},
"drawGraphs": true,
"requestPerformance": true
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/run"
payload = {
"features": [123],
"params": { "scale-axes": "10" },
"drawGraphs": True,
"requestPerformance": 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({
features: [123],
params: {'scale-axes': '10'},
drawGraphs: true,
requestPerformance: true
})
};
fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/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}/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([
'features' => [
123
],
'params' => [
'scale-axes' => '10'
],
'drawGraphs' => true,
'requestPerformance' => 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}/run"
payload := strings.NewReader("{\n \"features\": [\n 123\n ],\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"drawGraphs\": true,\n \"requestPerformance\": 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}/run")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"features\": [\n 123\n ],\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"drawGraphs\": true,\n \"requestPerformance\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/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 \"features\": [\n 123\n ],\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"drawGraphs\": true,\n \"requestPerformance\": 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": {}
}
],
"error": "<string>",
"labels": [
"<string>"
],
"state_string": "<string>",
"performance": {
"latency": 123,
"ram": 123,
"customDspString": "<string>"
}
}Get processed sample (from features array)
Takes in a features array and runs it through the DSP block. This data should have the same frequency as set in the input block in your impulse.
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/run \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"features": [
123
],
"params": {
"scale-axes": "10"
},
"drawGraphs": true,
"requestPerformance": true
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/run"
payload = {
"features": [123],
"params": { "scale-axes": "10" },
"drawGraphs": True,
"requestPerformance": 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({
features: [123],
params: {'scale-axes': '10'},
drawGraphs: true,
requestPerformance: true
})
};
fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/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}/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([
'features' => [
123
],
'params' => [
'scale-axes' => '10'
],
'drawGraphs' => true,
'requestPerformance' => 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}/run"
payload := strings.NewReader("{\n \"features\": [\n 123\n ],\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"drawGraphs\": true,\n \"requestPerformance\": 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}/run")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"features\": [\n 123\n ],\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"drawGraphs\": true,\n \"requestPerformance\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api/{projectId}/dsp/{dspId}/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 \"features\": [\n 123\n ],\n \"params\": {\n \"scale-axes\": \"10\"\n },\n \"drawGraphs\": true,\n \"requestPerformance\": 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": {}
}
],
"error": "<string>",
"labels": [
"<string>"
],
"state_string": "<string>",
"performance": {
"latency": 123,
"ram": 123,
"customDspString": "<string>"
}
}Authorizations
Path Parameters
Project ID
DSP Block ID, use the impulse functions to retrieve the ID
Body
Array of features. If you have multiple axes the data should be interleaved (e.g. [ax0_val0, ax1_val0, ax2_val0, ax0_val1, ax1_val1, ax2_val1]).
DSP parameters with values
Show child attributes
Show child attributes
{ "scale-axes": "10" }
Whether to generate graphs (will take longer)
Whether to request performance info (will take longer unless cached)
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
Optional error description (set if 'success' was false)
Labels of the feature axes
String representation of the DSP state returned
Show child attributes
Show child attributes
Was this page helpful?