Содержание

Air Lay API v4


Описание

Раздел в процессе разработки

Структура запроса

    /**
     * Desctiprion - описание Action
     * request([
     *     "method" => "тип метода",
     *     "url" => "api/v4/controllerName/actionName", - адрес запроса
     *     (полный путь "api/v4/controllerNameComtroller/actionNameAction")
           'file' => 'описание содержимого файла в случае передачи файлом' 
     *     'params' => [
     *         [
     *             'name' => 'Имя параметра',
     *             'type' => 'Тип параметра',
     *             'description' => 'Описание параметра',
     *             'required' => 'Флаг обязателен параметр или нет'
     *         ],
     *         ...
     *     ] - Параметры в случае передачи через параметры
     * ]) - Передаваемые в Action значения 
     * response([  
     *     "status" => 'Статус код ответа', 
     *     "message" => 'Сообщение ответа', 
     *     "code" => 'код ответа' 
     * ]) - Возвращаемое значение после выполнения Action
     * @throws - ошибки которые могут возникать в ходе работы
     *
     * @Authorization - флаг необходимости авторизации
     */

Контроллеры

Label

getAction

    /**
     * Get labels
     * request([
     *     'method' => 'GET',
     *     'url' => '/api/v4/label/get'
     *     'params' => [
     *         [
     *             'name' => 'type',
     *             'type' => 'string',
     *             'description' => 'label type',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => LabelsEntity[],
     *     'code' => 0
     * ])
     *
     * @Authorization(['CmsUser', 'User'])
     *
     * @throws AirlayException
     */

createAction

    /**
     * Create label
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/label/create'
     *     'params' => [
     *          [
     *             'name' => 'name',
     *             'type' => 'string',
     *             'description' => 'label name',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'color',
     *             'type' => 'string',
     *             'description' => 'label color',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'type',
     *             'type' => 'string',
     *             'description' => 'label type',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => LabelEntity,
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

updateAction

    /**
     * Update label
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/label/update'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'ObjectId',
     *             'description' => 'label id',
     *             'required' => true
     *          ],
     *          [
     *             'name' => 'name',
     *             'type' => 'string'|null,
     *             'description' => 'label name',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'color',
     *             'type' => 'string'|null,
     *             'description' => 'label color',
     *             'required' => false
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => LabelEntity,
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

deleteAction

    /**
     * Delete label
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/label/delete'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'ObjectId',
     *             'description' => 'label id',
     *             'required' => true
     *          ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => 'Ok',
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

Issue

getAction

    /**
     * Get issues
     * request([
     *     'method' => 'GET',
     *     'url' => '/api/v4/issue/get'
     *     'params' => [
     *          [
     *             'name' => 'milestoneIds',
     *             'type' => 'ObjectId[]',
     *             'description' => 'milestones filter',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'assignIds',
     *             'type' => 'ObjectId[]',
     *             'description' => 'assigns filter',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'priorityIds',
     *             'type' => 'ObjectId[]',
     *             'description' => 'priorities filter',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'statusId',
     *             'type' => 'ObjectId|null',
     *             'description' => 'status id',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'name',
     *             'type' => 'string',
     *             'description' => 'name starts with',
     *             'required' => false
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => IssueEntity[],
     *     'code' => 0
     * ])
     *
     * @Authorization(['CmsUser', 'User'])
     */

createAction

    /**
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/create'
     *     'params' => [
     *          [
     *             'name' => 'name',
     *             'type' => 'string',
     *             'description' => 'issue name',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'description',
     *             'type' => 'string',
     *             'description' => 'issue description',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'assignId',
     *             'type' => 'objectId|null',
     *             'description' => 'issue assign user id',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'priorityId',
     *             'type' => 'objectId'|null,
     *             'description' => 'priority id',
     *             'required' => false
     *         ],,
     *         [
     *             'name' => 'statusId',
     *             'type' => 'objectId'|null,
     *             'description' => 'status id',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'milestoneId',
     *             'type' => 'objectId'|null,
     *             'description' => 'milestone id',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'endDate',
     *             'type' => 'int'|null,
     *             'description' => 'close date',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'spentTime',
     *             'type' => 'int'|null,
     *             'description' => 'spent time',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'estimatedTime',
     *             'type' => 'int'|null,
     *             'description' => 'estimated time',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'progress',
     *             'type' => 'int'|null,
     *             'description' => 'percentage of issue completed',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'parents',
     *             'type' => 'ObjectId[]',
     *             'description' => 'parent issue ids',
     *             'required' => false
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => IssueEntity,
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

updateAction

    /**
     * Update issue
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/update'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'issue id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'name',
     *             'type' => 'string',
     *             'description' => 'issue name',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'statusId',
     *             'type' => 'objectId'|null,
     *             'description' => 'status id',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'description',
     *             'type' => 'string',
     *             'description' => 'issue description',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'assignId',
     *             'type' => 'objectId|null',
     *             'description' => 'issue assign user id',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'priorityId',
     *             'type' => 'objectId'|null,
     *             'description' => 'priority id',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'milestoneId',
     *             'type' => 'objectId'|null,
     *             'description' => 'milestone id',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'endDate',
     *             'type' => 'int'|null,
     *             'description' => 'close date',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'spentTime',
     *             'type' => 'int'|null,
     *             'description' => 'spent time',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'estimatedTime',
     *             'type' => 'int'|null,
     *             'description' => 'estimated time',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'progress',
     *             'type' => 'int'|null,
     *             'description' => 'percentage of issue completed',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'parents',
     *             'type' => 'ObjectId[]',
     *             'description' => 'parent issue ids',
     *             'required' => false
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => IssueEntity,
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

deleteAction

    /**
     * Delete issue
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/delete'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'issue id',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => 'OK',
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

addObserverAction

   /**
     * Add observer
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/addObserver'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'issue id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'type',
     *             'type' => 'string' ('user' | 'organization' | 'group' | 'department'),
     *             'description' => 'type of observer',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'observerId',
     *             'type' => 'objectId',
     *             'description' => 'observers id',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => 'OK',
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

removeObserverAction

    /**
     * Remove observer
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/removeObserver'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'issue id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'observerId',
     *             'type' => 'objectId',
     *             'description' => 'observers id',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => 'OK',
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

getCommentsAction

    /**
     * Get issue comments
     * request(
     *     'method' => 'GET',
     *     'url' => '/api/v4/issue/getComments',
     *     'params' => [
     *          [
     *              'name' => 'issueId',
     *              'type' => 'ObjectId',
     *              'required' => true,
     *              'description' => 'Issue id'
     *          ],
     *          [
     *              'name' => 'skip',
     *              'type' => 'int',
     *              'required' => false,
     *              'description' => 'Skip comments in result'
     *          ],
     *          [
     *              'name' => 'limit',
     *              'type' => 'int',
     *              'required' => false,
     *              'description' => 'Limit comments in result'
     *          ]
     *     ]
     * )
     * response(
     *     '200' => [
     *          'status' => 200,
     *          'message' => CommentEntity[]
     *          'code' => 0
     *     ]
     * )
     *
     * @throws AirlayException
     *
     * @Authorization
     */

addCommentAction

    /**
     * Add new comment to issue.
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/addComment'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'Issue id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'text',
     *             'type' => 'string',
     *             'description' => 'comments text',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => 'CommentEntity',
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization
     */

updateCommentAction

    /**
     * Update comment.
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/updateComment'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'Comment id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'text',
     *             'type' => 'string',
     *             'description' => 'Comment text',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => 'CommentEntity',
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization
     */

removeCommentAction

    /**
     * Remove comment from issue.
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/removeComment'
     *     'params' => [
     *         [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'Comment id',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => 'Ok',
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization
     */

addRelatedObjectAction

    /**
     * Add related object.
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/addRelatedObject'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'issue id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'relatedObject',
     *             'type' => 'json',
     *             'description' => 'related object content',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => 'OK',
     *     'code' => 0
     * ])
     * @throws AirlayException
     * @Authorization
     */

removeRelatedObjectAction

    /**
     * Remove related object.
     * request([
     *     'method' => 'POST',
     *     'url' => '/api/v4/issue/removeRelatedObject'
     *     'params' => [
     *          [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'issue id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'index',
     *             'type' => 'int',
     *             'description' => 'number of object to remove',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 200,
     *     'message' => 'OK',
     *     'code' => 0
     * ])
     *
     * @throws AirlayException
     *
     * @Authorization
     */

Milestone

getAction

    /**
     * Get milestones.
     * request([
     *     'method' => 'GET',
     *     'url' => '/api/v4/milestone/get',
     *     'params' => [
     *         [
     *             'name' => 'status',
     *             'type' => 'string',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'name',
     *             'type' => 'string',
     *             'required' => false
     *         ]
     *     ]
     * ])
     * response([
     *     'status' => 'OK',
     *     'message' => MilestoneEntity[]
     *     'code' => 0
     * ])
     * @Authorization('CmsUser', 'User')
     */

createAction

    /**
     * Create milestone
     * request([
     *     "method" => "POST",
     *     "url" => "api/v4/milestone/create",
     *     "params" => [
     *         [
     *             'name' => 'name',
     *             'type' => 'string',
     *             'description' => 'Milestone name',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'description',
     *             'type' => 'string' | 'null',
     *             'description' => 'Milestone description',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'startDate',
     *             'type' => 'int' | 'null',
     *             'description' => 'Milestone start date',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'endDate',
     *             'type' => 'int' | 'null',
     *             'description' => 'Milestone end date',
     *             'required' => false
     *         ]
     *     ]
     * ])
     * response([
     *     "status" => 200,
     *     "message" => MilestoneEntity
     *     "code" => 0
     * ])
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

updateAction

    /**
     * Update milestone
     * request([
     *     "method" => "POST",
     *     "url" => "api/v4/milestone/update",
     *     "params" => [
     *         [
     *             'name' => 'id',
     *             'type' => 'ObjectId',
     *             'description' => 'Milestone id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'name',
     *             'type' => 'string' | 'null',
     *             'description' => 'Milestone name',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'description',
     *             'type' => 'string' | 'null',
     *             'description' => 'Milestone description',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'startDate',
     *             'type' => 'int' | 'null',
     *             'description' => 'Milestone start date',
     *             'required' => false
     *         ],
     *         [
     *             'name' => 'endDate',
     *             'type' => 'int' | 'null',
     *             'description' => 'Milestone end date',
     *             'required' => false
     *         ]
     *     ]
     * ])
     * response([
     *     "status" => 200,
     *     "message" => MilestoneEntity
     *     "code" => 0
     * ])
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

deleteAction

    /**
     * Delete milestone
     * request([
     *     "method" => "POST",
     *     "url" => "api/v4/milestone/delete",
     *     'params' => [
     *         [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'milestone id',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     "status" => 200,
     *     "message" => Ok
     *     "code" => 0
     * ])
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

closeMilestoneAction

    /**
     * Close milestone
     * request([
     *     "method" => "POST",
     *     "url" => "api/v4/milestone/closeMilestone",
     *     'params' => [
     *         [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'milestone id',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     "status" => 200,
     *     "message" => MilestoneEntity
     *     "code" => 0
     * ])
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

addIssuesAction

    /**
     * Add issues to milestone
     * request([
     *     "method" => "POST",
     *     "url" => "api/v4/milestone/addIssues",
     *     'params' => [
     *         [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'milestone id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'issues',
     *             'type' => 'objectId[]',
     *             'description' => 'issues object ids',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     "status" => 200,
     *     "message" => MilestoneEntity
     *     "code" => 0
     * ])
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */

removeIssueAction

    /**
     * Remove issue from milestone
     * request([
     *     "method" => "POST",
     *     "url" => "api/v4/milestone/removeIssue",
     *     'params' => [
     *         [
     *             'name' => 'id',
     *             'type' => 'objectId',
     *             'description' => 'milestone id',
     *             'required' => true
     *         ],
     *         [
     *             'name' => 'issue',
     *             'type' => 'objectId',
     *             'description' => 'issue object id',
     *             'required' => true
     *         ]
     *     ]
     * ])
     * response([
     *     "status" => 200,
     *     "message" => MilestoneEntity
     *     "code" => 0
     * ])
     * @throws AirlayException
     *
     * @Authorization('CmsUser')
     */