Permalink
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (78 sloc) 2.78 KB
---
parent: apiv3
title: user profile
---
# User Profile <%= edit_link %>
Provides information about Users.
<%= partial 'partials/toc' %>
# Field Guide
Field | Type | Description
------------- | ------ | ------------
`id` | Number | The unique identifier reference to the resource
`username` | String | The username of the user
`type` | String | The type of the account. Possible values: `"skroutz"`, `"open_id"`, `"twitter"`, `"facebook"`, `"google"`
`sex` | String | `"male"` or `"female"` or `null`
`avatar` | String | URI of the avatar image of the user
`created_at` | String | Account creation date
`email` | String | The email of the user
`birthyear` | Number | The birthyear of the user
`mobile` | String | The mobile number of the user
`stats` | Hash | Review / comment related stats
`email_notifications` | Array | Available email preferences and their status
`is_staff` | String | True when user is a staff member
## Retrieve the profile of the authenticated user
<pre class="terminal">
GET /user
</pre>
<%= render_recording :user %>
## Update profile information
<pre class="terminal">
PATCH /user
</pre>
<%= render_recording :user_update %>
The avatar can be changed with the following 2 ways
`avatar_preset`: Filename from the avatar selection returned in the <%= link_to 'Avatars', '/api/v3/user', anchor: 'retrieve-the-selection-of-predefined-avatars' %> endpoint (ex: "avatar100.png").
`avatar`: Base64 form of an avatar image
> ##### Note
> You should not add the URI format preamble in the base64 version. (ex: data:image/gif;base64,)
## Retrieve the selection of predefined avatars
<pre class="terminal">
GET /user/avatars
</pre>
<%= render_recording :user_avatars %>
## Retrieve user addresses
<pre class="terminal">
GET /user/addresses
</pre>
<%= render_recording :user_addresses %>
## Retrieve user address form
<pre class="terminal">
GET /user/addresses/new
</pre>
<%= render_recording :user_addresses_new %>
## Create a new user address
<pre class="terminal">
POST /user/addresses
</pre>
<%= render_recording :user_addresses_create %>
## Update an existing user address
<pre class="terminal">
PUT /user/addresses/48937
</pre>
<%= render_recording :user_addresses_update %>
## Delete an existing user address
<pre class="terminal">
DELETE /user/addresses/48937
</pre>
<%= render_recording :user_addresses_destroy %>
## User saved orders
<pre class="terminal">
DELETE /user/saved_orders
</pre>
<%= render_recording :user_saved_orders %>
## User logout
<pre class="terminal">
DELETE /user/logout
</pre>
<%= render_recording :user_logout %>
Lets the server gracefully handle the logout process.