This is a dart/flutter API client for the Polymorph Musketeer API.

Getting Started

Initialize the client with the Musketeer base URL and your API key and secret.

Musketeer.init("https://example.com/msuk", "CLIENT KEY", "api-key-guid");

Usage

Query/Filter Instances

final data = 
    await InstanceQuery(8220)
      .filter('Name', 'John')
      .filter('Surname', 'Smith')
      .get();

or with a Parent ID

final data = 
    await InstanceQuery(8220)
      .withParentId(123)
      .filter('Name', 'John')
      .filter('Surname', 'Smith')
      .get();

Fetching Instances

var fllId = 8220;
var client = InstanceClient(fllId);
var instances = await client.get();

Posting Instances

var fllId = 8220;
var client = InstanceClient(fllId);

 var instance = Instance(fllId: fllId, id: 0, parentId: 0, fields: {"Title": "Test title"});
 await client.post([instance]);

Login

User Login

final client = AuthClient();
final user = await client.login('UserName', 'Password');

Function Login

final client = FunctionAuthClient(11079, "Username");
final user = await client.login('FunctionUser', 'Password');

Get Fll Data for user community

final expenses = await InstanceQuery(user.community["Clients"]["Expenses"].id).get();
expect(expenses.isNotEmpty, true);

Libraries

musketeer_client