Skip to content

Investec data

TIP

This tutorial assumes that you have completed the Get Started Guide

In this tutorial, we will explore how to access and retrieve your personal data using the Giga SDK for South Africa Private Bank APIs. You will learn how to manipulate this data according to your preferences and integrate it with other external APIs for enhanced functionality. Throughout this tutorial, we will be utilising the giga-ai plugin service.

Upon finishing this section, you will have acquired the skills to:

1. Use the giga sdk to get your account information.

The following code will get your account information for the current profile you are on and return it.

ts
giga.api.privateClient.pbsa.accounts.list().then((res) => {
    return res.result;
})
giga.api.privateClient.pbsa.accounts.list().then((res) => {
    return res.result;
})

2. Use the giga sdk to get your transactions for a specific account.

The following code will get your transaction information for the first account and return it for a specific date range.

ts
async function getTransactionData() {
    try {
      const transactions = await giga.api.privateClient.pbsa.transactions.get({
        accountId: accountList.result.PrivateBankAccounts[0].AccountNumberForRequests,
        dateFrom: '09/10/2022',
        dateTo: '08/11/2022'
      });
      return transactions.result;
    } catch (error) {
      console.error(error);
    }
  }
async function getTransactionData() {
    try {
      const transactions = await giga.api.privateClient.pbsa.transactions.get({
        accountId: accountList.result.PrivateBankAccounts[0].AccountNumberForRequests,
        dateFrom: '09/10/2022',
        dateTo: '08/11/2022'
      });
      return transactions.result;
    } catch (error) {
      console.error(error);
    }
  }

3. Use the giga sdk to get your beneficiaries.

The following code will get your beneficiaries for the current profile and return it.

ts
giga.api.privateClient.pbsa.beneficiaries.list().then(res => {
    return res.result
})
giga.api.privateClient.pbsa.beneficiaries.list().then(res => {
    return res.result
})