studip 3.0.0-alpha.0 copy "studip: ^3.0.0-alpha.0" to clipboard
studip: ^3.0.0-alpha.0 copied to clipboard

A simple-to-use wrapper for Stud.IP's RestAPI service in Dart.

example/studip_example.dart

import 'dart:developer';

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

/// How to retrieve data very simply
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
    log('${decoded['data']['attributes']['formatted-name']}');
  });
}
1
likes
50
pub points
45%
popularity

Publisher

verified publisherfemtopedia.de

A simple-to-use wrapper for Stud.IP's RestAPI service in Dart.

Repository (GitHub)
View/report issues

Topics

#rest #studip #web

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

http, oauth2_client

More

Packages that depend on studip