You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
May just be a string if you'd like to not specify any additional options such as serverId to which will default to the 1 as default or whatever was instanciated with the instance.
whitelistOptions.apiId
Yes
String
Must have at least apiId or accId
whitelistOptions.accId
Yes
String
Must have at least apiId or accId
whitelistOptions.serverId
Yes
Number
Checks whitelist of specific server Id instead of default or set server ID at instance initialization..
Returns whitelistResult;
Property
Optional
Type
Note
whitelistResult.success
No
Boolean
Wether the whitelist verification was successful
whitelistResult.reason
Yes
String
Username if success is truthy, fail reason if success is falsy
Example Code
constSonoran=require('sonoran.js');constinstance=Sonoran.instance({communityId: 'mycommunity',apiKey: 'e6ba9d68-ca7a-4e59-a9e2-93e275b4e0bf',product: Sonoran.productEnums.CMS,serverId: 2});// This will verify the whitelist of the given API ID or account ID for server id 2 as specified aboveconstverification=awaitinstance.cms.verifyWhitelist('459798465498798432');// This will verify the whitelist of the given API ID for server id 1 since I specified thatconstverification=awaitinstance.cms.verifyWhitelist({apiId: '459798465498798432',serverId: 1});// OR// This will verify the whitelist of the given account ID for server id 1 since I specified thatconstverification=awaitinstance.cms.verifyWhitelist({accId: 'd5663516-ee35-11e9-9714-5600023b2434',serverId: 1});if(verification.success){console.log('Success!',verification.reason);}else{console.log('Unsuccessful',verfication.reason);// Log the reason it was unsuccessful.}
constSonoran=require('sonoran.js');constinstance=Sonoran.instance({communityId: 'mycommunity',apiKey: 'e6ba9d68-ca7a-4e59-a9e2-93e275b4e0bf',product: Sonoran.productEnums.CMS});// This will get the community account with the given API ID if there's one foundconstcomAccount=awaitinstance.cms.getComAccount({apiId: '235947056630333440'});// OR// This will get the community account with the given username if there's one foundconstcomAccount=awaitinstance.cms.getComAccount({username: 'Dawson G.'});// OR// This will get the community account with the given account ID if there's one foundconstcomAccount=awaitinstance.cms.getComAccount({accId: '67ceebae-ee63-43c1-a6a6-5234b2210abf'});if(comAccount.success){console.log('Success! Account data:',comAccount.data);}else{console.log('Unsuccessful',comAccount.reason);}
clockInOut(data)
Parameter
Optional
Type
Note
data.apiId
Yes
String
Must have at least apiId or accId
data.accId
Yes
String
Must have at least apiId or accId
data.forceClockIn
Yes
Boolean
Will start a new clock in and overrite any current clock in
Returns clockResult;
Property
Optional
Type
Note
clockResult.success
No
Boolean
Wether the whitelist verification was successful
clockResult.clockedIn
Yes
Boolean
Wether the account was clocked in or out if success is truthy
clockResult.reason
Yes
String
Fail reason if success is falsy
Example Code
constSonoran=require('sonoran.js');constinstance=Sonoran.instance({communityId: 'mycommunity',apiKey: 'e6ba9d68-ca7a-4e59-a9e2-93e275b4e0bf',product: Sonoran.productEnums.CMS});// This will override any current clock in and will start a new one on the community account found by the specified API ID if foundconstclockResult=awaitinstance.cms.clockInOut({apiId: '235947056630333440',forceClockIn: true});// OR// This will either clock in or out the community account found by the specified API ID if found.// Will determine to clock in or out depending on what is pending.constclockResult=awaitinstance.cms.clockInOut({apiId: '235947056630333440'});// OR// This will either clock in or out the community account found by the specified accId if found.// Will determine to clock in or out depending on what is pending.constclockResult=awaitinstance.cms.clockInOut({accId: '67ceebae-ee63-43c1-a6a6-5234b2210abf'});if(clockResult.success){console.log(`Success! Clocked in? ${clockResult.clockedIn ? 'Yes!' : 'No!'}`);}else{console.log('Unsuccessful',comAccount.reason);}
checkComApiId(apiId)
Parameter
Optional
Type
apiId
Yes
String
Returns checkResult;
Property
Optional
Type
Note
checkResult.success
No
Boolean
Wether the whitelist verification was successful
checkResult.username
Yes
String
Username for the account found with the API ID given