2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: Users
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
## Read user profile
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
GET /users/:username
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
On success:
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
200
|
|
|
|
{
|
|
|
|
'settings': {
|
|
|
|
'language': 'en',
|
|
|
|
'units': 'metric'
|
|
|
|
},
|
|
|
|
'patron': 0,
|
|
|
|
'bio': '',
|
|
|
|
'handle': 'rracx',
|
|
|
|
'username': 'admin',
|
|
|
|
'createdAt': '2019-08-12T07:40:32.435Z',
|
|
|
|
'updatedAt': '2019-08-12T09:23:48.930Z',
|
|
|
|
'pictureUris': {
|
|
|
|
'l': 'https://static.she.freesewing.org/users/r/rracx/rracx.svg',
|
|
|
|
'm': 'https://static.she.freesewing.org/users/r/rracx/rracx.svg',
|
|
|
|
's': 'https://static.she.freesewing.org/users/r/rracx/rracx.svg',
|
|
|
|
'xs': 'https://static.she.freesewing.org/users/r/rracx/rracx.svg'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
Load the profile data of a user. It expects one parameter in the URL of the `GET` request:
|
|
|
|
|
2021-10-17 18:26:00 +02:00
|
|
|
| Variable | Description |
|
|
|
|
|------------|-------------|
|
2021-08-25 16:09:31 +02:00
|
|
|
| `username` | The username of the user to load the profile data for |
|
|
|
|
|
|
|
|
## Is username availbable
|
2021-10-17 18:26:00 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
POST /available/username
|
|
|
|
{
|
|
|
|
username: 'username to check'
|
|
|
|
}
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
Username available:
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
200
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
Username not available:
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
400
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
## Patron list
|
|
|
|
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
GET /patrons
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
On success:
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
200
|
|
|
|
{
|
|
|
|
'2': [
|
|
|
|
],
|
|
|
|
'4': [],
|
|
|
|
'8': [
|
2021-08-25 16:09:31 +02:00
|
|
|
{
|
2021-10-17 18:26:00 +02:00
|
|
|
'handle': 'joost',
|
|
|
|
'username': 'joost',
|
|
|
|
'bio':"If something doesn't work around here, that's probably my fault",
|
|
|
|
'social': {
|
|
|
|
'twitter': 'j__st',
|
|
|
|
'instagram': 'joostdecock',
|
|
|
|
'github': 'joostdecock'
|
|
|
|
},
|
|
|
|
'pictureUris': {
|
|
|
|
'l': 'https://static.freesewing.org/users/j/joost/joost.jpg',
|
|
|
|
'm': 'https://static.freesewing.org/users/j/joost/m-joost.jpg',
|
|
|
|
's': 'https://static.freesewing.org/users/j/joost/s-joost.jpg',
|
|
|
|
'xs': 'https://static.freesewing.org/users/j/joost/xs-joost.jpg'
|
|
|
|
}
|
2021-08-25 16:09:31 +02:00
|
|
|
}
|
2021-10-17 18:26:00 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
- Retrieves the list of [FreeSewing patrons](https://freesewing.org/patrons).
|
|
|
|
- Returns an array per tier
|
2021-08-25 16:09:31 +02:00
|
|
|
|