Help

Update your client key data

You can update your application name, callback URL, and contact name and email for your client key yourself.

You need your client key (the one you want to update) and an access token for that same key, generated with the client credentials grant using your client key and secret. Follow these steps to generate one. Tokens issued on behalf of a user are not accepted.

Usage

Send a PATCH request with the usual Api-Key and Authorization headers and a JSON body. Include only the fields you want to change:

ParamValue
application_title The application name your users see on the OAuth2 authorization page. Up to 240 characters.
callback_uri Your callback URL. To register more than one, separate them with spaces; the first one is used when an authorization request doesn't include a redirect_uri. The value you send replaces all of your current callback URLs. Up to 765 characters.
requester_name The name of the contact person for your client key. Up to 64 characters.
requester_email The email address we use to contact you about your client key. A single address, up to 64 characters.
        import requests

        url = 'https://api.mapmyfitness.com/v7.2/api_client/yourclientkey/'

        headers = {'Authorization': 'Bearer yourtoken', 'Api-Key': 'yourclientkey'}

        data = {'requester_name': 'Jane Doe', 'requester_email': 'jane.doe@example.com'}

        response = requests.patch(url, headers=headers, json=data)

        

A successful request returns 200 with your updated client key data. If any field can't be updated or a value isn't valid, the request returns 400 with the reasons and nothing is changed. A 403 means the token isn't a client credentials token for the client key in the URL.

You can issue a GET request to the same endpoint, using your client key, to see your current client key data. Your client secret is not included in the response.

        import requests

        url = 'https://api.mapmyfitness.com/v7.2/api_client/yourclientkey/'

        headers = {'Authorization': 'Bearer yourtoken', 'Api-Key': 'yourclientkey'}

        key_data = requests.get(url, headers=headers)