Users API
Get a single user
GET /api/v1/users/:id.json
Parameters:
- id
-
Required Integer identifier of user.
Response:
{
"user": {
"name": "user name",
"email": "user email",
"language": "user language",
"professional_experience": "user professional experience",
"site": "user site",
"company": "user company",
"location": "user location",
"id": "user id",
"uname": "user uname",
"own_projects_count": "count of own projects",
"build_priority": "build priority",
"created_at": "user created at",
"updated_at": "user updated_at",
"avatar_url": "avatar url",
"url": "api user path",
"html_url": "html user path"
}
}
Example:
{
"user": {
"id": 1,
"name": "Ivan Aivazovsky",
"uname": "ivan_aivazovsky",
"email": "ivan_aivazovsky@test.com",
"language": "ru",
"own_projects_count": 3,
"professional_experience": "software developer",
"site": "http://abf.rosalinux.ru/",
"company": "ROSA, CJSC",
"location": "Saint Petersburg",
"avatar_url": "avatar url",
"build_priority": 50,
"created_at": 1349357795,
"updated_at": 1349358084,
"url": "/api/v1/users/1.json",
"html_url": "/ivan_aivazovsky"
}
}
Get a current user
GET /api/v1/user.json
Response:
{
"user": {
"user": {
"name": "user name",
"email": "user email",
"language": "user language",
"professional_experience": "user professional experience",
"site": "user site",
"company": "user company",
"location": "user location",
"id": "user id",
"uname": "user uname",
"own_projects_count": "count of own projects",
"build_priority": "build priority",
"created_at": "user created at",
"updated_at": "user updated_at",
"avatar_url": "avatar url",
"url": "api user path",
"html_url": "html user path"
},
"role": "user role (nil/admin/tester/system)"
}
}
Example:
{
"user": {
"user": {
"id": 1,
"name": "Ivan Aivazovsky",
"uname": "ivan_aivazovsky",
"email": "ivan_aivazovsky@test.com",
"language": "ru",
"own_projects_count": 3,
"professional_experience": "software developer",
"site": "http://abf.rosalinux.ru/",
"company": "ROSA, CJSC",
"location": "Saint Petersburg",
"avatar_url": "avatar url",
"build_priority": 50,
"created_at": 1349357795,
"updated_at": 1349358084,
"url": "/api/v1/users/1.json",
"html_url": "/ivan_aivazovsky"
},
"role": ""
}
}
Update a current user
PUT /api/v1/user.json
- name:
-
Optional String user name.
- email:
-
Optional String user email.
- language:
-
Optional String user language (
ru
or en
).
- professional_experience:
-
Optional String user professional experience.
- site:
-
Optional String user site.
- company:
-
Optional String user company.
- location:
-
Optional String user location.
Request:
{
"user": {
"name": "user name",
"email": "user email",
"language": "user language",
"professional_experience": "user professional experience",
"site": "user site",
"company": "user company",
"location": "user location"
}
}
Response:
{
"user": {
"id": "user id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"user": {
"id": 56,
"message": "User has been updated successfully"
}
}
Get a notification settings of a current user
GET /api/v1/user/notifiers.json
Response:
{
"user": {
"id": "user id",
"notifiers": {
"can_notify": "notifications by email",
"new_comment_commit_owner": "notify about comments to my commit",
"new_comment_commit_repo_owner": "notify about comments to my repository commits",
"new_comment_commit_commentor": "notify about comments after my commit",
"new_comment": "new task comment notifications",
"new_comment_reply": "new reply of comment notifications",
"new_issue": "new task notifications",
"issue_assign": "new task assignment notifications",
"new_build": "notify about my build tasks",
"new_associated_build": "notify about associated with me build tasks"
}
},
"url": "user notification settings path"
}
Example:
{
"user": {
"id": 5,
"notifiers": {
"can_notify": true,
"new_comment_commit_owner": true,
"new_comment_commit_repo_owner": false,
"new_comment_commit_commentor": true,
"new_comment": true,
"new_comment_reply": true,
"new_issue": true,
"issue_assign": true,
"new_build": true,
"new_associated_build": false
}
},
"url": "/api/v1/user/notifiers.json"
}
Update a notification settings for a current user
PUT /api/v1/user/notifiers.json
- can_notify:
-
Optional Boolean notifications by email.
- new_comment_commit_owner:
-
Optional Boolean notify about comments to my commit.
- new_comment_commit_repo_owner:
-
Optional Boolean notify about comments to my repository commits.
- new_comment_commit_commentor:
-
Optional Boolean notify about comments after my commit.
- new_comment:
-
Optional Boolean new task comment notifications.
- new_comment_reply:
-
Optional Boolean new reply of comment notifications.
- new_issue:
-
Optional Boolean new task notifications.
- issue_assign:
-
Optional Boolean new task assignment notifications.
- new_build:
-
Optional Boolean notify about my build tasks.
- new_associated_build:
-
Optional Boolean notify about associated with me build tasks.
Request:
{
"notifiers": {
"can_notify": true,
"new_comment_commit_owner": true,
"new_comment_commit_repo_owner": false,
"new_comment_commit_commentor": true,
"new_comment": true,
"new_comment_reply": true,
"new_issue": true,
"issue_assign": true,
"new_build": true,
"new_associated_build": false
}
}
Response:
{
"user": {
"id": "user id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"user": {
"id": 56,
"message": "User notification settings have been updated successfully"
}
}