News
:: services/news module

This is a BETA module. We're looking for beta-testers. Until we find them, there's a substantial probability it won't stay backwards-compatible! If you are planning on using this module, please let us know. Then, we will work with you and move it out of beta as soon as we can.

These methods allow you to view university and faculty news.

Methods

article BETA Retrieve a single news article by ID.
articles BETA Retrieve multiple articles by their IDs.
category_index BETA Retrieve the list of all existing article categories.
search BETA Search for articles with simple filters.

services/news/article

Consumer: required Token: optional Scopes: n/a SSL: required
https://usosapps.demo.usos.edu.pl/services/news/article

This is a BETA method. We're looking for beta-testers. Until we find them, there's a substantial probability it won't stay backwards-compatible! If you are planning on using this method, please let us know. Then, we will work with you and move it out of beta as soon as we can.

Retrieve a single news article by ID.

article_id required ID of the article you want to retrieve information on.
fields optional

Default value: id|author|publication_date|title|headline_html

Selector of result fields you are interested in. The selector may contain any subset of fields, which are described in the returns section.

format optional

Default value: json

Format in which to return values. See supported output formats.

callback optional

Required only if you've chosen jsonp as a return format.

Plus required standard OAuth Consumer signing arguments: oauth_consumer_key, oauth_nonce, oauth_timestamp, oauth_signature, oauth_signature_method, oauth_version. Plus optional oauth_token for Token authorization.

Returned value:

A dictionary of selected fields and their values.

Available fields:

  • id - ID of the article;

  • author - langdict; the author of the article;

  • publication_date - datetime string; article publication date;

  • title - langdict; title of the article;

  • headline_html - HTML langdict (langdict with HTML in its values); headline of the article;

  • content_html - HTML langdict (langdict with HTML in its values); content of the article;

  • expiry_date - datetime string; date from which the article is considered "archived";

  • category - category of the article.

    This field references objects returned by category_index method. See its returns section for possible subfields.

  • faculty - faculty the article is related to.

    You can use primary subfields from services/fac/faculty method.

  • image_urls - dictionary of URLs or nulls; these URLs point to different versions of the main image for this article.

    Each value contains either the URL an image, or null if the article does not have an image. All of these returned images are the same, but in various dimensions. Use a subfield selector to choose the wanted sizes/dimensions of the image.

    Currently available subfields:

    • original - original version of the image. This image may come in any dimensions. It can actually be smaller than the ones in other fields.

    • 1:1 aspect ratio images:

      • 30x30 - 30px x 30px,
      • 40x40 - 40px x 40px,
      • 60x60 - 60px x 60px,
      • 80x80 - 80px x 80px,
      • 120x120 - 120px x 120px,
      • 135x135 - 135px x 135px,
      • 160x160 - 160px x 160px,
      • 180x180 - 180px x 180px,
      • 270x270 - 270px x 270px,
      • 360x260 - 360px x 360px,
      • 540x540 - 540px x 540px,
      • 720x720 - 720px x 720px,
    • 16:9 aspect ratio images:

      • 270x152 - 270px x 152px,
      • 360x203 - 360px x 203px,
      • 540x304 - 540px x 304px,
      • 720x405 - 720px x 405px,
      • 1080x608 - 1080px x 608px,
      • 1440x810 - 1440px x 810px,
  • image_description - langdict; description/caption of the image.

    It may contain, for example, the title of the image, the photographer's name, or copyright notes.

  • event - dictionary; describes the event associated with the article.

    If no event is associated with this article, then this dictionary will still be non-null, but all of its fields will contain nulls.

    It has the following structure:

    • start_date - datetime string or null; the beginning of the event,
    • end_date - datetime string or null; the end of the event,
    • city - string or null; name of the city/locality of the event",
    • address - string or null; address of the event with no city/locality included,
    • geo_lat - float or null; geographical latitude of the event's place (in degrees, north is positive),
    • geo_long: float or null; geographical longitude of the event's place (in degrees, east is positive).

services/news/articles

Consumer: required Token: optional Scopes: n/a SSL: required
https://usosapps.demo.usos.edu.pl/services/news/articles

This is a BETA method. We're looking for beta-testers. Until we find them, there's a substantial probability it won't stay backwards-compatible! If you are planning on using this method, please let us know. Then, we will work with you and move it out of beta as soon as we can.

Retrieve multiple articles by their IDs.

article_ids required Pipe-separated list of article IDs to be retrieved.
fields optional

Default value: id|author|publication_date|title|headline_html

Selector of result fields you are interested in. The selector may contain any subset of fields, which are described in the returns section of article method.

format optional

Default value: json

Format in which to return values. See supported output formats.

callback optional

Required only if you've chosen jsonp as a return format.

Plus required standard OAuth Consumer signing arguments: oauth_consumer_key, oauth_nonce, oauth_timestamp, oauth_signature, oauth_signature_method, oauth_version. Plus optional oauth_token for Token authorization.

Returned value:

A dictionary that will map your article_ids to article objects, as defined in the aricle method.

If the article cannot be found, or you don't have access to it, then the ID you have supplied will still be present in this response, but the value mapped to it will be null (instead of an object).

services/news/category_index

Consumer: required Token: optional Scopes: n/a SSL: required
https://usosapps.demo.usos.edu.pl/services/news/category_index

This is a BETA method. We're looking for beta-testers. Until we find them, there's a substantial probability it won't stay backwards-compatible! If you are planning on using this method, please let us know. Then, we will work with you and move it out of beta as soon as we can.

Retrieve the list of all existing article categories. This list includes the default category, which contains all news that weren't assigned to any other specific category.

fields optional

Default value: id|name

Selector of result fields you are interested in. The selector may contain any subset of fields, which are described in the returns section.

format optional

Default value: json

Format in which to return values. See supported output formats.

callback optional

Required only if you've chosen jsonp as a return format.

Plus required standard OAuth Consumer signing arguments: oauth_consumer_key, oauth_nonce, oauth_timestamp, oauth_signature, oauth_signature_method, oauth_version. Plus optional oauth_token for Token authorization.

Returned value:

A dictionary of selected fields and their values.

Available fields:

  • id - ID of the category;

  • name - langdict; name of the category.

Consumer: required Token: optional Scopes: n/a SSL: required
https://usosapps.demo.usos.edu.pl/services/news/search

This is a BETA method. We're looking for beta-testers. Until we find them, there's a substantial probability it won't stay backwards-compatible! If you are planning on using this method, please let us know. Then, we will work with you and move it out of beta as soon as we can.

Search for articles with simple filters.

from_date optional

Default value: (empty string)

Datetime string. If given, then only those articles which have publication date greater or equal to this date, will be returned.

facpattern optional

Default value: (empty string)

Optional filter of faculties in the "facpattern" format, as described in the services/fac/resolve_facpattern method. If given, then only such news which belong to the faculties matching this pattern will be returned.

category_ids optional

Default value: (empty string)

The list of article category IDs. If given, then only such articles which are in one of the specified categories, will be returned. Existing categories may be retrieved via the category_index method.

num optional

Default value: 6

The number of articles to return. The maximum allowed value is 100.

start optional

Default value: 0

The index of the first matching article that is to be included in the response (zero-based).

fields optional

Default value: items[article[id]]|next_page|total

Selector of result fields you are interested in. The selector may contain any subset of fields, which are described in the returns section.

format optional

Default value: json

Format in which to return values. See supported output formats.

callback optional

Required only if you've chosen jsonp as a return format.

Plus required standard OAuth Consumer signing arguments: oauth_consumer_key, oauth_nonce, oauth_timestamp, oauth_signature, oauth_signature_method, oauth_version. Plus optional oauth_token for Token authorization.

Returned value:

A dictionary of the following structure:

  • items - a list of matching articles. The length of this list is limited to num items. You can access further results by specifing the start argument.

    Each item on this list is a dictionary of the following structure (more keys may be added in the future):
    • article - article object as described in the article method
  • next_page - boolean, indicates if there is a next page of results;

  • total - integer, a total number of matched items; if the number of matched items is huge, then USOS API may return an approximate count (especially if start is equal to 0).

USOS API ver. 7.1.1.0-1, f733442d, dirty (2024-11-25)