-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetapi.html
More file actions
45 lines (41 loc) · 1.2 KB
/
Copy pathgetapi.html
File metadata and controls
45 lines (41 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<title>Tesla API Token Retriever</title>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
JSONTest = function()
{
var resultDiv = $("#resultDivContainer");
$.ajax(
{
url: "https://owner-api.teslamotors.com/oauth/token",
type: "POST",
data: { grant_type: "password",
client_id: "e4a9949fcfa04068f59abb5a658f2bac0a3428e4652315490b659d5ab3f35a9e",
secret: "c75f14bbadc8bee3a7594412c31416f8300256d7668ea7e6e7f06727bfb9d220" },
email: "emailhere",
password: "passhere"
}
dataType: "json",
success: function (result)
{
switch (result)
{
case true:
processResponse(result);
break;
default:
resultDiv.html(result);
}
},
error: function (xhr, ajaxOptions, thrownError)
{
alert(xhr.status);
alert(thrownError);
}
});
};
</script>
</head>
<body>