Skip to content

User


Description of the JSON object structure describing a user

Field Type Description
id string Unique user ID
username string User alias
name string User's first name
surname string User's last name
email string User's email (field available only for the /user/me method)
fullName string User's full name
avatar string Link to user's avatar
cover string Link to user's cover image

You can view the structure of the JSON object describing a project here


Method to get the list of all users

GET /user

The request returns an array of users, with the ability to configure the number of objects displayed per page

Responses

STATUS 200 example JSON:

Example response
    
{
    "_embedded": {
        "userList": [
            {
                "id": "7cda0fdc-aaaa-aaaa-aaaa-6b0bfe8bbddf",
                "username": "user1",
                "name": "name",
                "surname": "surname",
                "fullName": "name surname",
                "avatar": "https://gitflic.ru/upload/img/4427cf28-aaaa-aaaa-aaaa-8ee5e6b3a467.jpg",
                "cover": "/upload/img/3b7780f1-aaaa-aaaa-aaaa-97e55d7bbdbb.jpg"
            },
            {
                "id": "166e63d7-aaaa-aaaa-aaaa-e46b43e29c21",
                "username": "user2",
                "name": "name",
                "surname": "surname",
                "fullName": "name surname",
                "avatar": "https://gitflic.ru/upload/img/197869df-aaaa-aaaa-aaaa-d2442372699c.jpg",
                "cover": "/upload/img/33fxd0r1-aaaa-aaaa-aaaa-9e7er56jtdbb.jpg"
            },
            {
                "id": "03105a7f-aaaa-aaaa-aaaa-e87cd6ee60b2",
                "username": "user3",
                "name": "name",
                "surname": "surname",
                "fullName": "name surname",
                "avatar": "https://gitflic.ru/upload/img/17e7bcfe-aaaa-aaaa-aaaa-aabce41d7259.jpg",
                "cover": "/upload/img/23d7g0d1-aaaa-aaaa-aaaa-tf45gd7ftd6b.jpg"
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 3,
        "totalPages": 1,
        "number": 0
    }
}
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method to get the current user

GET /user/me

The request returns the current user

Responses

STATUS 200 example JSON:

Example response
    
{
    "id": "fbc3d462-aaaa-aaaa-aaaa-6990c978d786",
    "username": "user1",
    "name": "name",
    "email": "email@email.ru"
    "surname": "surname",
    "fullName": "name surname",
    "avatar": "https://gitflic.ru/upload/img/2731a61f-aaaa-aaaa-aaaa-a5ac13429653.jpg",
    "cover": "/upload/img/3b7780f1-aaaa-aaaa-aaaa-97e55d7bbdbb.jpg"
}
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method to get a user by alias

GET /user/{userAlias}

The request returns a user

Path variable Type Description
userAlias string User alias

Responses

STATUS 200 example JSON:

Example response
    
{
    "id": "fbc3d462-aaaa-aaaa-aaaa-6990c978d786",
    "username": "user2",
    "name": "name",
    "surname": "surname",
    "fullName": "name surname",
    "avatar": "https://gitflic.ru/upload/img/2731a61f-aaaa-aaaa-aaaa-a5ac13429653.jpg",
    "cover": "/upload/img/3b7780f1-aaaa-aaaa-aaaa-97e55d7bbdbb.jpg"
}
        
    

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method to get user's public projects

GET /user/{userAlias}/projects

The request returns the user's public projects

Path variable Type Description
userAlias String User alias

Responses

STATUS 200 example JSON:

Example response
    
{
    "_embedded": {
        "projectList": [
            {
                "id": "f3f322a8-aaaa-aaaa-aaaa-9b163a505a79",
                "title": "test-project",
                "description": "",
                "alias": "test-project",
                "ownerAlias": "test",
                "httpTransportUrl": "https://gitflic.ru/project/test/test-project.git",
                "sshTransportUrl": "git@gitflic.ru:test/test-project.git",
                "language": "Markdown",
                "selectorTitle": "test-project",
                "private": false,
                "selectorOwnerAlias": "test",
                "selectorId": "f3f322a8-aaaa-aaaa-aaaa-9b163a505a79",
                "selectorAlias": "test-project",
                "isDeleted": false,
                "hexColor": null,
                "selectorColor": null,
                "selectorHash": null
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 1,
        "totalPages": 1,
        "number": 0
    }
}
        
    

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method to get user's followers

GET /user/{userAlias}/followers

The request returns the user's followers

Path variable Type Description
userAlias string User alias

Responses

STATUS 200 example JSON:

Example response
    
{
    "content": [
        {
            "name": Name,
            "id": 1,
            "fullName": "Name Surname",
            "avatar": "/upload/img/6ebb3414-aaaa-aaaa-aaaa-e250f5c5d80c.jpg",
            "username": "test",
            "company": null,
            "surname": Surname,
            "createdAt": "2023-03-07T15:21:49.405942",
            "registrationDateString": "March 7, 2023",
            "subscribed": false
        }
    ],
    "pageable": {
        "sort": {
            "empty": false,
            "unsorted": false,
            "sorted": true
        },
        "offset": 0,
        "pageNumber": 0,
        "pageSize": 12,
        "paged": true,
        "unpaged": false
    },
    "last": true,
    "totalElements": 1,
    "totalPages": 1,
    "size": 12,
    "number": 0,
    "sort": {
        "empty": false,
        "unsorted": false,
        "sorted": true
    },
    "first": true,
    "numberOfElements": 1,
    "empty": false
}
        
    

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method to get user's subscriptions

GET /user/following/{userAlias}

The request returns the users that the specified user is following

Path variable Type Description
userAlias string User alias

Responses

STATUS 200 example JSON:

Example response
    
{
    "content": [
        {
            "name": Name,
            "id": 1,
            "fullName": "Name Surname",
            "avatar": "/upload/img/6ebb3414-aaaa-aaaa-aaaa-e250f5c5d80c.jpg",
            "username": "test",
            "company": null,
            "surname": Surname,
            "createdAt": "2023-03-07T15:21:49.405942",
            "registrationDateString": "March 7, 2023",
            "subscribed": false
        }
    ],
    "pageable": {
        "sort": {
            "empty": false,
            "unsorted": false,
            "sorted": true
        },
        "offset": 0,
        "pageNumber": 0,
        "pageSize": 12,
        "paged": true,
        "unpaged": false
    },
    "last": true,
    "totalElements": 1,
    "totalPages": 1,
    "size": 12,
    "number": 0,
    "sort": {
        "empty": false,
        "unsorted": false,
        "sorted": true
    },
    "first": true,
    "numberOfElements": 1,
    "empty": false
}
        
    

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.

Automated translation!

This page was translated using automatic translation tools. The text may contain inaccuracies.