Community - SOTI MobiControl

Community - SOTI MobiControl

There's a new home for Articles. Find Articles on Our Product Support Page.

SOTI MobiControl Discussions


  • 0 votes 3 answers

    How to get Location device with API for Mobicontrol Solved Locked

    anyone  knows how  to get   Location Devices with   API for mobicontrol,  there  are  any  example   about  how  to make it.?

    SOTI MobiControl
    5 years ago
  • 0 votes 4 answers

    Rest API To Create Device Add Rule

    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. 

    SOTI MobiControl
    6 years ago
  • 0 votes 4 answers

    API Search for Custom Attributes Solved Locked

    I am trying to search for devices using the REST API. Searching for things like  DeviceId, MACAddress, and Model are pretty straight forward. Howerver I don't understand how to search for CustomAttributes. The API Reference shows:  The custom attribute I want to search for looks like this: I was thinking it should look like this, but it doesn't work: CustomAttributes=[{'Name'}:{'Assigned Site Number'},{'Value'}:{'209'}] Does Any have an example of what my filter parameter should look like?

    SOTI MobiControl
    6 years ago
  • 0 votes 3 answers

    Device Renaming with PowerShell API

    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'm fairly new to using API calls in PS and I can't seem to get around renaming a device.  I' almost certain the issue is with how I'm using the -Body portion of the PS code.  Here is what I have so far: #ALLOWS USER INPUT OF DEVICE NAME [void][Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') $title = 'Device Rename'$msg = 'Enter New Device Name:'$Input = [Microsoft.VisualBasic.Interaction]::InputBox($msg, $title) $Header2 = @{}$Header2["Authorization"] = "Bearer " + $Token try{$response2 = Invoke-restmethod -ContentType "application/json" -Uri https://$MCFQDN/mobicontrol/api/devices/$DevID/actions -Method POST -Headers $Header2 -Body {\"Action\": \"Rename\",\"Name\" : \"$Input\"} }catch{$($_.Exception.Message)} As stated, I think the -Body section is where I'm failing, not sure how to convert the curl request to a body in PowerShell. Greatly appreciate any help!

    Windows
    6 years ago
  • 0 votes 4 answers

    Upload package with REST-API fails Solved Locked

    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?

    SOTI MobiControl
    6 years ago
  • 0 votes 3 answers

    MobiControl 13.4 - syntax to delete Device ID via Powershell script Solved

    Trying to automate device deletion on 13.4 using the invoke-restmethod API script provided here (which currently works for me for folder/group creation) https://discussions.soti.net/thread/using-powershell-to-make-api-calls/ I can currently delete the deviceID via API rest interface, with no issues: Curl: curl -X DELETE --header -Authorization: Bearer XYZ123 Request URL: https://servername:443/MobiControl/api/devices/DEVICEID Response Body: no content Response Code: 204 However when trying to use the same 'Invoke-RestMethod' method to delete the same Request URL, I receive a message of 'The underlying connection was closed: An unexpected error occurred on a send'.  Can someone from SOTI confirm what the correct syntax should be for a request like this?  

    SOTI MobiControl
    6 years ago
  • 0 votes 6 answers

    What global permissions are required for profiles PUT request?

    I am trying to use the SOTI API to update packages in profiles and assign them to devices. Using PUT  /profiles/{referenceId}/packages and PUT  /profiles/{referenceId}/assignment our user has the "View profiles" and "Manage profiles" permission as well as "View and deploy packages" and "Manage packages" but we get response using Powershell System.Net.WebException: The remote server returned an error: (405) Method Not Allowed.

    Android
    6 years ago
  • 0 votes 4 answers

    Configuring access to SOTI API Solved Locked

    We used the tool and ran the command MCAdmin.exe APIClientAdd -n:[ANY_NAME_YOU_WANT] we are using the SOTI admin account with these ClientId and ClientSecret Using the Swagger page we are still unable to query the API, we are getting a 401 unauthorised We attempted to use the powershell script in: https://discussions.soti.net/thread/api-call-via-power-shell-to-send-script/ and that returns us a code 400 Any help would be appreciated, thanks.

    SOTI MobiControl
    6 years ago
  • 0 votes 4 answers

    Uploading Packages via API Solved Locked

    I'm trying to simplify the upload of Packages using the API but can't seem to get it to work. I'm trying to code this in Powershell and a snippet of this code is below: $MCFQDN = "SERVER.LOCATION" Get-MobiControlToken $response = ""$APIURL = "https://$MCFQDN/MobiControl/api/packages"$filename = "c:\Temp\PackageName.pcg" $Header = @{}$Header["Authorization"] = "Bearer " + $Token$Header["Accept"] = "application/json" try {    $response = Invoke-RestMethod -Uri $APIURL -ContentType "multipart/related;" -Method POST -InFile $filename -Headers $Header    $response}catch {    $($_.Exception.Message)} The Get-MobiControl function works without issue, but each time I run this script I get a 415 error stating "Unsupported media type provided. Expected media type is multipart/related" but I have defined that. I've also tried defining it in the header instead. Is there something glaringly obvious I'm missing? Thanks in advance.

    SOTI MobiControl
    6 years ago
  • 0 votes 2 answers

    Example calling API using JavaScript Solved Locked

    Looking for examples of authenticating and calling the API using JavaScript.

    SOTI MobiControl
    6 years ago
  • 0 votes 6 answers

    Automating Group Creation (with Custom Attributes) and Device Relocation Rules Solved

    I'm trying to find SOTI documentation on building a group with the following requirements: 1) Create a net new Device Group for a specific hardware type 2) Create a sub group for each Province in Canada 3) Create further sub groups for each location within each Province 4) Each group location must contain pre-defined Custom Attributes. Location #, language EN or FR etc..... 5) The Device Relocation Rules contain a specific IP address range and target a unique group The above must exist in our Dev, QA and PROD environments.  Due to the volume of groups to be created, we are looking to automate this process and avoid creating thousands of manual tasks.  I've seen some references to creating this using API calls, however I haven't found anything specific to what we need to create. 

    SOTI MobiControl
    6 years ago
  • 0 votes 2 answers

    Report Target Device Groups for all profiles

    Hi, is there a way to generate a report which shows the "Target Device Groups" for all profiles in one view? (preferably automated via the MobiControl API) br,Steven

    SOTI MobiControl
    6 years ago
  • 0 votes 1 answer

    How to format action parameters in REST API calls

    Hey guys! I am trying to send a message to a windows desktop legacy device and am having trouble with the body. I am "Trying it Out!" on the api site https://xxxxxxx.mobicontrolcloud.com/MobiControl/api.  Method 1 { "Action": "SendMessage","Message": "Hey There!","DisplayDuration": "NO_TIMER","MessageType": "3"}  Method 2  {"Action": "SendScript","Message": "showmessagebox 'This is a test message with Yes/No button and no timer' NO_TIMER 2"} Both are not working. Client ID, Client Secret, Username, Password, and Device ID are configured correctly. What am I doing wrong? Thank you for your help!

    Windows
    7 years ago
  • 0 votes 3 answers

    Revoke a Certificate using API - "ErrorCode": 3500, "Message": "Certificate action failed.",

    Good Afternoon Everyone, I'm currently trying to remove certificates that were installed by our old MDM system via the API as they're causing issues with Exchange Email configuration. I'm getting an error that appears to be from MobiControl rather than a generic Rest API error but I can't find anything about it in any MobiControl documentation. The error is: Invoke-restmethod : {"$type": "ErrorDetails","ErrorCode": 3500,"Message": "Certificate action failed.","Data": [],"HelpLink": null} The script I'm running is: $MCFQDN = "https://SERVERURL/mobicontrol/api/devices/$DeviceId/certificates/$CertificateID/actions" $Body = @{"ActionKind" = "Revoke" } $Header = @{Authorization = "Bearer $token"} try{$response = Invoke-restmethod -Uri $MCFQDN -Method POST -Headers $Header -Body (ConvertTo-Json $Body) -ContentType "application/json"}catch{$($_.Exception.Message)} Does anyone have any idea what the issue might be? I'm tried removing a certificate managed by MobiControl as well and got the same error. Thanks!

    Android
    7 years ago
  • 0 votes 3 answers

    BadRequest at token creation

    Hi, we try to get a access token für the soti api with a rest call. But unfortunatly we get everytime a "Bad Request"  Our code is: var url = "https://soti.corp.bestsecret.com/MobiControl/api/token";var urlParameters = "?grant_type=password&username=user&password=pw&scope=&client_id=id&client_secret=secret";var httpClient = new HttpClient();httpClient.BaseAddress = new Uri(url);httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));HttpResponseMessage response = httpClient.GetAsync(urlParameters).Result;

    SOTI MobiControl
    7 years ago

Top 3 Contributors of The Week

View All

No top contributors this period.

Earn Contributor Badge

More info
  • Diamond
    Diamond New

    Top-tier experts who are delivering outstanding content. Should have more than 7000 points.

  • Platinum
    Platinum

    Experts who are consistent with great content. Should have more than 1000 points.

  • Gold
    Gold

    Highly experienced members with valuable inputs. Should have more than 700 points.

  • Silver
    Silver

    Beginners taking the initiative. Should have more than 500 points.

  • Bronze
    Bronze New

    New contributors starting their journey. Should have more than 250 points.