app/views/api/api_docs/endpoints/users/_profile.html.erb
<h2>
<i class="material-icons <%= User.text_color %> left"><%= User.icon %></i>
Fetch a user's profile information
</h2>
<div class="row">
<div class="col s12 m6 l6">
<h3>Endpoint</h3>
<p class="code">
GET /api/v1/<%= User.name.downcase.pluralize %>/<span class="green-text"><id></span>
</p>
<h3>Example call</h3>
<ul class="collection">
<li class="collection-item">
<span class="title">
<strong>application_token</strong>
<span class="blue-text">string</span>
<span class="red-text">required</span>
</span>
<p>
The token for your application.
</p>
</li>
<li class="collection-item">
<span class="title">
<strong>authorization_token</strong>
<span class="blue-text">string</span>
<span class="red-text">required</span>
</span>
<p>
The authorization token for your user.
</p>
</li>
<li class="collection-item">
<span class="title">
<strong class="green-text">id</strong>
<span class="blue-text">integer</span>
<span class="red-text">required</span>
</span>
<p>
The ID of the <%= User.name.downcase %> you're fetching.
</p>
</li>
</ul>
</div>
<div class="col s12 m6 l6">
<h3>Example response</h3>
<p class="code">
{
"id": 1,
"name": "Alice Quinn",
"username": "@alice",
"meta": {
"referral_code": "ABCDEFGHI-JKLMNOP-QRSTUV-WXYZ",
"premium_active": true
},
"profile": {
"bio": "Just a small-town girl",
"interests": "cooking, going on walks, living life, magic",
"website": "http://www.example.com",
"inspirations": "old Lovecraft stories",
"other_names": "Allie",
"occupation": "I exist solely as an example in some API documentation",
"favorite": {
"author": "Oscar Wilde",
"genre": "Fantasy",
"book": "Harry Potter and the Sorcerer's Stone",
"quote": "This isn't even a real quote!",
"page_type": "Creature"
}
}
}
</p>
</div>
</div>