proximify/uniweb-api
Composer 安装命令:
composer require proximify/uniweb-api
包简介
Reference API client for the UNIWeb application.
README 文档
README
UNIWeb API Client
Overview
The UNIWeb API allows institutions to seamlessly integrate UNIWeb with their existing systems. This repository provides both the API documentation and a reference PHP client implementation.
Note
All the examples are located in the queries folder.
Key Features
- Secure Access Control: Manage API access permissions at the institutional level
- Read/Write Operations: Full support for reading and updating institutional data
- JSON Format: Clean, well-structured JSON responses for easy integration
- Flexible Filtering: Query specific data subsets to optimize response times
- Reference Implementation: PHP client library with example use cases
Implementation Options
1. Simple Integration
Before implementing the API, consider if you just need to embed UNIWeb content. You can use the embed parameter:
<iframe src="https://your-uniweb-instance.com/embed/profile/members/[MEMBER_ID]" frameborder="0" width="80%" height="600px" ></iframe>
2. Using Postman or Direct HTTP Requests
The simplest way to test and use the API is through direct HTTP requests. Here are some common examples:
# Get user profile information GET {{BASE_API_URL}}/resource.php?action=read &resources[]=profile/affiliations &resources[]=profile/membership_information &id=833 # Get members by unit and title GET {{BASE_API_URL}}/resource.php?action=read &resources[]=profile/affiliations &resources[]=profile/membership_information &filter[unit]=University of XYZ &filter[title]=Professor # Get all members GET {{BASE_API_URL}}/resource.php?action=getMembers&onlyPublic=0 # Get profile picture GET {{BASE_API_URL}}/picture.php?action=display &contentType=members &id=833 &quality=large
3. Using the PHP Client
Begin by installing PHP Composer if you don't already have it.
Option 1: Create a New Project (Recommended for Testing)
# Creates a new project with example code and CLI testing tools composer create-project proximify/uniweb-api # Optional: specify custom installation name or path composer create-project proximify/uniweb-api my-test
Option 2: Add as a Dependency
# Add to an existing project
composer require proximify/uniweb-api
Setup Guide
1. Get Your API Credentials
- Log into your UNIWeb instance
- Navigate to Administration → API section
- Click "Create a client"
- Enter a client name and save
- Click "View" on your new client to reveal the secret key
Tip
Review the Profile and CV data schemas located at Administration → Schemas
2. Configure Credentials
Create settings/credentials.json:
{
"clientName": "your_client_name",
"clientSecret": "your_client_secret",
"homepage": "your_uniweb_instance_url"
}
⚠️ Security Note: Add settings/credentials.json to your .gitignore file
3. Run Example Queries
Using the Web Interface
- Navigate to the project directory
- Start PHP's built-in server:
cd www php -S localhost:8000 - Open
http://localhost:8000in your browser - Select and run example queries through the web interface
Using the CLI
# Run a specific example query
composer query example3
PHP Client Usage
$credentials = [ "clientName" => "your_client_name", "clientSecret" => "your_client_secret", "homepage" => "your_uniweb_instance_url" ]; $client = new UniwebClient($credentials);
Documentation
For detailed API documentation, see Complete UNIWeb API Documentation.
Sample Use Cases
The queries folder contains example code for common API operations:
- Fetching user profiles
- Updating research activities
- Retrieving publication data
- And more...
Resource Paths
Resources are identified by paths following this structure:
page/section/subsection/...
Example paths:
profile/affiliationscv/education/degreesprofile/membership_information
Content Types
members: Individual user dataunits: Organizational unit datagroups: Group-related data
Common Operations
Reading Data
Send as GET or POST parameters.
{
"action": "read",
"content": "members",
"filter": {
"unit": "Civil Engineering"
},
"resources": ["profile/biography"]
}
Filtering Options
unit: Filter by department/unittitle: Filter by title (e.g., "Professor")loginName: Filter by username/emailmodified_since: Filter by modification dateonlyPublic: Include/exclude private data
Language Support
Add language parameter:
en: English responsesfr: French responses
Error Handling
Errors are returned in JSON format:
{
"error": {
"message": "Error description",
"type": "ErrorType",
"code": 98,
"error_subcode": 223
}
}
Common error codes:
- 98: OAuth token validation error
- 401: Unauthorized
- 403: Insufficient permissions
- 404: Resource not found
API Capabilities
The UNIWeb API provides:
- Secure authentication
- User data management
- Research activity tracking
- Publication management
- Institutional data access
- Custom data filtering
Support
For technical questions or issues:
- Check the API Documentation
- Create an issue in this repository
- Contact UNIWeb support through your institutional channels
proximify/uniweb-api 适用场景与选型建议
proximify/uniweb-api 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 57 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 10 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 proximify/uniweb-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 proximify/uniweb-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-07