4

A 403 "Developer Inactive" error is received when trying to post to the access_token endpoint in the UnderArmour Connected Fitness api. The client_id being used is active. The url used in the call is: https://api.ua.com/v7.1/oauth2/access_token/

This is a snippet of the call using python, after having obtained the authorization code:

import requests 
access_token_url = 'https://api.ua.com/v7.1/oauth2/access_token/'

access_token_data = {'grant_type': 'authorization_code', 
                     'client_id': CLIENT_ID,
                     'client_secret': CLIENT_SECRET,
                     'code': authorize_code}

response = requests.post(url=access_token_url, data=access_token_data)

In [24]: response
Out[24]: <Response [403]>

In [25]: response.content
Out[25]: '<h1>Developer Inactive</h1>'

where CLIENT_ID and CLIENT_SECRET are my registered values on the developer's portal.

jhanifen
  • 4,441
  • 7
  • 43
  • 67
UA Support
  • 71
  • 1
  • 4

1 Answers1

3

All calls made to api.ua.com must include an 'api-key' header value, otherwise, you'll get the 403 Developer Inactive error.

This snippet shows how to do it, in python:

import requests 
access_token_url = 'https://api.ua.com/v7.1/oauth2/access_token/'

access_token_data = {'grant_type': 'authorization_code', 
                     'client_id': CLIENT_ID,
                     'client_secret': CLIENT_SECRET,
                     'code': authorize_code}

headers = {'api-key': CLIENT_ID}

response = requests.post(url=access_token_url, data=access_token_data, headers=headers)

In [30]: response
Out[30]: <Response [200]>

In [31]: response.content
Out[31]: '{"user_id": "<user_id>", "access_token": "<access token>", "expires_in": 2591999, "token_type": "Bearer", "scope": "read", "user_href": "/v7.1/user/<user id>/", "refresh_token": "<refresh token>"}'
UA Support
  • 71
  • 1
  • 4