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

0 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

0 votes

Yes, it is.

The documentation on the API methods is available here: http://app.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 (13.2k points)
edited by
0 votes

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"

}

Response: 

200 OK

{

"id_token": "eyJhbGciOiJIUz..."

}

(a long token, few thousand of characters)

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 (13.2k points)
edited by
...