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.
replace_article BETA Create or replace an article. (administrative)
search BETA Search for articles with simple filters.

services/news/article

Consumer: required Token: optional Scopes: n/a SSL: required
https://apps.uwm.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://apps.uwm.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://apps.uwm.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.

services/news/replace_article

Administrative: This method requires a proper Administrative Consumer Key. Contact us to get one.

Consumer: required (administrative) Token: ignored Scopes: n/a SSL: required
https://apps.uwm.edu.pl/services/news/replace_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.

Create a new article, or replace an existing one:

  • If the object provided in the article parameter does not contain an "id" field, then a new article will be created.
  • If it does contain an "id" field, then an existing article will be replaced. In this case, the "id" must refer to an existing article. Replacing is equivalent to deleting an article and then inserting it "from scratch" - the article field must contain all data you want to keep.
article required

A JSON object describing the article to be inserted (or the new content of the article which you want replaced).

It must have the same structure as the object returned by article method. It also must meet the following requirements:

  • title:pl, headline_html:pl and faculty:id fields are required.
  • For all "subobjects" which contain an "id" field (such as category or faculty) it is enough to specify their id, the rest of the subfields will be ignored.
  • image_urls field is ignored. You should use the image_file parameter to pass your image.
image_file optional

Image file to be used as cover photo. Non-JPEG images will be converted to JPEG on the fly.

crop_region_square optional

A square region of the image to be used when returning the 1:1 image_urls. A string with 4 comma-separated integers, left,top,right,bottom, in Android's Rect format.

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. Token is not required.

Returned value:

Dictionary of the following structure:

  • article_id - the ID of the newly created (or updated) article,
Consumer: required Token: optional Scopes: n/a SSL: required
https://apps.uwm.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: total|next_page|items[article[id]]

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. 6.5.1.0-1, 8fcc7858 (2019-10-08)