sebra.sws – persons and places exposed as XML via HTTP
The Sebra SWS system provide HTTP access to information about persons and organisation units associated with the University of Bergen. The requested information is returned as plain XML documents. The XML is not namespaced.
Persons are identified by their user account ids (Unix user names). Organisational units are identified by their 6 digit place code.
These services also support output in JSON format. Just append the suffix .json to the last path segments of the service URLs described here.
Used by
affiliated – look up extra information about non-employeeys of UiB ➠
hoveduid – get main account ➠
uid | string | user account id |
Content-Type: text/xml
<hoveduid> <uid>...</uid> </hoveduid>
Content-Type: text/xml
<hoveduid> <uid>No data</uid> </hoveduid>
Some users have multiple accounts (user ids). This service can be used to determine which one is regarded as the main account.
If the given user id belongs to the main account (or if the user only has a single account) then the service just echos the passed in user id. If the given user id does not belong to the main account then the user id of the main account is returned.
If the given user id doesn't exist then (strangely enough) "No data" is reported as the user id of its main account. No real account can have this user id as user ids never contain spaces.
omraader – list areas for eksternweb ➠
omraadekode | integer | Get detail information on the given area |
Content-Type: text/xml
<omraader> <omraade> <OMRAADEKODE>...</OMRAADEKODE> <OMRAADE_NAVN>...</OMRAADE_NAVN> </omraade> ... </omraader>
Without parameter this service lists all the eksternweb areas that should be made available. For each area you get an area code and the area name. With parameter look up detailed information about the given area.
Example
GET http://sebra.uib.no/sws/omraader:
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Fri, 18 Jun 2010 13:49:00 GMT
Server: Apache/2.2.11 (Unix) mod_python/3.3.1 Python/2.6.1 mod_ssl/2.2.11 OpenSSL/0.9.7d
Content-Type: text/xml
Keep-Alive: timeout=5, max=100
<?xml version="1.0" encoding="iso-8859-1"?>
<omraader>
<omraade>
<OMRAADEKODE>403</OMRAADEKODE>
<OMRAADE_NAVN>ASKeladden</OMRAADE_NAVN>
</omraade>
<omraade>
<OMRAADEKODE>324</OMRAADEKODE>
<OMRAADE_NAVN>Aktuelt</OMRAADE_NAVN>
</omraade>
<omraade>
<OMRAADEKODE>191</OMRAADEKODE>
<OMRAADE_NAVN>Akustikk</OMRAADE_NAVN>
</omraade>
<omraade>
<OMRAADEKODE>118</OMRAADEKODE>
<OMRAADE_NAVN>Akvatisk atferds\xF8kologi</OMRAADE_NAVN>
</omraade>
<omraade>
<OMRAADEKODE>158<...
(+ 39193 more bytes not shown)
GET http://sebra.uib.no/sws/omraader?omraadekode=191:
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Fri, 18 Jun 2010 13:49:00 GMT
Server: Apache/2.2.11 (Unix) mod_python/3.3.1 Python/2.6.1 mod_ssl/2.2.11 OpenSSL/0.9.7d
Content-Type: text/xml
Keep-Alive: timeout=5, max=100
<?xml version="1.0" encoding="iso-8859-1"?>
<omraade>
<omraade>
<EIER_STED_KODE>122400</EIER_STED_KODE>
<BRUK_STED_URL>n</BRUK_STED_URL>
<ENGELSK_NAVN>Acoustics</ENGELSK_NAVN>
<ENGELSK_URL>uib.no/rg/acoustics</ENGELSK_URL>
<OMRAADEKODE>191</OMRAADEKODE>
<OMRAADE_URL>uib.no/fg/akustikk</OMRAADE_URL>
<OMRAADE_TYPE>Forskningsgruppe</OMRAADE_TYPE>
<OMRAADE_NAVN>Akustikk</OMRAADE_NAVN>
<visninger>
<uibid>nfyhh</uibid>
<uibid>nfymv</uibid>
<uibid>plu062</uib...
(+ 154 more bytes not shown)
omraaderoller – List area access for the given user ➠
Content-Type: text/xml
<administrators> <administrator id='...'> <role group='...'> <omraade_kode>...</omraade_kode> ... </role> ... </administrator> </administrators>
This service lists what kind of access the given user should have to various areas in the externweb. It's invoked during processing of login.
Examples
GET http://sebra.uib.no/sws/omraaderoller?id=adbho returns this information for Helge Olsen:
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Fri, 18 Jun 2010 13:31:46 GMT
Server: Apache/2.2.11 (Unix) mod_python/3.3.1 Python/2.6.1 mod_ssl/2.2.11 OpenSSL/0.9.7d
Content-Type: text/xml
Keep-Alive: timeout=5, max=100
<?xml version="1.0" encoding="iso-8859-1"?>
<administrators>
<administrator id="adbho">
<role group="Innholdsprodusent">
<omraade_kode>260</omraade_kode>
<omraade_kode>62</omraade_kode>
</role>
<role group="Redakt\xF8r">
<omraade_kode>211</omraade_kode>
<omraade_kode>291</omraade_kode>
<omraade_kode>324</omraade_kode>
<omraade_kode>330</omraade_kode>
<omraade_kode>331</omraade_kode>
<omraade_kode>341</omraade_kode>
<omraade_kode>50</omraade_ko...
(+ 91 more bytes not shown)
person – look up information about a user ➠
id | string | user account id |
Content-Type: text/xml
<person> <id>...</id> <name>...</name> <surname>...</surname> ... </person>
Content-Type: text/plain
No data
This service looks up information about the persons of type staff and extern with the given user name. This service can't be used to look up information about persons of type student; if you try to get the user not found response.
If a person with the given user name exists then an XML document is returned. The root of the document will be the person and then there is a single textual element for each of the fields returned. The reported fields are:
- id — this just echos the id passed in the request
- name — the given name of the person (first name)
- surname — the last name of the person
- dateofbirth — the first 6 digits of the person's personnummer which usually corresponds to the date this person was born; DDMMYY. Unfortunately we will not tell you what century.
- sex — either 'M' or 'F' or empty
- address — street address of this person's office
- postnr — the postal code for the street address above
- postcode — the area name corresponding to postnr in upper case letters; typically the string "BERGEN"
- land — the country name of the address; typically the string "Norge"
- tlf — the office phone number (8 digits)
- mobile — the mobile phone number (8 digits or empty)
- epost — the UiB email address of this person
If no person with the given user name exists then a text/plain
document is
returned containing the string "\nNo data\n". The HTTP status code will be
"200 OK" also in this case.
Additional information about his user can be obtained from staff, affiliated and student services. Only one of them will return addition information and you can not tell which one until you tried them.
Examples
GET http://sebra.uib.no/sws/person?id=gaa041 returns the following:
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Fri, 18 Jun 2010 11:30:51 GMT
Server: Apache/2.2.11 (Unix) mod_python/3.3.1 Python/2.6.1 mod_ssl/2.2.11 OpenSSL/0.9.7d
Content-Type: text/xml
Keep-Alive: timeout=5, max=100
<?xml version="1.0" encoding="iso-8859-1"?>\40
<person>
<id>gaa041</id>
<name>Gisle</name>
<surname>Aas</surname>
<dateofbirth>160964</dateofbirth>
<sex>M</sex>
<address>Nyg\xE5rdsgt. 5</address>
<postnr>5020</postnr>
<postcode>BERGEN</postcode>
<land>Norge</land>
<tlf>55588996</tlf>
<epost>Gisle.Aas@it.uib.no</epost>
</person>\n
GET http://sebra.uib.no/sws/person?id=none returns the following:
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Fri, 18 Jun 2010 11:30:52 GMT
Server: Apache/2.2.11 (Unix) mod_python/3.3.1 Python/2.6.1 mod_ssl/2.2.11 OpenSSL/0.9.7d
Content-Type: text/plain
Keep-Alive: timeout=5, max=100
No data\n
persons – list users ➠
type | {staff, extern, student} | |
placeid | number |
Content-Type: text/xml
...
Get a list of persons of a specific type from a specific place
Where type:
- staff
- extern
- student
Where place is a number of either:
- 2 digits eg. 12 (faculty 12)
- 4 digits eg. 1211 (faculty 12, department 11)
- 6 digits eg. 121208 (faculty 12, department 12, division 08)
Examples
- Get all persons of all types from all places
- Get all persons of all types from 1212
- Get all persons of type staff from all places
- Get all persons of type affiliated from all places
- Get all persons of type student from all places
- Get all persons of type staff from 1212
- Get all persons of type affiliated from 1212
- Get all persons of type student from 1212
place – look up information about a place ➠
placeid | number |
Content-Type: text/xml
...
staff – look up extra information about employees of UiB ➠
id | string | user account id |
Content-Type: text/xml
<staff> <id>...</id> <name>...</name> <place>...</place> ... </staff>
Content-Type: text/plain
No data
Examples:
GET http://sebra.uib.no/sws/staff?id=gaa041 returns the following:
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Fri, 18 Jun 2010 11:30:52 GMT
Server: Apache/2.2.11 (Unix) mod_python/3.3.1 Python/2.6.1 mod_ssl/2.2.11 OpenSSL/0.9.7d
Content-Type: text/xml
Keep-Alive: timeout=5, max=100
<?xml version="1.0" encoding="iso-8859-1"?>
<staff> <id>gaa041</id>
<name>Gisle Aas</name>
<firm>760</firm>
<place>221000</place>
<code>1087</code>
<title>Overingeni\xF8r</title>
<title_english>Chief Engineer</title_english>
<pct>100.0</pct>
</staff>\n
GET http://sebra.uib.no/sws/staff?id=none returns the following:
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Fri, 18 Jun 2010 11:30:52 GMT
Server: Apache/2.2.11 (Unix) mod_python/3.3.1 Python/2.6.1 mod_ssl/2.2.11 OpenSSL/0.9.7d
Content-Type: text/plain
Keep-Alive: timeout=5, max=100
No data