-
Notifications
You must be signed in to change notification settings - Fork 0
/
ig_basic_display_api.html
81 lines (71 loc) · 3.47 KB
/
ig_basic_display_api.html
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
<body>
<main>
<div class="container">
<h1>Instagram Basic Display API Authorization</h1>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="./">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Instagram Basic Display API Authorization</li>
</ol>
</nav>
<section>
<h2>Step 1: Authorize with Instagram</h2>
<p>If you are not currently logged into Instagram you will be prompted to do so. You will be redirected to back to this page when you've finished authorizing. A code will be made available in Step 2.</p>
<p>By authorizing, you are giving access to your user profile and user media:</p>
<p>
<a href="https://api.instagram.com/oauth/authorize?client_id=572672826710523&redirect_uri=https%3A%2F%2Ffadedsky.github.io%2Fig_basic_display_api&response_type=code&scope=user_profile%2Cuser_media">Authorize with Instagram</a>
</p>
</section>
<section>
<h2>Step 2: Copy the code received from your authorization</h2>
<p>
Place the code in your website settings in order to generate an access token automatically.
<strong>The code is only valid for 1hr.</strong>
</p>
<div class="card">
<h3 class="card-header">
Code
</h3>
<div class="card-body">
<span id="code">(Pending authorization)</span>
</div>
<div class="card-footer">
<strong>Expires in:</strong> <span id="expires">1 hr</span>
</div>
</div>
</section>
</div>
</main>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<script>
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
};
var code = getUrlParameter('code')
$('#code').text(code)
</script>
</body>
</html>