Skip to content

ThexXTURBOXx/dart-studip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.