The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/tokenpass/server/functions/getProtectedTokenpassBalanc...

24 lines
660 B

import { Meteor } from 'meteor/meteor';
import { HTTP } from 'meteor/http';
import { settings } from '../../../settings';
let userAgent = 'Meteor';
if (Meteor.release) { userAgent += `/${ Meteor.release }`; }
export const getProtectedTokenpassBalances = function(accessToken) {
try {
return HTTP.get(
`${ settings.get('API_Tokenpass_URL') }/api/v1/tca/protected/balances`, {
headers: {
Accept: 'application/json',
'User-Agent': userAgent,
},
params: {
oauth_token: accessToken,
},
}).data;
} catch (error) {
throw new Error(`Failed to fetch protected tokenpass balances from Tokenpass. ${ error.message }`);
}
};