-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYii.html
160 lines (160 loc) · 10.2 KB
/
Yii.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css" />
</head>
<body>
<div id="TOC">
<ul>
<li><a href="#yii2-starter-kit-api">Yii2 starter kit API</a><ul>
<li><a href="#articles">Articles</a><ul>
<li><a href="#get-articles-by-slug">Get Articles by slug</a></li>
<li><a href="#create-article">Create article</a></li>
<li><a href="#update-article">Update article</a></li>
<li><a href="#delete-article">Delete Article</a></li>
<li><a href="#get-article-by-id">Get Article by ID</a></li>
<li><a href="#get-all-articles">Get All Articles</a></li>
</ul></li>
<li><a href="#authorization">Authorization</a><ul>
<li><a href="#get-oauth-2.0-password-credentials-grant">Get OAuth 2.0 Password Credentials Grant</a></li>
<li><a href="#invalidate-oauth-token">Invalidate OAuth token</a></li>
</ul></li>
<li><a href="#pages">Pages</a><ul>
<li><a href="#get-pages-by-slug">Get Pages by slug</a></li>
<li><a href="#create-page">Create Page</a></li>
<li><a href="#update-page">Update page</a></li>
<li><a href="#delete-page">Delete page</a></li>
<li><a href="#get-page-by-id">Get page by ID</a></li>
<li><a href="#get-all-pages">Get All pages</a></li>
</ul></li>
<li><a href="#user">User</a><ul>
<li><a href="#create-user-copy">Create User copy</a></li>
</ul></li>
</ul></li>
</ul>
</div>
<h1 id="yii2-starter-kit-api">Yii2 starter kit API</h1>
<h2 id="articles">Articles</h2>
<h3 id="get-articles-by-slug">Get Articles by slug</h3>
<h4 id="request">request</h4>
<pre><code>GET http://api.yii2-starter-kit.dev/v1/article/search?slug=id-voluptas-ipsum-non-mollitia-magni</code></pre>
<h3 id="create-article">Create article</h3>
<h4 id="request-1">request</h4>
<pre><code>POST http://api.yii2-starter-kit.dev/v1/articles</code></pre>
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript"><span class="op">{</span>
<span class="st">"body"</span><span class="op">:</span> <span class="st">"Suscipit cum eos magnam ut. Adipisci doloribus tempore eligendi. Sit ratione expedita perferendis odit non."</span><span class="op">,</span>
<span class="st">"title"</span><span class="op">:</span> <span class="st">"Miss"</span><span class="op">,</span>
<span class="st">"category_id"</span><span class="op">:</span> <span class="dv">1</span><span class="op">,</span>
<span class="st">"id"</span><span class="op">:</span> <span class="dv">5</span><span class="op">,</span>
<span class="st">"slug"</span><span class="op">:</span> <span class="st">"new-slug"</span>
<span class="op">}</span></code></pre></div>
<h3 id="update-article">Update article</h3>
<h4 id="request-2">request</h4>
<pre><code>PUT http://api.yii2-starter-kit.dev/v1/articles/11</code></pre>
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript"><span class="op">{</span>
<span class="st">"body"</span><span class="op">:</span> <span class="st">"Suscipit cum eos magnam ut. Adipisci doloribus tempore eligendi. Sit ratione expedita perferendis odit non."</span><span class="op">,</span>
<span class="st">"category_id"</span><span class="op">:</span> <span class="dv">1</span><span class="op">,</span>
<span class="st">"slug"</span><span class="op">:</span> <span class="st">"old-slug"</span><span class="op">,</span>
<span class="st">"title"</span><span class="op">:</span> <span class="st">"Miss"</span>
<span class="op">}</span></code></pre></div>
<h3 id="delete-article">Delete Article</h3>
<h4 id="request-3">request</h4>
<pre><code>DELETE http://api.yii2-starter-kit.dev/v1/articles/11</code></pre>
<h3 id="get-article-by-id">Get Article by ID</h3>
<h4 id="request-4">request</h4>
<pre><code>GET http://api.yii2-starter-kit.dev/v1/articles/6</code></pre>
<h3 id="get-all-articles">Get All Articles</h3>
<h4 id="request-5">request</h4>
<pre><code>GET http://api.yii2-starter-kit.dev/v1/articles</code></pre>
<h2 id="authorization">Authorization</h2>
<h3 id="get-oauth-2.0-password-credentials-grant">Get OAuth 2.0 Password Credentials Grant</h3>
<h4 id="request-6">request</h4>
<pre><code>POST http://api.yii2-starter-kit.dev/v1/authorization/login</code></pre>
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript"><span class="op">{</span>
<span class="st">"username"</span><span class="op">:</span> <span class="st">"webmaster"</span><span class="op">,</span>
<span class="st">"client_secret"</span><span class="op">:</span> <span class="st">"client_secret"</span><span class="op">,</span>
<span class="st">"password"</span><span class="op">:</span> <span class="st">"webmaster"</span><span class="op">,</span>
<span class="st">"client_id"</span><span class="op">:</span> <span class="st">"client_name"</span>
<span class="op">}</span></code></pre></div>
<h3 id="invalidate-oauth-token">Invalidate OAuth token</h3>
<h4 id="request-7">request</h4>
<pre><code>POST http://api.yii2-starter-kit.dev/v1/authorization/logout</code></pre>
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript"><span class="op">{</span>
<span class="st">"username"</span><span class="op">:</span> <span class="st">"webmaster"</span><span class="op">,</span>
<span class="st">"client_secret"</span><span class="op">:</span> <span class="st">"client_secret"</span><span class="op">,</span>
<span class="st">"password"</span><span class="op">:</span> <span class="st">"webmaster"</span><span class="op">,</span>
<span class="st">"client_id"</span><span class="op">:</span> <span class="st">"client_name"</span>
<span class="op">}</span></code></pre></div>
<h2 id="pages">Pages</h2>
<h3 id="get-pages-by-slug">Get Pages by slug</h3>
<h4 id="request-8">request</h4>
<pre><code>GET http://api.yii2-starter-kit.dev/v1/page/search?slug=id-voluptas-ipsum-non-mollitia-magni</code></pre>
<h3 id="create-page">Create Page</h3>
<h4 id="request-9">request</h4>
<pre><code>POST http://api.yii2-starter-kit.dev/v1/pages</code></pre>
<h3 id="update-page">Update page</h3>
<h4 id="request-10">request</h4>
<pre><code>PUT http://api.yii2-starter-kit.dev/v1/pages/11</code></pre>
<h3 id="delete-page">Delete page</h3>
<h4 id="request-11">request</h4>
<pre><code>DELETE http://api.yii2-starter-kit.dev/v1/pages/11</code></pre>
<h3 id="get-page-by-id">Get page by ID</h3>
<h4 id="request-12">request</h4>
<pre><code>GET http://api.yii2-starter-kit.dev/v1/pages/6</code></pre>
<h3 id="get-all-pages">Get All pages</h3>
<h4 id="request-13">request</h4>
<pre><code>GET http://api.yii2-starter-kit.dev/v1/pages</code></pre>
<h2 id="user">User</h2>
<h3 id="create-user-copy">Create User copy</h3>
<h4 id="request-14">request</h4>
<pre><code>POST http://api.yii2-starter-kit.dev/v1/users</code></pre>
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript"><span class="op">{</span>
<span class="st">"username"</span><span class="op">:</span> <span class="st">"2xAsa2aaaai2A"</span><span class="op">,</span>
<span class="st">"password"</span><span class="op">:</span> <span class="st">"PEPAEPiEEP"</span><span class="op">,</span>
<span class="st">"email"</span><span class="op">:</span> <span class="st">"[email protected]"</span><span class="op">,</span>
<span class="st">"name"</span><span class="op">:</span> <span class="st">"ROMINA SUAREZ"</span>
<span class="op">}</span></code></pre></div>
</body>
</html>