Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
P portal
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
Collapse sidebar
  • 科探开源
  • portal
  • Wiki
    • 门户v2 api 文档
  • 07.User API v2

Last edited by asdu Dec 21, 2020
Page history

07.User API v2

1.1 User API 概述

  • User API 可查询和用户相关的基本数据信息。
  • User API 查询的接口,具体的接口如下:
    • 查询当前用户自己的数据接口: https://{site}/portal/api/v2/user/me?_format=json GET
    • 通过用户id查询相关用户的数据信息,https://{site}/portal/api/v2/user?_format=json&account={uid} GET ==备注:访问此接口,需要开通角色或者权限授权。==
  • 如需要额外接口满足项目需求,可以通过后台使用Portal Views配置

1.2. 查询当前用户自己的个人信息数据接口

GET /portal/api/v2/user/me?_format=json HTTP/1.1
Host: portal.xx.edu.com.cn
Authorization: Bearer 39aec9c68b679d43de6803e0f14c223j

1.3.根据用户account查询相关用户数据

GET portal/api/v2/user?_format=json HTTP/1.1
Host: portal.xx.edu.com.cn
Authorization: Bearer 39aec9c68b679d43de6803e0f14c223j

account={uid}
 

1.4. 查询数据的响应信息

[
  {
    "uuid": "56b590b7-4675-40bd-b316-b7b6670f2276",
    "uid": "1",
    "account": "admin",
    "name": "",
    "roles": "Administrator, 教师",
    "rid": "administrator, teacher",
    "department_id": "2, 1",
    "data": ""
  }
]

1.9.1.响应信息字段说明

具体的字段如下: 参数名 类型 描述
uuid string uuid
uid int 用户id
account int 用户账号
name string 用户全名
roles string 角色可读的名称
rid date 角色机器名
department_id int 用户所属部门
data string 额外的用户数据
Clone repository
  • Home
  • 数据管理手册
    • 094.Views twig 配置
    • ETL01.数据管理使用手册 V2.0
    • ETL02.Source 数据请求 data_fetcher_plugin
    • ETL03.Source 解析 data_parser_plugin
    • ETL04.Source 认证插件 authentication
    • ETL05.Porcess plugins 明细
    • ETL06.URL endpoint 数据管理E
    • ETL07.Mysql 数据管理
    • ETL08.MSSQL 数据管理
    • ETL09.Oracle 数据管理
    • ETL10.Token 列表
  • 门户V2 API 文档
    • 01.Portal Rest API v2
    • 01.Resource API
    • 02.App API
View All Pages