Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use environment variable instead of fixed url in code #209

Closed
Sandro-Meireles opened this issue Jan 27, 2023 · 1 comment · Fixed by #233
Closed

Use environment variable instead of fixed url in code #209

Sandro-Meireles opened this issue Jan 27, 2023 · 1 comment · Fixed by #233

Comments

@Sandro-Meireles
Copy link
Collaborator

The following lines use a fixed URL instead environment variable. There is already a variable that has the same value WHATSAPP_API_URL

response = requests.get(url=f"https://graph.facebook.com/v14.0/{waba_id}/message_templates", params=params)

response = requests.get(url=f"https://graph.facebook.com/v14.0/{waba_id}", params=params)

response = requests.post(url=f"https://graph.facebook.com/v14.0/{waba_id}/message_templates", params=params)

return requests.delete(url=f"https://graph.facebook.com/v14.0/{waba_id}/message_templates", params=params)

In addition, it would be more interesting to use a method that returns the URL from the endpoint to avoid rework, like: https://github.com/weni-ai/weni-integrations-engine/pull/207/files#diff-1be15eeb5dbb3513b189266691c6b4af6e9c40df745b24f0b2a5d17e844cfeedR28

@matmsa27
Copy link
Contributor

matmsa27 commented Apr 10, 2023

This PR #233 fixed and change the code to use the environment variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants