Files
api/v1/swagger.yml

709 lines
16 KiB
YAML

swagger: '2.0'
info:
description: |
HRBox integration app API
x-hrbox-client-id: {clientId}
x-hrbox-client-secret: {secretKey}
{clientId} - client id
{secretKey} - secret key
version: 2.0.0
title: HRbox Integration API
contact:
email: yuriy@hrbox.io
# host: api.hrbox.io
# basePath: /api/v1
tags:
- name: user-group
description: User groups
- name: user-status
description: User statuses
# schemes:
# - http
paths:
/user-group:
get:
tags:
- user-group
summary: Get user groups
operationId: userGroupIndex
consumes:
- application/json
produces:
- application/json
parameters:
- name: per-page
in: query
description: How many items return in one page
type: integer
default: 20
- name: page
in: query
description: Current page
type: integer
default: 1
responses:
200:
description: Returns array of user group and pagination related data
schema:
type: object
properties:
_meta:
$ref: '#/definitions/_meta'
data:
type: array
items:
$ref: '#/definitions/userGroup'
401:
description: Unathorized request
403:
description: Forbidden request
500:
description: Server Error
post:
tags:
- user-group
summary: Create user group
operationId: userGroupCreate
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
type: object
properties:
name:
type: string
description:
type: string
is_visible:
type: boolean
user_group_type_id:
type: integer
$ref: '#/definitions/userGroupTypeId'
thumb_file_id:
type: string
format: uuid
conditions:
items:
$ref: '#/definitions/userGroupCondition'
responses:
200:
description: Returns userGroup data
schema:
type: object
$ref: '#/definitions/userGroup'
401:
description: Unathorized request
403:
description: Forbidden request
500:
description: Server Error
/user-group/{$id}:
get:
tags:
- user-group
summary: View user group
operationId: userGroupView
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: ID
required: true
type: string
responses:
200:
description: Returns userGroup data
schema:
type: object
$ref: '#/definitions/userGroup'
401:
description: Unathorized request
403:
description: Forbidden request
404:
description: Not Found
500:
description: Server Error
post:
tags:
- user-group
summary: Edit user group
operationId: userGroupUpdate
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: ID
required: true
type: string
- in: body
name: body
required: true
schema:
type: object
properties:
name:
type: string
description:
type: string
is_visible:
type: boolean
user_group_type_id:
type: integer
$ref: '#/definitions/userGroupTypeId'
thumb_file_id:
type: string
format: uuid
conditions:
items:
$ref: '#/definitions/userGroupCondition'
responses:
200:
description: Returns userGroup data
schema:
type: object
$ref: '#/definitions/userGroup'
401:
description: Unathorized request
403:
description: Forbidden request
404:
description: Not Found
500:
description: Server Error
delete:
tags:
- user-group
summary: Delete user group
operationId: userGroupDelete
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: ID
required: true
type: string
responses:
200:
description: Deleted
401:
description: Unathorized request
403:
description: Forbidden request
404:
description: Not Found
500:
description: Server Error
/user-group/{$id}/users:
get:
tags:
- user-group
summary: Get the list of users in user group
operationId: userGroupUsersIndex
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: ID
required: true
type: string
- name: per-page
in: query
description: How many items return in one page
type: integer
default: 20
- name: page
in: query
description: Current page
type: integer
default: 1
responses:
200:
description: Returns array of user group and pagination related data
schema:
type: object
properties:
_meta:
$ref: '#/definitions/_meta'
data:
type: array
items:
$ref: '#/definitions/user'
401:
description: Unathorized request
403:
description: Forbidden request
500:
description: Server Error
post:
tags:
- user-group
summary: Updates list of users in user group
operationId: userGroupUsersUpdate
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: ID
required: true
type: string
- in: body
name: body
required: true
schema:
type: array
items:
type: string
format: uuid
description: List org_employment_id
responses:
200:
description: Success response server
schema:
type: object
properties:
success:
type: boolean
count:
type: integer
errors:
type: array
items:
type: object
401:
description: Unathorized request
403:
description: Forbidden request
500:
description: Server Error
/user-group/{$id}/users/add:
post:
tags:
- user-group
summary: Add users in user group
operationId: userGroupUsersAdd
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: ID
required: true
type: string
- in: body
name: body
required: true
schema:
type: array
items:
type: string
format: uuid
description: List org_employment_id
responses:
200:
description: Success response server
schema:
type: object
properties:
success:
type: boolean
count:
type: integer
errors:
type: array
items:
type: object
401:
description: Unathorized request
403:
description: Forbidden request
500:
description: Server Error
/user-group/{$id}/users/remove:
post:
tags:
- user-group
summary: Removes users
operationId: userGroupUsersRemove
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: ID
required: true
type: string
- in: body
name: body
required: true
schema:
type: array
items:
type: string
format: uuid
description: List org_employment_id
responses:
200:
description: Success response server
schema:
type: object
properties:
success:
type: boolean
count:
type: integer
errors:
type: array
items:
type: object
401:
description: Unathorized request
403:
description: Forbidden request
500:
description: Server Error
/user-status:
get:
tags:
- user-status
summary: Get user statuses list.
operationId: actionIndex
consumes:
- application/json
produces:
- application/json
parameters:
- name: per-page
description: How many items return in one page.
in: query
type: integer
default: 20
- name: page
description: The current page.
in: query
type: integer
default: 1
responses:
200:
description: Returns list of available user statuses.
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/userStatus'
_links:
$ref: '#/definitions/_links'
_meta:
$ref: '#/definitions/_meta'
401:
description: Unauthorized.
403:
description: Forbidden.
500:
description: Internal Server Error.
/user-status/set:
post:
tags:
- user-status
summary: Change user status.
operationId: actionSet
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
type: object
properties:
org_employment_id:
type: string
format: uuid
description: Organization employment ID.
status_id:
type: string
description: An existing status ID or slug (send slug if it presented). The list of statuses can be obtained using the "/user-status/index" method.
is_active:
type: boolean
description: Set status activity.
expire_at:
type: string
format: date
description: Required when setting the status if the status has date-limited option enabled (is_expire = true). The expire_at date must be greater than the current date.
responses:
200:
description: Returns a success result.
schema:
type: object
properties:
data:
type: object
properties:
success:
type: boolean
status:
type: integer
example: 200
400:
description: Bad Request. Returns a message with the error details.
401:
description: Unauthorized.
403:
description: Forbidden.
404:
description: Not found. Returns a message with the error details.
500:
description: Internal Server Error.
definitions:
user:
type: object
properties:
id:
type: string
format: uuid
first_name:
type: string
last_name:
type: string
middle_name:
type: string
birthday_date:
type: string
format: date
reg_status_id:
type: integer
country_id:
type: string
is_external:
type: boolean
city_id:
type: string
spec_id:
type: string
format: uuid
company:
type: string
gender_id:
type: integer
photo_file_id:
type: string
format: uuid
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
created_user_id:
type: string
format: uuid
updated_user_id:
type: string
format: uuid
userGroup:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
description:
type: string
is_visible:
type: boolean
user_group_type_id:
type: integer
$ref: '#/definitions/userGroupTypeId'
conditions:
type: array
items:
$ref: '#/definitions/userGroupCondition'
thumb_file_id:
type: string
format: uuid
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
created_user_id:
type: string
format: uuid
updated_user_id:
type: string
format: uuid
userGroupTypeId:
type: integer
enum: [1, 2, 3, 4, 5]
description: >
* `1` - Системные\system
* `2` - Видимые админам\visible for admin
* `3` - Группы обучения\LMS group
* `4` - Видимые всем\visible for all
* `5` - Динамическая\dynamic
userGroupCondition:
type: object
properties:
attr:
type: string
$ref: '#/definitions/userGroupConditionAttr'
operator:
type: string
$ref: '#/definitions/userGroupConditionOperator'
value:
type: string
userGroupConditionAttr:
type: string
enum:
- 'employment.department_id'
- 'employment.position'
- 'employment.is_main'
- 'employment.seniority'
- 'employment.chief.user_id'
- 'city_id'
- 'region.id'
- 'companyName'
- 'spec_id'
- 'age'
- 'role'
- 'gender_id'
- 'reg_status_id'
- 'cabinet'
- 'is_boss'
- 'is_external'
- 'status'
userGroupConditionOperator:
type: string
enum:
- '>'
- '>='
- '='
- '<='
- '<'
- '!='
- 'in'
- 'not_in'
- 'JC'
- 'JNC'
userStatus:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
slug:
type: string
is_custom:
type: boolean
is_editable:
type: boolean
is_expire:
type: boolean
display_in_modal:
type: boolean
labelColorHEX:
type: string
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
first:
type: object
properties:
href:
type: string
last:
type: object
properties:
href:
type: string
_meta:
type: object
properties:
totalCount:
type: integer
default: 0
description: Total items count in database
pageCount:
type: integer
default: 1
description: How much pages there are with current perPage value
currentPage:
type: integer
default: 1
description: Current page number
perPage:
type: integer
default: 10
description: How much items per page
# Added by API Auto Mocking Plugin
# host: api.hrbox.io
# basePath: /api/v1
schemes:
- https
# Added by API Auto Mocking Plugin
host: virtserver.swaggerhub.com
basePath: /hrbox.io/Integration/2.0.0