-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
163 lines (134 loc) · 5.53 KB
/
index.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>Recognize.github.io by Recognize</title>
</head>
<body>
<div id="container">
<div class="inner">
<header>
<h1>Recognize.github.io</h1>
<h2></h2>
</header>
<section id="downloads" class="clearfix">
<a href="https://github.com/Recognize" id="view-on-github" class="button"><span>View on GitHub</span></a>
</section>
<hr>
<section id="main_content">
<h1>
<a name="recognize-api-summary" class="anchor" href="#recognize-api-summary"><span class="octicon octicon-link"></span></a>Recognize Api Summary</h1>
<p>The Recognize api provides the following: </p>
<ul>
<li>Basic access to user profile information.</li>
<li>Ability to view a users recognitions</li>
<li>Send recognitions on behalf of a user</li>
<li>Approve (+1 a recognition), or "unapprove" (removing a +1 from a recognition) a recognition.</li>
</ul><p>Users authenticate access for each application using the 2-legged OAuth flow.</p>
<h2>
<a name="base-endpoint" class="anchor" href="#base-endpoint"><span class="octicon octicon-link"></span></a>Base Endpoint</h2>
<p><a href="http://recognizeapp.com/api/v1/">http://recognizeapp.com/api/v1/</a></p>
<h2>
<a name="endpoint-overview" class="anchor" href="#endpoint-overview"><span class="octicon octicon-link"></span></a>Endpoint overview</h2>
<pre><code>GET /status # Check authentication status
GET /recognitions # Get all recognitions for your company
GET /[email protected] # Get all recognitions for a user
GET /recognitions/new # Returns a url to fetch html for send recognition form
POST /recognitions/:slug/approvals # +1(approve) a recognition
DELETE /recognitions/:slug/approvals # Remove the +1 for a recognition
GET /badge/:badge_id # Get more detailed information on a badge
</code></pre>
<h3>
<a name="authentication-example-in-ruby" class="anchor" href="#authentication-example-in-ruby"><span class="octicon octicon-link"></span></a>Authentication Example in Ruby</h3>
<pre><code>require 'oauth2'
redirect_uri = "http://yoursite.com/auth/recognize/callback"
client = OAuth2::Client.new(<APPLICATION_ID>, <APPLICATION_SECRET>, site: "https://recognizeapp.com")
client.auth_code.authorize_url(:redirect_uri => redirect_uri)
</code></pre>
<p>Visit authorize url in a browser and follow the flow until you get sent to your callback url.
Find authorization code in url for next step.</p>
<pre><code>token = client.auth_code.get_token(<authorization_code>, redirect_uri: redirect_uri).
</code></pre>
<p>Visit:</p>
<pre><code>https://recognizeapp.com/api/v1/ping?access_token=<token>
</code></pre>
<p>Access token can also be sent as a header:</p>
<pre><code>Authorization: Bearer <token>
</code></pre>
<h3>
<a name="users-path-users" class="anchor" href="#users-path-users"><span class="octicon octicon-link"></span></a>Users (Path: /users)</h3>
<pre><code>/users
{
"users": [
{
"id": 2,
"email": "[email protected]",
"first_name": "Alex",
"last_name": "Grande",
"full_name": "Alex Grande",
"company_name": "Recognizeapp",
"yammer_id": "1489441844",
"avatar_thumb_url": "\/uploads\/development\/avatar_attachment\/9517\/file\/thumb_avatar.jpg"
}
]
}
</code></pre>
<h3>
<a name="recognitions-path-recognitions" class="anchor" href="#recognitions-path-recognitions"><span class="octicon octicon-link"></span></a>Recognitions (Path: /recognitions)</h3>
<pre><code>/recognitions
{
"recognitions": [
{
"id": 11367,
"message": "For showing leadership in starting recognition.",
"slug": "17pr8evjcp9",
"created_at": "2014-05-20 12:45:07 -0700",
"badge_name": "Ambassador",
"badge_permalink": "\/uploads\/development\/badge\/32\/image\/large_thumb_ambassador.png",
"recipients": [
{
"id": 11667,
"email": "[email protected]",
"first_name": "Peter",
"last_name": "Philips",
"full_name": "Peter Philips",
"company_name": "Ad Recognizeapp",
"avatar_thumb_url": "\/assets\/icons\/user-default.png",
"yammer_id": ""
}
],
"approvers": [
],
"sender": {
"id": 1,
"email": "[email protected]",
"first_name": "Recognize",
"last_name": "Team",
"full_name": "Recognize Team",
"company_name": "Recognizeapp",
"yammer_id": "",
"avatar_thumb_url": "\/uploads\/development\/avatar_attachment\/33\/file\/thumb_logo_180x180.png"
},
"permalink": "http:\/\/localhost:3000\/recognitions\/17pr8evjcp9",
"system_recognition?": "true",
"friendly_created_at": "about 10 hours ago",
"approvals_count": 0
},
}
</code></pre>
</section>
<footer>
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.
</footer>
</div>
</div>
</body>
</html>