Welcome to Headwind MDM Q&A, where you can ask questions and receive answers from other members of the community.

Please do not post bug reports, missing feature requests, or demo inquiries. If you have such an inquiry, submit a contact form.

+2 votes
I'd like to integrate Headwind MDM with my web application and I need some data from Headwind MDM tables. Is there any REST API?
by

2 Answers

+2 votes

Yes, it is.

The documentation on the API methods is available here: https://srv.h-mdm.com/swagger-ui/

Headwind MDM REST API uses token-based authorization mechanism (JWT).

To get a token, you need to authenticate by the user's login and password (use /public/jwt/login method). 

The token should be sent in all subsequent methods in the Authorization HTTP attribute:

Authorization: Bearer place_token_here

by (37.6k points)
edited by
+1 vote

To authorize in the REST API, use /public/jwt/login method and send the username and MD5 hash of the password.

Here's a sample REST API authorization flow.

1. Authorization

Request:

POST https://your-mdm.com/rest/public/jwt/login

Content-Type: application/json

{

    "login": "admin",

    "password": "21232F297A57A5A743894A0E4A801FC3"

}

Important notice: the MD5 hash should be uppercase!

Response: 

200 OK

{

"id_token": "eyJhbGciOiJIUz..."

}

2. Authorized REST API request

Add the "Authorization" HTTP header.

POST https://your-mdm.com/rest/private/devices/search

Content-Type: application/json

Authorization: Bearer eyJhbGciOiJIUz...

{

  "pageSize": 1000000,

  "pageNum": 1

}

This will return you the whole list of available devices (the default page size is 100 so you need to specify a larger number to get all devices).

The token lifetime is limited (1 day), so you need to resend the authorization request if you get a 401 error.

by (37.6k points)
edited by
...