Request Variations Based On Auth Level
The TradrAPI SDK supports multiple authentication levels where each level carries a different set of information to the API, for example being authenticated at a Project level will let TradrAPI know which project the request is for, however it will not inherently know which user the request might be for (if any).
To address this, all applicable methods in the SDK provide a brandUserId
parameter with the specific purpose of allowing
you to pass in the user ID of the user you are making the request on behalf of. This is only applicable to requests that
require a user ID, and will be ignored if the authentication level does not support it.
All User
level authentication requests DO NOT require the brandUserId
parameter to be passed in. All other levels
DO require the brandUserId
parameter to be passed in.
The SDK methods which require a brandUserId
parameter will have an optional brandUserId
parameter in the method
signature which should be passed in as the last parameter if required.
let brandUserId = '7c9c3a6e-539d-45e2-abb6-c91d7b9c8b46';
// Example of a method that requires a brandUserId
const result = await tradrApi.accounts.open(body, brandUserId);
For accounts opened with Tradelocker, the brandUserId
must be a 24 character string or a UUID.