Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.2 KB

README.md

File metadata and controls

47 lines (35 loc) · 1.2 KB

Stud.IP

A library which provides simple access to Stud.IP's RestAPI services using OAuth 2 authentication for Dart.

Usage

Add to pubspec.yaml:

dependencies:
  studip: ^3.0.0-alpha.0

A simple usage example:

import 'package:studip/studip.dart' as studip;

void main() {
  const studIpProviderUrl = 'http://studip.uni-passau.de/studip/';
  const apiBaseUrl = '${studIpProviderUrl}jsonapi.php/v1/';

  // Initialize client and log in
  final client = studip.StudIPClient(
    oAuthBaseUrl: studIpProviderUrl,
    redirectUri: 'example://oauth_callback',
    customUriScheme: 'example',
    clientId: 'CLIENT_ID',
    //clientSecret: 'CLIENT_SECRET_IF_NEEDED',
    apiBaseUrl: apiBaseUrl,
  );

  client.apiGetJson('users/me').then((dynamic decoded) {
    // Example parsing of response
    print('${decoded['data']['attributes']['formatted-name']}');
  });
}

Features and bugs

Please file feature requests and bugs at the issue tracker.