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.
- 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
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>
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
Begin by installing PHP Composer if you don't already have it.
# 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
# Add to an existing project
composer require proximify/uniweb-api
- 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
Create settings/credentials.json
:
{
"clientName": "your_client_name",
"clientSecret": "your_client_secret",
"homepage": "your_uniweb_instance_url"
}
settings/credentials.json
to your .gitignore
file
- Navigate to the project directory
- Start PHP's built-in server:
cd www php -S localhost:8000
- Open
http://localhost:8000
in your browser - Select and run example queries through the web interface
# Run a specific example query
composer query example3
$credentials = [
"clientName" => "your_client_name",
"clientSecret" => "your_client_secret",
"homepage" => "your_uniweb_instance_url"
];
$client = new UniwebClient($credentials);
For detailed API documentation, see Complete UNIWeb API Documentation.
The queries
folder contains example code for common API operations:
- Fetching user profiles
- Updating research activities
- Retrieving publication data
- And more...
Resources are identified by paths following this structure:
page/section/subsection/...
Example paths:
profile/affiliations
cv/education/degrees
profile/membership_information
members
: Individual user dataunits
: Organizational unit datagroups
: Group-related data
Send as GET or POST parameters.
{
"action": "read",
"content": "members",
"filter": {
"unit": "Civil Engineering"
},
"resources": ["profile/biography"]
}
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
Add language
parameter:
en
: English responsesfr
: French responses
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
The UNIWeb API provides:
- Secure authentication
- User data management
- Research activity tracking
- Publication management
- Institutional data access
- Custom data filtering
For technical questions or issues:
- Check the API Documentation
- Create an issue in this repository
- Contact UNIWeb support through your institutional channels