There's a new home for Articles. Find Articles on Our Product Support Page.
Is anybody out there who has already done a successful integration of MobiControl into ServiceNow to retrieve device information via the REST-API?
I need to use the API : PUT /devices/{deviceId}/customAttributes/{customAttributeId} This API requires the CustomAttribute ID as a parameter and I don't know where to find it. I tested the GET /customattributes API to get the ID, but it's not part of the response. I also poked around in the DataBase, but I don't see a table name that allows me to direct my search to the CustomAttributes to retrieve the IDs. Has anyone experienced this problem?
I'm writing a python script to automate the process of uploading our packages to SOTI. However, I am having difficulty sending the request to upload an Android APK file. here is my code for reference; file_name = 'com.aviagen.trapping.apk'encoded_file = ''with open(file_name, 'rb') as f: data = f.read() encoded_file = base64.b64encode(data)encoded_file = str(encoded_file, "utf-8")boundary = "mobicontrol_boundary"#part 1 - body parametersbody = f"--{boundary}\r\n"body = body + f"Content-Type: application/vnd.soti.mobicontrol.package.metadata+json\r\n\r\n"body = body + "{ 'DeviceFamily': 'AndroidPlus' }\r\n"#part 2 - file detailsbody = body + f"--{boundary}\r\n"body = body + f"Content-Type: application/vnd.soti.mobicontrol.package\r\n"body = body + f"Content-Type-Encoding: base64\r\n"body = body + "Content-Disposition: attachment; filename='com.aviagen.trapping.apk'\r\n"body = body + "\r\n"#part 3 - file contentbody = body + encoded_filebody = body + f"\r\n--{boundary}--\r\n"print(body)body = body.encode('utf-8')request = urllib.request.Request(f'{BASE_URL}/packages', data=body)request.add_header('Authorization', f'Bearer {token}')request.add_header('Content-Type', 'multipart/related; boundary=mobicontrol_boundary')response = urllib.request.urlopen(request)data = json.loads(response.read())response.close() This is resulting in an error - 422 (Unprocessable Entity).I have checked the file and can confirm that it is a valid signed apk which installs on my device. Is there something wrong with my request body? I saw a couple other examples of Package uploading, however they all use Powershell and I would very much like to avoid powershell at all costs.
Hi, I am trying to use the GET /devices/search endpoint. Does anyone know the syntax for the filter params and the key name for "Hardware Serial Number" ? The API doc also mentions that "=" are also retired from mobicontrol v 15. I have tried but so far have been unsuccessful. devices/search?filter=Hardware%20Serial%20Number%20%3D%20MYSERIALNUMBER (Hardware Serial Number = MYSERIALNUMBER) Thanks Adam
As the discussion thread REST API -Invalid grant started by Kurt Semba has already been locked by some Soti moderator, I'm left with no option but to add a new discussion thread as a continuation of that thread to post extra information related to the discussions posted.
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)
We are currently trying to automate the release process using the MobiControl API and we've encountered an issue where the Configurations in a Profile get lost when a new Profile Version is created via MobiControl/api/profiles/{referenceId}/packages Our automation process is roughly like this: Get a token.Send POST to MobiControl/api/tokenThis works. Upload a new version of our appSend POST to MobiControl/api/packagesThis works. Retrieve the Packages list for the Profile we want to updateSend GET to MobiControl/api/profiles/{$profileReferenceId}/packagesThis works. Update the Profile, using the list from the step before and updating our app version number to the latest but leaving other packages as isSend PUT to MobiControl/api/profiles/{$profileReferenceId}/packagesThis works BUT we cannot set the Profile Configurations and they do not seem to get copied like when we do this manually in MobiControl WebConsole by doing Edit on a Profile. Assign the Profile to a Device Group to push out the latest version of the appSend PUT to MobiControl/api/profiles/{$profileReferenceId}/assignment So this leaves us with some questions: - Is this a bug where the Profile Configurations don't get copied over to a new Version when using the API? - Is there any way to set the Profile Configurations using the API? Here is a screenshot of how the Profile looks before running the automation process: Here is a screenshot of how the Profile looks after running the automation process:
I have been reading through these forums and finding a lot of help regarding API request. So far I'm able to request my API token via PS and use it for device management! I need the proper syntax to SendMessage action so that I can send a message to all the devices in a specific group. Please provide the syntax. When I use the below it does not work - { "Action": "SendMessage"}
anyone knows how to get Location Devices with API for mobicontrol, there are any example about how to make it.?
Hello, Im looking for guidance and input if an API can be created to create a device add rule for Android Enterprise devices. The reason for this is simply to automate our enrollment process. Using a Service manger too where the user request to enroll a device and after approval an Enrollment URL is created. I have some API's already to gather information from devices but nothing this advance.
Hi, does anybody know how i will find out the profile reference ID in this section here?
Hi I'm trying to upload a package by using the MobiControl REST-API. Im using MobiControl Version 14.4.2.1307 The API call is described in https://serverurl/MobiControl/api/docs/index#!/Packages/Packages_CreateNewPackage Here's the request and MobiControls answer (Stirngs in Italic are replaced for privacy reasons): 2019-09-27 15:37:02,937 9768 DEBUG < POST /MobiControl/api/packages HTTP/1.1< Host: mobicontrolhostname.com< User-Agent: python-requests/2.22.0< Accept-Encoding: gzip, deflate< Accept: */*< Connection: keep-alive< Authorization: Bearer here_comes_the_bearer_token< Content-Type: multipart/related; boundary="===============0510829778131399783=="< MIME-Version: 1.0< Content-Length: 1231< < --===============0510829778131399783==Content-Type: application/vnd.soti.mobicontrol.package.metadata+jsonMIME-Version: 1.0{ "deviceFamily" : "AndroidPlus" }--===============0510829778131399783==Content-Type: application/vnd.soti.mobicontrol.packageMIME-Version: 1.0Content-Transfer-Encoding: base64AQMDKgThisIsShortenedF9Q==--===============0510829778131399783==--> HTTP/1.1 400 Bad Request> Content-Length: 186> Content-Type: application/json; charset=utf-8> Server: Microsoft-HTTPAPI/2.0> Date: Fri, 27 Sep 2019 13:37:54 GMT> { "$type": "ErrorDetails", "ErrorCode": 0, "Message": "Unexpected end of MIME multipart stream. MIME multipart message is not complete.", "Data": null, "HelpLink": null} I have shortened the package in the printout above and replaced the bearer token and hostname. The rest is untouched. I believe this should be a valid request or I am wrong? I also tried the example request in the API documentation but got the same answers. Any ideas?
Hi,Type: Android EnterpriseDevice: Zebra TC25How can I change the name of the devices that was already enrolled? By default, it is %autonum%, right now I want to map a person's name binded by device serial number.
All the syntax I have tried resulted in error. Anyone who know the correct value for parameters below? 1. Batch moving of devices 2. Create device group
Top-tier experts who are delivering outstanding content. Should have more than 7000 points.
Experts who are consistent with great content. Should have more than 1000 points
Highly experienced members with valuable inputs. Should have more than 700 points
Beginners taking the initiative. Should have more than 500 points