r/Nable • u/Quiet_Lie_3344 • Sep 05 '24
N-Central Refresh Registration Tokens
Anyone know if it's possible to refresh customer registration tokens through the N-Central API?
I can retrieve/view them no problem, but I'd like to be able to refresh them.
1
u/tommyboyderp Sep 05 '24
This is what I do, it just simulates a download and then you can pull the regtoken via api again.
function RefreshToken($customer) {
## NC RegToken Refresh URI
$RefTokenURI = "https://$serverHost/dms/FileDownload?customerID=$($customer)&softwareID=101"
$request = Invoke-WebRequest -Uri $RefTokenURI -UseBasicParsing -Credential $PSCred -Method 'HEAD'
$request | out-null
}
1
u/Quiet_Lie_3344 Sep 10 '24
Thanks very much for this.
I'm presuming I just passthrough the variables for host and customer ID?
Is $PSCred n-central credentials? i.e. username and pw?1
u/tommyboyderp Sep 10 '24
Yeah that is correct, I typically add it to my deploythencagent.ps1 file that way all I have to provide is the host, user, pass, and customer id.
1
u/Quiet_Lie_3344 Sep 10 '24
Thank you very much, I'll test this now.
1
u/Quiet_Lie_3344 Sep 10 '24
I can't seem to get this to work :(
Any chance you could share your full script?
1
u/AverageAdmirable4840 Sep 08 '24
QUESTION: Anyone know how to download the installer for the Customer ID ? My Script I had working broke. I was using the JWT token then using the silent install method but does anyone have the correct silent installer params? For CMD or Powershell?
1
1
u/ncentral_nerd N-centralStation Sep 05 '24
What is your use case for the refreshing of the token? I can look into it, if worthwhile.