API JS - SID and user

Topic: API JS - SID and user

By means of API JS getting the SID how can I know the parent account of the user that I entered?


Creative account "transportLine", user that was created by the account "monitor1". So what is required is that with the SID of the monitor user he can know the "TransportLine" account. Can it be done with the JS API?


API JS - SID and user

(edited by rual 28/09/2018 12:09:48)

Re: API JS - SID and user

When you login, there is user.bact field with user's account id.

But if you need parent account, execute core/get_account_data:

session.getAccountData(false, function(error, result) { console.log(result); })

It will contain parentAccountId and parentAccountName.