!!! OAuth 1.0 Authentication Error with FatSecret API Requests in Python
51 views
Skip to first unread message
Александр Ким
unread,
Apr 28, 2024, 6:55:59 PMApr 28
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to FatSecret Platform API
I am experiencing an issue with making API requests to the FatSecret platform using Python. While I am able to successfully make requests using Postman with OAuth 1.0 authentication, attempting the same via Python results in an error indicating a missing required OAuth parameter: oauth_signature_method.
Issue Description: When making requests via Python using libraries such as requests_oauthlib or Authlib, the code for example:
import requests from requests_oauthlib import OAuth1
However, when the same request is made through Postman with identical OAuth parameters, it succeeds without any issues. Below are the details of the request and the parameters used in both environments.
Request Details:
API Method: food_entries.get.v2 Date Parameter: 19824 Format: json OAuth Parameters: oauth_consumer_key, oauth_token, oauth_signature_method, oauth_timestamp, oauth_nonce, oauth_version, and oauth_signature.
Libraries used: requests_oauthlib and Authlib Python Version: 3.8 I have tried multiple approaches to resolve this, including checking library versions, reconfiguring OAuth settings, and directly replicating the headers and parameters from Postman into Python code. Despite these efforts, the error persists.
Could you please provide guidance on how to resolve this issue or let me know if there are any specific requirements or settings for making OAuth-authenticated requests to FatSecret APIs using Python? Any assistance or insights you could offer would be greatly appreciated.
Thank you for your support and looking forward to your swift response.