curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/impulse \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"inputBlocks": [
{
"id": 2,
"type": "time-series",
"name": "Time series",
"title": "Time series",
"axes": [
"accX"
],
"windowSizeMs": 2004,
"windowIncreaseMs": 123,
"frequencyHz": 60,
"classificationWindowIncreaseMs": 123,
"padZeros": true,
"imageWidth": 28,
"imageHeight": 28,
"resizeMode": "squash",
"resizeMethod": "squash",
"cropAnchor": "middle-center",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"dspBlocks": [
{
"id": 2,
"type": "spectral-analysis",
"name": "Spectral features",
"axes": [
"accX"
],
"title": "Spectral Analysis",
"implementationVersion": 123,
"valuesPerAxis": 11,
"input": 1,
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z",
"customUrl": "<string>",
"namedAxes": [
{
"name": "<string>",
"description": "<string>",
"required": true,
"selectedAxis": "<string>"
}
]
}
],
"learnBlocks": [
{
"id": 2,
"name": "NN Classifier",
"dsp": [
27
],
"title": "Classification (Keras)",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"name": "<string>",
"postProcessingBlocks": [
{
"id": 2,
"type": "object-tracking",
"name": "Object tracking",
"title": "Object tracking",
"implementationVersion": 123,
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api/{projectId}/impulse"
payload = {
"inputBlocks": [
{
"id": 2,
"type": "time-series",
"name": "Time series",
"title": "Time series",
"axes": ["accX"],
"windowSizeMs": 2004,
"windowIncreaseMs": 123,
"frequencyHz": 60,
"classificationWindowIncreaseMs": 123,
"padZeros": True,
"imageWidth": 28,
"imageHeight": 28,
"resizeMode": "squash",
"resizeMethod": "squash",
"cropAnchor": "middle-center",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"dspBlocks": [
{
"id": 2,
"type": "spectral-analysis",
"name": "Spectral features",
"axes": ["accX"],
"title": "Spectral Analysis",
"implementationVersion": 123,
"valuesPerAxis": 11,
"input": 1,
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z",
"customUrl": "<string>",
"namedAxes": [
{
"name": "<string>",
"description": "<string>",
"required": True,
"selectedAxis": "<string>"
}
]
}
],
"learnBlocks": [
{
"id": 2,
"name": "NN Classifier",
"dsp": [27],
"title": "Classification (Keras)",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"name": "<string>",
"postProcessingBlocks": [
{
"id": 2,
"type": "object-tracking",
"name": "Object tracking",
"title": "Object tracking",
"implementationVersion": 123,
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
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({
inputBlocks: [
{
id: 2,
type: 'time-series',
name: 'Time series',
title: 'Time series',
axes: ['accX'],
windowSizeMs: 2004,
windowIncreaseMs: 123,
frequencyHz: 60,
classificationWindowIncreaseMs: 123,
padZeros: true,
imageWidth: 28,
imageHeight: 28,
resizeMode: 'squash',
resizeMethod: 'squash',
cropAnchor: 'middle-center',
createdBy: 'createImpulse',
createdAt: '2023-11-07T05:31:56Z'
}
],
dspBlocks: [
{
id: 2,
type: 'spectral-analysis',
name: 'Spectral features',
axes: ['accX'],
title: 'Spectral Analysis',
implementationVersion: 123,
valuesPerAxis: 11,
input: 1,
createdBy: 'createImpulse',
createdAt: '2023-11-07T05:31:56Z',
customUrl: '<string>',
namedAxes: [
{
name: '<string>',
description: '<string>',
required: true,
selectedAxis: '<string>'
}
]
}
],
learnBlocks: [
{
id: 2,
name: 'NN Classifier',
dsp: [27],
title: 'Classification (Keras)',
createdBy: 'createImpulse',
createdAt: '2023-11-07T05:31:56Z'
}
],
name: '<string>',
postProcessingBlocks: [
{
id: 2,
type: 'object-tracking',
name: 'Object tracking',
title: 'Object tracking',
implementationVersion: 123,
createdBy: 'createImpulse',
createdAt: '2023-11-07T05:31:56Z'
}
]
})
};
fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/impulse', 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}/impulse",
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([
'inputBlocks' => [
[
'id' => 2,
'type' => 'time-series',
'name' => 'Time series',
'title' => 'Time series',
'axes' => [
'accX'
],
'windowSizeMs' => 2004,
'windowIncreaseMs' => 123,
'frequencyHz' => 60,
'classificationWindowIncreaseMs' => 123,
'padZeros' => true,
'imageWidth' => 28,
'imageHeight' => 28,
'resizeMode' => 'squash',
'resizeMethod' => 'squash',
'cropAnchor' => 'middle-center',
'createdBy' => 'createImpulse',
'createdAt' => '2023-11-07T05:31:56Z'
]
],
'dspBlocks' => [
[
'id' => 2,
'type' => 'spectral-analysis',
'name' => 'Spectral features',
'axes' => [
'accX'
],
'title' => 'Spectral Analysis',
'implementationVersion' => 123,
'valuesPerAxis' => 11,
'input' => 1,
'createdBy' => 'createImpulse',
'createdAt' => '2023-11-07T05:31:56Z',
'customUrl' => '<string>',
'namedAxes' => [
[
'name' => '<string>',
'description' => '<string>',
'required' => true,
'selectedAxis' => '<string>'
]
]
]
],
'learnBlocks' => [
[
'id' => 2,
'name' => 'NN Classifier',
'dsp' => [
27
],
'title' => 'Classification (Keras)',
'createdBy' => 'createImpulse',
'createdAt' => '2023-11-07T05:31:56Z'
]
],
'name' => '<string>',
'postProcessingBlocks' => [
[
'id' => 2,
'type' => 'object-tracking',
'name' => 'Object tracking',
'title' => 'Object tracking',
'implementationVersion' => 123,
'createdBy' => 'createImpulse',
'createdAt' => '2023-11-07T05:31:56Z'
]
]
]),
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}/impulse"
payload := strings.NewReader("{\n \"inputBlocks\": [\n {\n \"id\": 2,\n \"type\": \"time-series\",\n \"name\": \"Time series\",\n \"title\": \"Time series\",\n \"axes\": [\n \"accX\"\n ],\n \"windowSizeMs\": 2004,\n \"windowIncreaseMs\": 123,\n \"frequencyHz\": 60,\n \"classificationWindowIncreaseMs\": 123,\n \"padZeros\": true,\n \"imageWidth\": 28,\n \"imageHeight\": 28,\n \"resizeMode\": \"squash\",\n \"resizeMethod\": \"squash\",\n \"cropAnchor\": \"middle-center\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dspBlocks\": [\n {\n \"id\": 2,\n \"type\": \"spectral-analysis\",\n \"name\": \"Spectral features\",\n \"axes\": [\n \"accX\"\n ],\n \"title\": \"Spectral Analysis\",\n \"implementationVersion\": 123,\n \"valuesPerAxis\": 11,\n \"input\": 1,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"customUrl\": \"<string>\",\n \"namedAxes\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true,\n \"selectedAxis\": \"<string>\"\n }\n ]\n }\n ],\n \"learnBlocks\": [\n {\n \"id\": 2,\n \"name\": \"NN Classifier\",\n \"dsp\": [\n 27\n ],\n \"title\": \"Classification (Keras)\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"name\": \"<string>\",\n \"postProcessingBlocks\": [\n {\n \"id\": 2,\n \"type\": \"object-tracking\",\n \"name\": \"Object tracking\",\n \"title\": \"Object tracking\",\n \"implementationVersion\": 123,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\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}/impulse")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputBlocks\": [\n {\n \"id\": 2,\n \"type\": \"time-series\",\n \"name\": \"Time series\",\n \"title\": \"Time series\",\n \"axes\": [\n \"accX\"\n ],\n \"windowSizeMs\": 2004,\n \"windowIncreaseMs\": 123,\n \"frequencyHz\": 60,\n \"classificationWindowIncreaseMs\": 123,\n \"padZeros\": true,\n \"imageWidth\": 28,\n \"imageHeight\": 28,\n \"resizeMode\": \"squash\",\n \"resizeMethod\": \"squash\",\n \"cropAnchor\": \"middle-center\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dspBlocks\": [\n {\n \"id\": 2,\n \"type\": \"spectral-analysis\",\n \"name\": \"Spectral features\",\n \"axes\": [\n \"accX\"\n ],\n \"title\": \"Spectral Analysis\",\n \"implementationVersion\": 123,\n \"valuesPerAxis\": 11,\n \"input\": 1,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"customUrl\": \"<string>\",\n \"namedAxes\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true,\n \"selectedAxis\": \"<string>\"\n }\n ]\n }\n ],\n \"learnBlocks\": [\n {\n \"id\": 2,\n \"name\": \"NN Classifier\",\n \"dsp\": [\n 27\n ],\n \"title\": \"Classification (Keras)\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"name\": \"<string>\",\n \"postProcessingBlocks\": [\n {\n \"id\": 2,\n \"type\": \"object-tracking\",\n \"name\": \"Object tracking\",\n \"title\": \"Object tracking\",\n \"implementationVersion\": 123,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api/{projectId}/impulse")
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 \"inputBlocks\": [\n {\n \"id\": 2,\n \"type\": \"time-series\",\n \"name\": \"Time series\",\n \"title\": \"Time series\",\n \"axes\": [\n \"accX\"\n ],\n \"windowSizeMs\": 2004,\n \"windowIncreaseMs\": 123,\n \"frequencyHz\": 60,\n \"classificationWindowIncreaseMs\": 123,\n \"padZeros\": true,\n \"imageWidth\": 28,\n \"imageHeight\": 28,\n \"resizeMode\": \"squash\",\n \"resizeMethod\": \"squash\",\n \"cropAnchor\": \"middle-center\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dspBlocks\": [\n {\n \"id\": 2,\n \"type\": \"spectral-analysis\",\n \"name\": \"Spectral features\",\n \"axes\": [\n \"accX\"\n ],\n \"title\": \"Spectral Analysis\",\n \"implementationVersion\": 123,\n \"valuesPerAxis\": 11,\n \"input\": 1,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"customUrl\": \"<string>\",\n \"namedAxes\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true,\n \"selectedAxis\": \"<string>\"\n }\n ]\n }\n ],\n \"learnBlocks\": [\n {\n \"id\": 2,\n \"name\": \"NN Classifier\",\n \"dsp\": [\n 27\n ],\n \"title\": \"Classification (Keras)\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"name\": \"<string>\",\n \"postProcessingBlocks\": [\n {\n \"id\": 2,\n \"type\": \"object-tracking\",\n \"name\": \"Object tracking\",\n \"title\": \"Object tracking\",\n \"implementationVersion\": 123,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": 123,
"error": "<string>"
}Create impulse
Sets the impulse for this project. If you specify impulseId then that impulse is created/updated, otherwise the default impulse is created/updated.
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/impulse \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"inputBlocks": [
{
"id": 2,
"type": "time-series",
"name": "Time series",
"title": "Time series",
"axes": [
"accX"
],
"windowSizeMs": 2004,
"windowIncreaseMs": 123,
"frequencyHz": 60,
"classificationWindowIncreaseMs": 123,
"padZeros": true,
"imageWidth": 28,
"imageHeight": 28,
"resizeMode": "squash",
"resizeMethod": "squash",
"cropAnchor": "middle-center",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"dspBlocks": [
{
"id": 2,
"type": "spectral-analysis",
"name": "Spectral features",
"axes": [
"accX"
],
"title": "Spectral Analysis",
"implementationVersion": 123,
"valuesPerAxis": 11,
"input": 1,
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z",
"customUrl": "<string>",
"namedAxes": [
{
"name": "<string>",
"description": "<string>",
"required": true,
"selectedAxis": "<string>"
}
]
}
],
"learnBlocks": [
{
"id": 2,
"name": "NN Classifier",
"dsp": [
27
],
"title": "Classification (Keras)",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"name": "<string>",
"postProcessingBlocks": [
{
"id": 2,
"type": "object-tracking",
"name": "Object tracking",
"title": "Object tracking",
"implementationVersion": 123,
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api/{projectId}/impulse"
payload = {
"inputBlocks": [
{
"id": 2,
"type": "time-series",
"name": "Time series",
"title": "Time series",
"axes": ["accX"],
"windowSizeMs": 2004,
"windowIncreaseMs": 123,
"frequencyHz": 60,
"classificationWindowIncreaseMs": 123,
"padZeros": True,
"imageWidth": 28,
"imageHeight": 28,
"resizeMode": "squash",
"resizeMethod": "squash",
"cropAnchor": "middle-center",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"dspBlocks": [
{
"id": 2,
"type": "spectral-analysis",
"name": "Spectral features",
"axes": ["accX"],
"title": "Spectral Analysis",
"implementationVersion": 123,
"valuesPerAxis": 11,
"input": 1,
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z",
"customUrl": "<string>",
"namedAxes": [
{
"name": "<string>",
"description": "<string>",
"required": True,
"selectedAxis": "<string>"
}
]
}
],
"learnBlocks": [
{
"id": 2,
"name": "NN Classifier",
"dsp": [27],
"title": "Classification (Keras)",
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"name": "<string>",
"postProcessingBlocks": [
{
"id": 2,
"type": "object-tracking",
"name": "Object tracking",
"title": "Object tracking",
"implementationVersion": 123,
"createdBy": "createImpulse",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
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({
inputBlocks: [
{
id: 2,
type: 'time-series',
name: 'Time series',
title: 'Time series',
axes: ['accX'],
windowSizeMs: 2004,
windowIncreaseMs: 123,
frequencyHz: 60,
classificationWindowIncreaseMs: 123,
padZeros: true,
imageWidth: 28,
imageHeight: 28,
resizeMode: 'squash',
resizeMethod: 'squash',
cropAnchor: 'middle-center',
createdBy: 'createImpulse',
createdAt: '2023-11-07T05:31:56Z'
}
],
dspBlocks: [
{
id: 2,
type: 'spectral-analysis',
name: 'Spectral features',
axes: ['accX'],
title: 'Spectral Analysis',
implementationVersion: 123,
valuesPerAxis: 11,
input: 1,
createdBy: 'createImpulse',
createdAt: '2023-11-07T05:31:56Z',
customUrl: '<string>',
namedAxes: [
{
name: '<string>',
description: '<string>',
required: true,
selectedAxis: '<string>'
}
]
}
],
learnBlocks: [
{
id: 2,
name: 'NN Classifier',
dsp: [27],
title: 'Classification (Keras)',
createdBy: 'createImpulse',
createdAt: '2023-11-07T05:31:56Z'
}
],
name: '<string>',
postProcessingBlocks: [
{
id: 2,
type: 'object-tracking',
name: 'Object tracking',
title: 'Object tracking',
implementationVersion: 123,
createdBy: 'createImpulse',
createdAt: '2023-11-07T05:31:56Z'
}
]
})
};
fetch('https://studio.edgeimpulse.com/v1/api/{projectId}/impulse', 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}/impulse",
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([
'inputBlocks' => [
[
'id' => 2,
'type' => 'time-series',
'name' => 'Time series',
'title' => 'Time series',
'axes' => [
'accX'
],
'windowSizeMs' => 2004,
'windowIncreaseMs' => 123,
'frequencyHz' => 60,
'classificationWindowIncreaseMs' => 123,
'padZeros' => true,
'imageWidth' => 28,
'imageHeight' => 28,
'resizeMode' => 'squash',
'resizeMethod' => 'squash',
'cropAnchor' => 'middle-center',
'createdBy' => 'createImpulse',
'createdAt' => '2023-11-07T05:31:56Z'
]
],
'dspBlocks' => [
[
'id' => 2,
'type' => 'spectral-analysis',
'name' => 'Spectral features',
'axes' => [
'accX'
],
'title' => 'Spectral Analysis',
'implementationVersion' => 123,
'valuesPerAxis' => 11,
'input' => 1,
'createdBy' => 'createImpulse',
'createdAt' => '2023-11-07T05:31:56Z',
'customUrl' => '<string>',
'namedAxes' => [
[
'name' => '<string>',
'description' => '<string>',
'required' => true,
'selectedAxis' => '<string>'
]
]
]
],
'learnBlocks' => [
[
'id' => 2,
'name' => 'NN Classifier',
'dsp' => [
27
],
'title' => 'Classification (Keras)',
'createdBy' => 'createImpulse',
'createdAt' => '2023-11-07T05:31:56Z'
]
],
'name' => '<string>',
'postProcessingBlocks' => [
[
'id' => 2,
'type' => 'object-tracking',
'name' => 'Object tracking',
'title' => 'Object tracking',
'implementationVersion' => 123,
'createdBy' => 'createImpulse',
'createdAt' => '2023-11-07T05:31:56Z'
]
]
]),
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}/impulse"
payload := strings.NewReader("{\n \"inputBlocks\": [\n {\n \"id\": 2,\n \"type\": \"time-series\",\n \"name\": \"Time series\",\n \"title\": \"Time series\",\n \"axes\": [\n \"accX\"\n ],\n \"windowSizeMs\": 2004,\n \"windowIncreaseMs\": 123,\n \"frequencyHz\": 60,\n \"classificationWindowIncreaseMs\": 123,\n \"padZeros\": true,\n \"imageWidth\": 28,\n \"imageHeight\": 28,\n \"resizeMode\": \"squash\",\n \"resizeMethod\": \"squash\",\n \"cropAnchor\": \"middle-center\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dspBlocks\": [\n {\n \"id\": 2,\n \"type\": \"spectral-analysis\",\n \"name\": \"Spectral features\",\n \"axes\": [\n \"accX\"\n ],\n \"title\": \"Spectral Analysis\",\n \"implementationVersion\": 123,\n \"valuesPerAxis\": 11,\n \"input\": 1,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"customUrl\": \"<string>\",\n \"namedAxes\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true,\n \"selectedAxis\": \"<string>\"\n }\n ]\n }\n ],\n \"learnBlocks\": [\n {\n \"id\": 2,\n \"name\": \"NN Classifier\",\n \"dsp\": [\n 27\n ],\n \"title\": \"Classification (Keras)\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"name\": \"<string>\",\n \"postProcessingBlocks\": [\n {\n \"id\": 2,\n \"type\": \"object-tracking\",\n \"name\": \"Object tracking\",\n \"title\": \"Object tracking\",\n \"implementationVersion\": 123,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\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}/impulse")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputBlocks\": [\n {\n \"id\": 2,\n \"type\": \"time-series\",\n \"name\": \"Time series\",\n \"title\": \"Time series\",\n \"axes\": [\n \"accX\"\n ],\n \"windowSizeMs\": 2004,\n \"windowIncreaseMs\": 123,\n \"frequencyHz\": 60,\n \"classificationWindowIncreaseMs\": 123,\n \"padZeros\": true,\n \"imageWidth\": 28,\n \"imageHeight\": 28,\n \"resizeMode\": \"squash\",\n \"resizeMethod\": \"squash\",\n \"cropAnchor\": \"middle-center\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dspBlocks\": [\n {\n \"id\": 2,\n \"type\": \"spectral-analysis\",\n \"name\": \"Spectral features\",\n \"axes\": [\n \"accX\"\n ],\n \"title\": \"Spectral Analysis\",\n \"implementationVersion\": 123,\n \"valuesPerAxis\": 11,\n \"input\": 1,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"customUrl\": \"<string>\",\n \"namedAxes\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true,\n \"selectedAxis\": \"<string>\"\n }\n ]\n }\n ],\n \"learnBlocks\": [\n {\n \"id\": 2,\n \"name\": \"NN Classifier\",\n \"dsp\": [\n 27\n ],\n \"title\": \"Classification (Keras)\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"name\": \"<string>\",\n \"postProcessingBlocks\": [\n {\n \"id\": 2,\n \"type\": \"object-tracking\",\n \"name\": \"Object tracking\",\n \"title\": \"Object tracking\",\n \"implementationVersion\": 123,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api/{projectId}/impulse")
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 \"inputBlocks\": [\n {\n \"id\": 2,\n \"type\": \"time-series\",\n \"name\": \"Time series\",\n \"title\": \"Time series\",\n \"axes\": [\n \"accX\"\n ],\n \"windowSizeMs\": 2004,\n \"windowIncreaseMs\": 123,\n \"frequencyHz\": 60,\n \"classificationWindowIncreaseMs\": 123,\n \"padZeros\": true,\n \"imageWidth\": 28,\n \"imageHeight\": 28,\n \"resizeMode\": \"squash\",\n \"resizeMethod\": \"squash\",\n \"cropAnchor\": \"middle-center\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"dspBlocks\": [\n {\n \"id\": 2,\n \"type\": \"spectral-analysis\",\n \"name\": \"Spectral features\",\n \"axes\": [\n \"accX\"\n ],\n \"title\": \"Spectral Analysis\",\n \"implementationVersion\": 123,\n \"valuesPerAxis\": 11,\n \"input\": 1,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"customUrl\": \"<string>\",\n \"namedAxes\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true,\n \"selectedAxis\": \"<string>\"\n }\n ]\n }\n ],\n \"learnBlocks\": [\n {\n \"id\": 2,\n \"name\": \"NN Classifier\",\n \"dsp\": [\n 27\n ],\n \"title\": \"Classification (Keras)\",\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"name\": \"<string>\",\n \"postProcessingBlocks\": [\n {\n \"id\": 2,\n \"type\": \"object-tracking\",\n \"name\": \"Object tracking\",\n \"title\": \"Object tracking\",\n \"implementationVersion\": 123,\n \"createdBy\": \"createImpulse\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": 123,
"error": "<string>"
}Authorizations
Path Parameters
Project ID
Query Parameters
Impulse ID. If this is unset then the default impulse is used.
Body
Input Blocks that are part of this impulse
Show child attributes
Show child attributes
DSP Blocks that are part of this impulse
Show child attributes
Show child attributes
Learning Blocks that are part of this impulse
Show child attributes
Show child attributes
Name for this impulse (optional). If no name is provided one is created based on your blocks.
Post-processing blocks that are part of this impulse
Show child attributes
Show child attributes
Specifies the type of impulse. Options include: - default: Standard Edge Impulse pipeline. - BYOM: Impulse that includes a pretrained model. - VLM: Impulse created as part of a Vision Learning Model (VLM) workflow.
default, BYOM, VLM Was this page helpful?