Hi all,
I have a demo cloud account for MobiControl and am trying to authenticate against the REST API. But I cannot get the token as the API response is:
b'{"error":"invalid_grant"}'
Here is my Python code:
import requests from requests.auth import HTTPBasicAuth
clientId = "43d..." clientSecret = "Lo6..." clientAuth = HTTPBasicAuth(clientId, clientSecret)
username = "ksemba@demo.com" userpassword = "thepassword" payload = "grant_type=password&username=" + \ username + "&password=" + userpassword
tokenURL = "https://s115236.mobicontrolcloud.com/MobiControl/api/token" headers = {"Content-Type": "application/x-www-form-urlencoded"}
r = requests.post(tokenURL, headers=headers, auth=clientAuth, data=payload) print(r.content)
