How to set a global variable from an API respond value (Authentication token)

As Marek_Melocik says above, to persist a variable, you have to save to permanent memory, so review the below: