This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Has anyone used SWQL or SQL to update a Bearer Token value for an API Poller?

We have a token that we renew on a regular basis.  When we have monthly patching and reboots of systems, the token is expiring during this process.  I created a .bat file that can generate a new token and I can parse it out to get the new token.  I would like to store it in the existing Bearer Token, or create a new one and update the token being used by the 5 other API Pollers that are using the same Bearer Token.  Any ideas on how to update this information with a script?

Parents Reply
  • Orion.Credential UpdateCredentials (int id, Dictionary<string, string> properties)

    The SWIS verb. I cannot get the second paramater of the function to pass correctly without it throwing an error. I looked at Credential Management · solarwinds/OrionSDK Wiki · GitHub, for what keys it requires. When i formatted it like this as an xml doc first, it threw some sort of error for  not having an "add" function which made me think it indeed does want it as a dictionary. But everytime i tried pass a dictionary it told me it was the incorrect format.
    How am i supposed to pass the xml string in a dictionary format?

    If you got it working, can you show me an example format?

Children
  • You may be able to skip this step by generating the bearer in a login step, then turning it into a variable for reuse within the API poller, however if this method is the required one, I'll take a look when I can, Got some UTF8 code in PS laying around. The SWQL studio expanded api field should have a description of the format required