Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working example #14

Open
MrLuit opened this issue Apr 22, 2017 · 2 comments
Open

Working example #14

MrLuit opened this issue Apr 22, 2017 · 2 comments

Comments

@MrLuit
Copy link

MrLuit commented Apr 22, 2017

It looks like the latest version of this API doesn't work. If someone wants to fix it or still use the Find My iPhone api, here is a working example:

<?php
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$username = "";
$password = "";


$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://fmipmobile.icloud.com/fmipservice/device/$username/initClient");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "$username" . ":" . "$password");

$headers = array();
$headers[] = "Content-Type: application/json; charset=utf-8";
$headers[] = "X-Apple-Find-Api-Ver: 2.0";
$headers[] = "X-Apple-Authscheme: UserIdGuest";
$headers[] = "X-Apple-Realm-Support: 1.0";
$headers[] = "User-Agent: Find iPhone/1.3 MeKit (iPad: iPhone OS/4.2.1)";
$headers[] = "X-Client-Name: iPad";
$headers[] = "X-Client-Uuid: <insert client id here>";
$headers[] = "Accept-Language: en-us";
$headers[] = "Connection: keep-alive";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);

$result = json_decode($result,true)['content'];
foreach($result as $device) {
	print_r($device);
}
?>
@tomballgithub
Copy link

Thank You

@tomballgithub
Copy link

@MrLuit Any updates or does this still work? I am trying to switch to this method and getting 'Error:SSL certificate problem: unable to get local issuer certificate'. My other method recently stopped working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants