Welcome to Xsens Motion Cloud API!
Run your motion computations in the cloud.
All motion cloud functionality.
Our APIs are the following the industry standard.
Run analysis from your own application.
Xsens Motion Cloud enables users to analyze mvn and mvnx files with the computational power of the cloud. The REST API's enable the users to use these complex computations from anywhere.
Setup your account via Xsens. Contact us via the website.
When you setup your account, ask for API access.
Configure your task, run it, and check back after you've received a webhook callback
Try it out.
The example request contains a HTTP request to the Central API's reports endpoint, which lists the current users's reports. In the request the following headers are mandatory:OCP-Apim-Subscription-Key
The API key, generated in the products tab of this developer documentation website
Authorization
The JWT token of the user that is making the request
GET /report/v1/reports HTTP/1.1
OCP-Apim-Subscription-Key: <YOUR-API-KEY>
Authorization: Bearer <YOUR-JWT-TOKEN>
POST /task/v1/tasks HTTP/1.1
Ocp-Apim-Subscription-Key: <YOUR-API-KEY>
Authorization: Bearer <YOUR-JWT-TOKEN>
Content-Type: application/json
{
"name": "generate_report",
"options": {
"report_type": "gait"
},
"callback": "https://123-123-123-123-123.eu.ngrok.io/webhook"
}
Using curl, this would become
$ curl \
-H 'Ocp-Apim-Subscription-Key: <YOUR-API-KEY>' \
-H 'Authorization: Bearer <YOUR-JWT-TOKEN>' \
-H 'Content-Type: application/json' \
https://api.xsensmotion.cloud/task/v1/tasks \
-d '{
"name": "generate_report",
"options": {
"report_type": "gait"
},
"callback": "https://123-123-123-123-123.eu.ngrok.io/webhook"
}'
POST /task/v1/tasks HTTP/1.1
Ocp-Apim-Subscription-Key: <YOUR-API-KEY>
Authorization: Bearer <YOUR-JWT-TOKEN>
Content-Type: application/json
{
"name": "export_file",
"options": {
"trim": "framenr",
"start": 125,
"end": 625,
"output": "my_export.fbx",
"exporter": "fbx",
"customSettings": {
"walkOnTheSpot": 1,
"outputPreset": "Skeleton"
}
}
}
Using curl this would become:
$ curl \
-H 'Ocp-Apim-Subscription-Key: <YOUR-API-KEY>' \
-H 'Authorization: Bearer <YOUR-JWT-TOKEN>' \
-H 'Content-Type: application/json' \
https://api.xsensmotion.cloud/task/v1/tasks \
-d '{
"name": "export_file",
"options": {
"trim": "framenr",
"start": 125,
"end": 625,
"output": "my_export.fbx",
"exporter": "fbx",
"customSettings": {
"walkOnTheSpot": 1,
"outputPreset": "Skeleton"
}
}
}'
When you upload a file, you can (optionally) specify a specific task to execute. That way you don't have to run any actions manually. The task specification contains a callback, which will be called when the task has finished.
There is a multitude of task types. The generate_report
and export_file
tasks being the ones most interesting to use. The name field must contain the name of the task to execute, not a random name.
The response contains the uuid of the task, which should be used when uploading a file.
The full options that can be used in the Task API are available on the specification. Note that there is a correlation between the name and task options (i.e. generate_report corresponds with the GenerateReportTaskOptionsDto object only). The exporters use a customSettings field, which can be used to set the values of that specific exporter (fbx/bvh/mvnx/xlsx).
Exporting multiple files using a task is currently impossible. It can be achieved using the Export File API. You would upload the file with only a hd_reprocessing
task, after which multiple exports can be created.
In order to use the motion analysis functionality provided in the Xsens Motion Cloud you first have to upload an mvn or mvnx file. This happens via the open TUS protocol. You can upload a file with metadata, after which we will process your file into reports.
Our TUS server expects a user's bearer JWT token in the Authorization
header (see above).
In this example, we are using @trimm/tus-client to provide a client application. You can use any library that is using the TUS protocol, for an implementation list, see https://tus.io/implementations.html. In order to use this command, install node and npm package manager via nodejs.org.
$ npx @trimm/tus-client upload \
example.mvn \
https://upload.xsensmotion.cloud/api/v1/upload/mvn \
--headers authorization="Bearer <YOUR-JWT-TOKEN>"
With a predefined task:
npx @trimm/tus-client upload \
example.mvn \
https://upload.xsensmotion.cloud/api/v1/upload/mvn \
--headers authorization="Bearer <YOUR-JWT-TOKEN>" \
--meta "task_id=c255f430-03e7-42b1-990d-82cbc52bd055"
The generated reports are available as JSON files. You can retrieve the data from the report using the Report Data API. Use the report ID in the URL itself.
GET /report/v2/reports/e67b769b-8bca-42ef-a220-2445582a2fff/data HTTP/1.1
Ocp-Apim-Subscription-Key: <YOUR-API-KEY>
Authorization: Bearer <YOUR-JWT-TOKEN>
HTTP/1.1 302 Found
Content-Length: 313
Content-Type: text/plain; charset=utf-8
Location: https://xsecrpsa.blob.core.windows.net/export/b46f8fa5-e357-4108-b9a4-aaf483de8052?sv=2020-10-02&st=2022-07-13T10%3A44%3A54Z&se=2022-07-13T10%3A59%3A54Z&sr=b&sp=r&sig=Ia807En7Y6ja9AE%2FYuFYzuOg4N8lIZ6bD6%2BHel15CtQ%3D&rscd=attachment%3B%20filename%3D2b82ca55-9992-4fa7-935d-296f19a6383d.json
(...)
Motion Cloud Platform | Part of Xsens Technologies B.V.