UserServiceImpl

This group contains the following resources:

/user

URI: /api/v1/user

GET

Get personal data about the user (the user that is using the application). Among that data there are the name and surnames of the user and the URL where the user's photo is stored. The user must have given the application the grant READ to use these operation.

Response Body

element: user
User object with user's data Represents a user of the Virtual Campus.
Properties
Property Type Description
id string User identifier.
username string Username inside Virtual Campus.
name string User's name.
number string User's number.
fullName string User's full name.
photoUrl string URL where the user's picture is located.
language string User's language in ISO format.
sessionId string Identifier of the user's current session inside Virtual Campus. It only contains data in the Get User's data call.
email string User's mail address

Status Codes - Errors

The HTTP call return a status code depending on the result of the operation. These codes are listed below
Code Description
200 Success Call
401 Not authorized. Maybe you have to authorize the user o the OAuth token has expired

Example

HTTP Call Example
GET http://denver.uoc.es:8080/webapps/uocapi/v1/user
Response Example (XML)
<?xml version="1.0" encoding="UTF-8"?> <user> <id>130360</id> <username>xaracil</username> <name>Xavi</name> <number>411603</number> <fullName>Xavi Aracil Diaz</fullName> <photoUrl>http://cv.uoc.edu/UOC/mc-icons/fotos/xaracil.jpg</photoUrl> <language>ca</language> <sessionId>283ac5c62977a38daef52b5a43ec5273f371af839246fdc4e4c71aaf367972b16721a00fb25ca8feeb3de5012435c42218d7ae60243c7b5c3a688eb593dfbad2</sessionId> <email>xaracil@uoc.edu</email> </user>
Response Example (JSON)
{ "id" : "130360", "username" : "xaracil", "name" : "Xavi", "number" : "411603", "fullName" : "Xavi Aracil Diaz", "photoUrl" : "http://cv.uoc.edu/UOC/mc-icons/fotos/xaracil.jpg", "language" : "ca", "sessionId" : "283ac5c62977a38daef52b5a43ec5273f371af839246fdc4e4c71aaf367972b16721a00fb25ca8feeb3de5012435c42218d7ae60243c7b5c3a688eb593dfbad2", "email" : "xaracil@uoc.edu" }

Links

iOS: https://github.com/UOC/openapidemos/tree/master/Exemple%20UserGet

/user/profiles

URI: /api/v1/user/profiles

GET

Get the profiles of the user that is using the application The user must have given the application the grant READ to use these operation.

Response Body

element: profileList
ProfileList object with user's profiles Represents a profile list
Properties
Property Type Description
profiles array of (profile) Profile list.

Status Codes - Errors

The HTTP call return a status code depending on the result of the operation. These codes are listed below
Code Description
200 Success Call
401 Not authorized. Maybe you have to authorize the user o the OAuth token has expired

Example

HTTP Call Example
GET http://denver.uoc.es:8080/webapps/uocapi/v1/profiles
Response Example (XML)
<?xml version="1.0" encoding="UTF-8"?> <profileList> <profiles> <appId>UOC</appId> <app>UOC</app> <id>UOC-GESTIO-1-ca</id> <userSubtypeId>1</userSubtypeId> <userType>Gestió</userType> <usertypeId>GESTIO</usertypeId> <userSubtype>Gestió</userSubtype> <language>ca</language> </profiles> <profiles> <!--...--> </profiles> <!--...more "profiles" elements...--> </profileList>
Response Example (JSON)
{ "profiles" : [ { "appId" : "UOC", "app" : "UOC", "id" : "UOC-GESTIO-1-ca", "userSubtypeId" : "1", "userType" : "Gestió", "usertypeId" : "GESTIO", "userSubtype" : "Gestió", "language" : "ca" }, ... ] }

Links

iOS: https://github.com/UOC/openapidemos/tree/master/Exemple%20UserProfilesGet

/user/settings

URI: /api/v1/user/settings

GET

Get the settings of the user that is using the application. The set of settings depend on the current profile of the user. The user must have given the application the grant READ to use these operation.

Response Body

element: settingList
SettingList object with the settings of the current user Represents a list of settings
Properties
Property Type Description
settings array of (setting) Setting list.

Status Codes - Errors

The HTTP call return a status code depending on the result of the operation. These codes are listed below
Code Description
200 Success Call
401 Not authorized. Maybe you have to authorize the user o the OAuth token has expired

Example

HTTP Call Example
GET http://denver.uoc.es:8080/webapps/uocapi/v1/settings
Response Example (XML)
<?xml version="1.0" encoding="UTF-8"?> <settingList> <settings> <id>dockMagification</id> <title>Ampliaci&amp;#243; del men&amp;#250;</title> <description>Permet triar si el men&amp;#250; de la plana d&amp;apos;inici s&amp;apos;amplia o no.</description> <section>Pàgina d'inici</section> <url>https://cv.uoc.edu/cgi-bin/comuni/chpasswd?s=c8e4d5137915e389fe79cb619396922ac31e4fdfd2e30d2e7447bafdb637629e77d720ca328288d2fb79b57fd4ee945698e30e77143c2b993a8d9e40a3027a0f</url> <value>true</value> <values> <description>Usa els colors de contrast</description> <value>true</value> </values> <values> <!--...--> </values> <!--...more "values" elements...--> </settings> <settings> <!--...--> </settings> <!--...more "settings" elements...--> </settingList>
Response Example (JSON)
{ "settings" : [ { "id" : "dockMagification", "title" : "Ampliació del menú", "description" : "Permet triar si el menú de la plana d&apos;inici s&apos;amplia o no.", "section" : "Pàgina d'inici", "url" : "https://cv.uoc.edu/cgi-bin/comuni/chpasswd?s=c8e4d5137915e389fe79cb619396922ac31e4fdfd2e30d2e7447bafdb637629e77d720ca328288d2fb79b57fd4ee945698e30e77143c2b993a8d9e40a3027a0f", "value" : "true", "values" : [ { "description" : "Usa els colors de contrast", "value" : "true" }, ... ] }, ... ] }

Links

iOS: https://github.com/UOC/openapidemos/tree/master/Exemple%20UserSettingsGet

/user/tutors

URI: /api/v1/user/tutors

GET

Get the tutors of the user that is using the application There is a tutor for each degree the user is enrolled in. The user must have given the application the grant READ to use these operation.

Response Body

element: userList
UserList object with user's tutors. Represents a list of users
Properties
Property Type Description
users array of (user) User list.

Status Codes - Errors

The HTTP call return a status code depending on the result of the operation. These codes are listed below
Code Description
200 Success Call
401 Not authorized. Maybe you have to authorize the user o the OAuth token has expired

Example

HTTP Call Example
GET http://denver.uoc.es:8080/webapps/uocapi/v1/tutors
Response Example (XML)
<?xml version="1.0" encoding="UTF-8"?> <userList> <users> <id>130360</id> <username>xaracil</username> <name>Xavi</name> <number>411603</number> <fullName>Xavi Aracil Diaz</fullName> <photoUrl>http://cv.uoc.edu/UOC/mc-icons/fotos/xaracil.jpg</photoUrl> <language>ca</language> <sessionId>283ac5c62977a38daef52b5a43ec5273f371af839246fdc4e4c71aaf367972b16721a00fb25ca8feeb3de5012435c42218d7ae60243c7b5c3a688eb593dfbad2</sessionId> <email>xaracil@uoc.edu</email> </users> <users> <!--...--> </users> <!--...more "users" elements...--> </userList>
Response Example (JSON)
{ "users" : [ { "id" : "130360", "username" : "xaracil", "name" : "Xavi", "number" : "411603", "fullName" : "Xavi Aracil Diaz", "photoUrl" : "http://cv.uoc.edu/UOC/mc-icons/fotos/xaracil.jpg", "language" : "ca", "sessionId" : "283ac5c62977a38daef52b5a43ec5273f371af839246fdc4e4c71aaf367972b16721a00fb25ca8feeb3de5012435c42218d7ae60243c7b5c3a688eb593dfbad2", "email" : "xaracil@uoc.edu" }, ... ] }

Links

iOS: https://github.com/UOC/openapidemos/tree/master/Exemple%20UserTutorsGet

/user/profiles/current

URI: /api/v1/user/profiles/current

GET

Get the current profile of the user that is usgin the application The current profile is the profile the user is connected to the Virtual Campus with. That profile is key in:
  • Available settings.
  • Menu options in the homepage.
  • Available widgets in the home page.
  • Profile icon in webmail.
  • Secretary's Office.
The user must have given the application the grant READ to use these operation.

Response Body

element: profile
Profile object with the current profile of the user A profile is a combination of APP-TYPE-SUBTYPE-LANG, where
  • APP is the environment of the profile (UOC, CV-UOC, GC-UOC, etc).
  • TYPE is the user type (ESTUDIANT, PROFESSOR, etc).
  • SUBTYPE is the user subtype, usually related to the studies.
  • LANG is the profile language in ISO format.
Contains identifiers for APP, TYPE & SUBTYPE as well as the description in the current language of the user inside the Virtual Campus
Properties
Property Type Description
appId string Environment identifier of the profile.
app string Profile environment in the current language of the user.
id string Profile identifier, has the following format: APP-USERTYPE-USERSUBTYPE-LANG.
userSubtypeId string Identifier of the User's subtype of the profile.
userType string User type of the profile (TYPE) in the current language of the user.
usertypeId string Identifier of the user type of the profile (TYPE).
userSubtype string User Subtype of the profile (SUBTYPE) in the current language of the user.
language string Language of the profile. Some environments have only one language o don't have the current language of the user. This field contains the language of the profile.

Status Codes - Errors

The HTTP call return a status code depending on the result of the operation. These codes are listed below
Code Description
200 Success Call
401 Not authorized. Maybe you have to authorize the user o the OAuth token has expired

Example

HTTP Call Example
GET http://denver.uoc.es:8080/webapps/uocapi/v1/profiles/current
Response Example (XML)
<?xml version="1.0" encoding="UTF-8"?> <profile> <appId>UOC</appId> <app>UOC</app> <id>UOC-GESTIO-1-ca</id> <userSubtypeId>1</userSubtypeId> <userType>Gestió</userType> <usertypeId>GESTIO</usertypeId> <userSubtype>Gestió</userSubtype> <language>ca</language> </profile>
Response Example (JSON)
{ "appId" : "UOC", "app" : "UOC", "id" : "UOC-GESTIO-1-ca", "userSubtypeId" : "1", "userType" : "Gestió", "usertypeId" : "GESTIO", "userSubtype" : "Gestió", "language" : "ca" }

Links

iOS: https://github.com/UOC/openapidemos/tree/master/Exemple%20UserProfilesCurrentGet

PUT

Update the ccurrent profile of the user that is using the application The user must have given the application the grant WRITE to use these operation.

Request Body

element: profile
New profile. Descriptive fields (such id, app, userType, userSubtype) are dismissed when updating the current profile.

Response Body

element: profile
Profile object with the current profile of the user A profile is a combination of APP-TYPE-SUBTYPE-LANG, where
  • APP is the environment of the profile (UOC, CV-UOC, GC-UOC, etc).
  • TYPE is the user type (ESTUDIANT, PROFESSOR, etc).
  • SUBTYPE is the user subtype, usually related to the studies.
  • LANG is the profile language in ISO format.
Contains identifiers for APP, TYPE & SUBTYPE as well as the description in the current language of the user inside the Virtual Campus
Properties
Property Type Description
appId string Environment identifier of the profile.
app string Profile environment in the current language of the user.
id string Profile identifier, has the following format: APP-USERTYPE-USERSUBTYPE-LANG.
userSubtypeId string Identifier of the User's subtype of the profile.
userType string User type of the profile (TYPE) in the current language of the user.
usertypeId string Identifier of the user type of the profile (TYPE).
userSubtype string User Subtype of the profile (SUBTYPE) in the current language of the user.
language string Language of the profile. Some environments have only one language o don't have the current language of the user. This field contains the language of the profile.

Status Codes - Errors

The HTTP call return a status code depending on the result of the operation. These codes are listed below
Code Description
200 Success Call
401 Not authorized. Maybe you have to authorize the user o the OAuth token has expired

Example

HTTP Call Example
PUT http://denver.uoc.es:8080/webapps/uocapi/v1/user
Response Example (XML)
<?xml version="1.0" encoding="UTF-8"?> <profile> <appId>UOC</appId> <app>UOC</app> <id>UOC-GESTIO-1-ca</id> <userSubtypeId>1</userSubtypeId> <userType>Gestió</userType> <usertypeId>GESTIO</usertypeId> <userSubtype>Gestió</userSubtype> <language>ca</language> </profile>
Response Example (JSON)
{ "appId" : "UOC", "app" : "UOC", "id" : "UOC-GESTIO-1-ca", "userSubtypeId" : "1", "userType" : "Gestió", "usertypeId" : "GESTIO", "userSubtype" : "Gestió", "language" : "ca" }

Links

iOS: https://github.com/UOC/openapidemos/tree/master/Exemple%20UserProfilesCurrentPut