Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Latest commit

 

History

History
115 lines (78 loc) · 3.24 KB

ExpensesApi.md

File metadata and controls

115 lines (78 loc) · 3.24 KB

BasiqApi.ExpensesApi

All URIs are relative to https://au-api.basiq.io

Method HTTP request Description
getExpenses GET /users/{userId}/expenses/{snapshotId} Retrieves the details of an expenses summary. You need only supply the unique expenses identifier.
postExpenses POST /users/{userId}/expenses Use this to create a new expenses report.

getExpenses

ExpensesResponse getExpenses(userId, snapshotId)

Retrieves the details of an expenses summary. You need only supply the unique expenses identifier.

Example

var BasiqApi = require('@basiq/basiq-javascript-sdk');
var defaultClient = BasiqApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: application
var application = defaultClient.authentications['application'];
application.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new BasiqApi.ExpensesApi();

var userId = "userId_example"; // String | The identifier of the user.

var snapshotId = "snapshotId_example"; // String | The identifier of the expenses report to be retrieved.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getExpenses(userId, snapshotId, callback);

Parameters

Name Type Description Notes
userId String The identifier of the user.
snapshotId String The identifier of the expenses report to be retrieved.

Return type

ExpensesResponse

Authorization

application

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/csv

postExpenses

ExpensesResponse postExpenses(userId, opts)

Use this to create a new expenses report.

Example

var BasiqApi = require('@basiq/basiq-javascript-sdk');
var defaultClient = BasiqApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: application
var application = defaultClient.authentications['application'];
application.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new BasiqApi.ExpensesApi();

var userId = "userId_example"; // String | The identifier of the user.

var opts = { 
  'expensesPostRequest': new BasiqApi.ExpensesPostRequest() // ExpensesPostRequest | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.postExpenses(userId, opts, callback);

Parameters

Name Type Description Notes
userId String The identifier of the user.
expensesPostRequest ExpensesPostRequest [optional]

Return type

ExpensesResponse

Authorization

application

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json