def create_pat(self, desc):
"""
Creates a personal access token.
:param String desc A description for the token
:rtype:
A string representing the Personal Access Token
"""
params = {
'description': desc
}
self.headers['Content-Type'] = 'application/json'
data = self._post('/me/tokens', params)
return data.get('accessToken')
API documentation indicates an OTP. However your script doesnt account for that.
Important Notice: This request must be authenticated with your username and password using the HTTP Basic Authentication scheme or via OAuth, and a valid OTP token via the OTP-Token header.
When attempting to manually request a PAT using curl and assuming OTP is via "Authy" I get the following message
If OTP (One Time Password, also known as Two-Factor Authentication) is required, then you will get an HTTP 401 (Unauthorized) response, along with the HTTP header OTP-Token: Required.
Looking at the response above this is not the case.
There is no explanation as to why get pat fails.
your Python SDK uphold.py function for creat_pat below doesn't appear to be injecting username and password in there. Your API documentation show un/pw required. https://uphold.com/en/developer/api/documentation/#personal-access-tokens-pat
API documentation indicates an OTP. However your script doesnt account for that.
When attempting to manually request a PAT using curl and assuming OTP is via "Authy" I get the following message
FURTHER MORE: API documentation states below https://uphold.com/en/developer/api/documentation/#basic-authentication
So how do I get a PAT via Python ?????