René's URL Explorer Experiment


Title: TCX endpoint decoding error error · Issue #175 · orcasgit/python-fitbit · GitHub

Open Graph Title: TCX endpoint decoding error error · Issue #175 · orcasgit/python-fitbit

X Title: TCX endpoint decoding error error · Issue #175 · orcasgit/python-fitbit

Description: The Get Activity TCX has a UTF-8 XML response, so it creates an error when called using the API code which seems to expect a JSON response. Traceback: DEBUG:requests_oauthlib.oauth2_session:Invoking 0 protected resource request hooks. DE...

Open Graph Description: The Get Activity TCX has a UTF-8 XML response, so it creates an error when called using the API code which seems to expect a JSON response. Traceback: DEBUG:requests_oauthlib.oauth2_session:Invokin...

X Description: The Get Activity TCX has a UTF-8 XML response, so it creates an error when called using the API code which seems to expect a JSON response. Traceback: DEBUG:requests_oauthlib.oauth2_session:Invokin...

Opengraph URL: https://github.com/orcasgit/python-fitbit/issues/175

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TCX endpoint decoding error error","articleBody":"The [Get Activity TCX](https://dev.fitbit.com/build/reference/web-api/activity/get-activity-tcx/) has a UTF-8 XML response, so it creates an error when called using the API code which seems to expect a JSON response.\r\n\r\nTraceback:\r\n```\r\nDEBUG:requests_oauthlib.oauth2_session:Invoking 0 protected resource request hooks.\r\nDEBUG:requests_oauthlib.oauth2_session:Adding token {'access_token': '********', 'refresh_token': '********''} to request.\r\nDEBUG:requests_oauthlib.oauth2_session:Requesting url https://api.fitbit.com/1/user/-/activities/123456789d.tcx using method GET.\r\nDEBUG:requests_oauthlib.oauth2_session:Supplying headers {'Accept-Language': 'en_US', 'Authorization': 'Bearer ********'} and data {}\r\nDEBUG:requests_oauthlib.oauth2_session:Passing through key word arguments {'params': {}}.\r\nDEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.fitbit.com:443\r\nDEBUG:urllib3.connectionpool:https://api.fitbit.com:443 \"GET /1/user/-/activities/123456789.tcx HTTP/1.1\" 200 1025205\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\my_username\\Miniconda3\\envs\\fitbit\\Lib\\site-packages\\fitbit\\api.py\", line 266, in make_request\r\n    rep = json.loads(response.content.decode('utf8'))\r\n          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"C:\\Users\\my_username\\Miniconda3\\envs\\fitbit\\Lib\\json\\__init__.py\", line 346, in loads\r\n    return _default_decoder.decode(s)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"C:\\Users\\my_username\\Miniconda3\\envs\\fitbit\\Lib\\json\\decoder.py\", line 337, in decode\r\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\r\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"C:\\Users\\my_username\\Miniconda3\\envs\\fitbit\\Lib\\json\\decoder.py\", line 355, in raw_decode\r\n    raise JSONDecodeError(\"Expecting value\", s, err.value) from None\r\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\my_username\\fitbit\\scripts\\fitbit\\get_activity.py\", line 143, in \u003cmodule\u003e\r\n    main()\r\n  File \"C:\\Users\\my_username\\fitbit\\scripts\\fitbit\\get_activity.py\", line 128, in main\r\n    data = client.activity_tcx(log_id=55044510633)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"C:\\Users\\my_username\\fitbit\\scripts\\fitbit\\get_activity.py\", line 84, in get_activity_tcx\r\n    return self.make_request(url, params=params)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"C:\\Users\\my_username\\Miniconda3\\envs\\fitbit\\Lib\\site-packages\\fitbit\\api.py\", line 268, in make_request\r\n    raise exceptions.BadResponse\r\nfitbit.exceptions.BadResponse\r\n```\r\n\r\nMy environment:\r\n- Python 3.11\r\n- Windows 10\r\n- `fitbit` version 0.3.1\r\n\r\nThis is the code I'm using to access this endpoint, which I bound as a method to the `fitbit.Fitbit` class.\r\n\r\n```python\r\ndef get_activity_tcx(self, log_id, user_id: str = None, **params):\r\n\t\"\"\"\r\n\tGet Activity TCX\r\n\thttps://dev.fitbit.com/build/reference/web-api/activity/get-activity-tcx/\r\n\t\"\"\"\r\n\tapi, ver, user_id = self._get_common_args(user_id=user_id)\r\n\turl = f\"{api}/{ver}/user/{user_id}/activities/{log_id}.tcx\"\r\n\treturn self.make_request(url, params=params)\r\n\r\ndef get_activity_log_list(self, user_id: str = None, **params):\r\n\t\"\"\"\r\n\tGet Activity Log List\r\n\thttps://dev.fitbit.com/build/reference/web-api/activity/get-activity-log-list/\r\n\r\n\tUsage:\r\n\t\u003e\u003e\u003e client.activity_log_list(afterDate='2023-01-01', offset=0,\r\n\t\u003e\u003e\u003e limit=100, sort='asc')\r\n\t\"\"\"\r\n\tapi, ver, user_id = self._get_common_args(user_id=user_id)\r\n\turl = f\"{api}/{ver}/user/{user_id}/activities/list.json\"\r\n\treturn self.make_request(url, params=params)\r\n```","author":{"url":"https://github.com/Joe-Heffer-Shef","@type":"Person","name":"Joe-Heffer-Shef"},"datePublished":"2023-04-27T12:57:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/175/python-fitbit/issues/175"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ee172f65-5504-b06b-9171-35b6dd7f4487
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDE44:346A19:170175:2017BC:69720DE5
html-safe-nonce74b938d35cbd2f6bea534689c8e0e38ed0e8f84e1610a80796bdd9b4a897f23d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTQ0OjM0NkExOToxNzAxNzU6MjAxN0JDOjY5NzIwREU1IiwidmlzaXRvcl9pZCI6Ijg4MDA4NDU0NzQwMDk1ODMwNzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2733def903c9edb20b1f0aa0c5107c49f78f303bd0ff1c0fe23f8e1e60272e36
hovercard-subject-tagissue:1686801109
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/orcasgit/python-fitbit/175/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c454030ad0a7bc431d63c338fc18e5ec596d4358f638becfdcdaf3eda571232f/orcasgit/python-fitbit/issues/175
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c454030ad0a7bc431d63c338fc18e5ec596d4358f638becfdcdaf3eda571232f/orcasgit/python-fitbit/issues/175
og:image:altThe Get Activity TCX has a UTF-8 XML response, so it creates an error when called using the API code which seems to expect a JSON response. Traceback: DEBUG:requests_oauthlib.oauth2_session:Invokin...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJoe-Heffer-Shef
hostnamegithub.com
expected-hostnamegithub.com
None453de246939b1e04d711e109432e2df10933270413df93b7a8f8f1df8dda7f18
turbo-cache-controlno-preview
go-importgithub.com/orcasgit/python-fitbit git https://github.com/orcasgit/python-fitbit.git
octolytics-dimension-user_id9833
octolytics-dimension-user_loginorcasgit
octolytics-dimension-repository_id3472837
octolytics-dimension-repository_nwoorcasgit/python-fitbit
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3472837
octolytics-dimension-repository_network_root_nwoorcasgit/python-fitbit
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release12756e5bdb9000be815bbf20a1acc7935638e596
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/orcasgit/python-fitbit/issues/175#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Forcasgit%2Fpython-fitbit%2Fissues%2F175
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Forcasgit%2Fpython-fitbit%2Fissues%2F175
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=orcasgit%2Fpython-fitbit
Reloadhttps://patch-diff.githubusercontent.com/orcasgit/python-fitbit/issues/175
Reloadhttps://patch-diff.githubusercontent.com/orcasgit/python-fitbit/issues/175
Reloadhttps://patch-diff.githubusercontent.com/orcasgit/python-fitbit/issues/175
orcasgit https://patch-diff.githubusercontent.com/orcasgit
python-fitbithttps://patch-diff.githubusercontent.com/orcasgit/python-fitbit
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Forcasgit%2Fpython-fitbit
Fork 334 https://patch-diff.githubusercontent.com/login?return_to=%2Forcasgit%2Fpython-fitbit
Star 638 https://patch-diff.githubusercontent.com/login?return_to=%2Forcasgit%2Fpython-fitbit
Code https://patch-diff.githubusercontent.com/orcasgit/python-fitbit
Issues 40 https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/issues
Pull requests 20 https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/pulls
Actions https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/actions
Projects 0 https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/projects
Wiki https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/security
Please reload this pagehttps://patch-diff.githubusercontent.com/orcasgit/python-fitbit/issues/175
Insights https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/pulse
Code https://patch-diff.githubusercontent.com/orcasgit/python-fitbit
Issues https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/issues
Pull requests https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/pulls
Actions https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/actions
Projects https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/projects
Wiki https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/wiki
Security https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/security
Insights https://patch-diff.githubusercontent.com/orcasgit/python-fitbit/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/orcasgit/python-fitbit/issues/175
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/orcasgit/python-fitbit/issues/175
TCX endpoint decoding error errorhttps://patch-diff.githubusercontent.com/orcasgit/python-fitbit/issues/175#top
https://github.com/Joe-Heffer-Shef
https://github.com/Joe-Heffer-Shef
Joe-Heffer-Shefhttps://github.com/Joe-Heffer-Shef
on Apr 27, 2023https://github.com/orcasgit/python-fitbit/issues/175#issue-1686801109
Get Activity TCXhttps://dev.fitbit.com/build/reference/web-api/activity/get-activity-tcx/
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.