PHP code example of mapmyplan / basiq-sdk-php

1. Go to this page and download the library: Download mapmyplan/basiq-sdk-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mapmyplan / basiq-sdk-php example snippets


// Used to handle the token session
use MMPBasiq\Session;

// Used to manipulate jobs and connections
use MMPBasiq\Services\ConnectionService;

// Used to manipulate users
use MMPBasiq\Services\UserService;

use MMPBasiq\Session;

$session = new Session("YOUR_API_KEY");

$institutions = $session->getInstitutions();

use MMPBasiq\Session;

$session = new Session("YOUR_API_KEY", "2.0");

$institutions = $session->getInstitutions();

use MMPBasiq\Session;

$session = new Session("YOUR_API_KEY");

$user = $session->forUser($userId);

$job = $user->createConnection($institutionId, $userId, $password[, $securityCode, $secondaryLoginId]);

// Poll our server to wait for the credentials step to be evaluated
$connection = job->waitForCredentials(1000, 60);

use MMPBasiq\Session;
use MMPBasiq\Utilities\FilterBuilder;

$session = new Session("YOUR_API_KEY");

$user = $session->forUser($userId);

$fb = new FilterBuilder();
$fb->eq("connection->id", "conn-id-213-id");
$transactions = $user->getTransactions($fb);


while ($transactions->next()) {
        var_dump("Next transactions len:", len(transactions.Data))
}

public $response;
public $statusCode;
public $message;

use MMPBasiq\Utilities\FilterBuilder;

$fb = new FilterBuilder();
$fb->eq("connection->id", "conn-id-213-id")->gt("transaction.postDate", "2018-01-01")
$transactions = $user->getTransactions(fb);

$session = new Session("YOUR_API_KEY");

$userService = new UserService($session);

$user = $userService->forUser($userId);

$user = $userService->create(["email" => "", "mobile" => ""]);

$user = $userService->get($userId);

$user = $userService->update($userId, ["email" => "", "mobile" => ""]);

null = $userService->delete($userId);

$jobs = $userService->refreshAllConnections($userId);

$conns = $userService->getAllConnections($userId[, $filter]);

$acc = $userService->getAccount($userId, $accountId);

$accs = $userService->getAccounts($userId[, $filter]);

$transaction = $userService->getTransaction($userId, $transactionId);

$transactions = $userService->getTransactions($userId[, $filter]);

$connService = new ConnectionService($session, $user);

$connection = $connService->get($connectionId);

$connection = $connService->for($connectionId);

$job = $connService->create(["institutionId" => "", "loginId" => "", "password" => "", "securityCode" => "", "secondaryLoginId" => ""]);

$job = $connService->update($connectionId, $password);

null = $connService->delete($connectionId);

$job = $connService->getJob($jobId);

$user = $user->update(["email" => "", "mobile" => ""]);

null = $user->delete();

$accounts = $user->getAccounts();

$account = $user->getAccount($accountId);

$transactions = $user->getTransactions($filterBuilder = null, $limit = null < 500);

$transaction = $user->getTransaction($transactionId);

$job = $user->createConnection(["institutionId" => "", "loginId" => "", "password" => "", "securityCode" => "", "secondaryLoginId" => ""]);

$jobs = $user->refreshAllConnections();

$job = $connection->refresh();

$job = $connection->update($password);

null = $connection->delete();

$connectionId = $job->getConnectionId();

$connection = $job->getConnection();

$connection = $job->waitForCredentials($interval, $timeout);

$connection = $job->waitForTransactions($interval, $timeout);

$next = $transactions->next();
bash
composer