Curl
Java
Python
Deluge
PowerShell
Copied!
curl --request POST \
--url https://appdomain/api/v1/mdm/devices/{device_id}/actions/enable_lost_mode \
--header 'Accept: application/json' \
--header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \
--header 'Content-Type: application/json' \
--data '{"send_email_to_user":"true","lock_message":"This device has been lost. Please contact the administrator.","send_email_to_admin":"true","lost_mode_title":"Device Lost","do_not_notify":"false","phone_number":"+1-555-0****00","audit_message":"Device reported lost by user","footnote":"Kindly contact administrator","ticket_id":"9007199254741090","passcode":"1234"}'import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.io.IOException;
import java.net.http.HttpTimeoutException;
public class Main {
public static void main(String[] args) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://appdomain/api/v1/mdm/devices/{device_id}/actions/enable_lost_mode"))
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("Authorization", " d92d4xxxxxxxxxxxxx15f52")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"send_email_to_user\":\"true\",\"lock_message\":\"This device has been lost. Please contact the administrator.\",\"send_email_to_admin\":\"true\",\"lost_mode_title\":\"Device Lost\",\"do_not_notify\":\"false\",\"phone_number\":\"+1-555-0****00\",\"audit_message\":\"Device reported lost by user\",\"footnote\":\"Kindly contact administrator\",\"ticket_id\":\"9007199254741090\",\"passcode\":\"1234\"}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
import http.client
conn = http.client.HTTPSConnection("appdomain")
payload = "{\"send_email_to_user\":\"true\",\"lock_message\":\"This device has been lost. Please contact the administrator.\",\"send_email_to_admin\":\"true\",\"lost_mode_title\":\"Device Lost\",\"do_not_notify\":\"false\",\"phone_number\":\"+1-555-0****00\",\"audit_message\":\"Device reported lost by user\",\"footnote\":\"Kindly contact administrator\",\"ticket_id\":\"9007199254741090\",\"passcode\":\"1234\"}"
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'Authorization': " d92d4xxxxxxxxxxxxx15f52"
}
conn.request("POST", "/api/v1/mdm/devices/{device_id}/actions/enable_lost_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
headersMap = Map();
headersMap.put("Content-Type", "application/json");
headersMap.put("Accept", "application/json");
data=Map();
data.put("phone_number","value");
data.put("lock_message","value");
data.put("lost_mode_title","value");
data.put("footnote","value");
data.put("audit_message","value");
data.put("ticket_id","value");
data.put("send_email_to_user",true);
data.put("send_email_to_admin",true);
data.put("passcode","value");
data.put("do_not_notify",true);
response = invokeUrl
[
url: "https://appDomain/api/v1/mdm/devices/{device_id}/actions/enable_lost_mode"
type: POST
headers: headersMap
body: data
connection: connection_name
]
info response;
$headers=@{}
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", " d92d4xxxxxxxxxxxxx15f52")
$response = Invoke-WebRequest -Uri 'https://appdomain/api/v1/mdm/devices/{device_id}/actions/enable_lost_mode' -Method POST -Headers $headers -ContentType 'application/json' -Body '{"send_email_to_user":"true","lock_message":"This device has been lost. Please contact the administrator.","send_email_to_admin":"true","lost_mode_title":"Device Lost","do_not_notify":"false","phone_number":"+1-555-0****00","audit_message":"Device reported lost by user","footnote":"Kindly contact administrator","ticket_id":"9007199254741090","passcode":"1234"}'Enable lost mode with contact details
Copied!
{
"send_email_to_user": "true",
"lock_message": "This device has been lost. Please contact the administrator.",
"send_email_to_admin": "true",
"lost_mode_title": "Device Lost",
"do_not_notify": "false",
"phone_number": "+1-555-0****00",
"audit_message": "Device reported lost by user",
"footnote": "Kindly contact administrator",
"ticket_id": "9007199254741090",
"passcode": "1234"
}
▼ Show full