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

CLI API Tool #273

Merged
merged 14 commits into from
Jan 31, 2022
Merged

CLI API Tool #273

merged 14 commits into from
Jan 31, 2022

Conversation

shubhank-saxena
Copy link
Contributor

Description

This PR will create a CLI tool to interact with API

@shubhank-saxena shubhank-saxena changed the title [WIP] CLI API Tool CLI API Tool Sep 14, 2021
cli-tool/README.md Outdated Show resolved Hide resolved
cli-tool/README.md Outdated Show resolved Hide resolved
cli-tool/cli.py Outdated Show resolved Hide resolved
def login():
"""Login to your account."""

email = input('Enter your email address: ')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

email or username is valid, so this could ask for any of the two enter email or username type

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if we want to keep both username or email, we will have to pass two different params in the request. And then two different variables/inputs would be needed from user

cli-tool/cli.py Outdated Show resolved Hide resolved
else:
global AUTH_KEY, USERNAME, EMAIL
AUTH_KEY = config('AUTH_KEY')
USERNAME = config('USERNAME')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've logged in, and see that .env creates the entry USERNAME
However here when I print USERNAME it is set to 'user' - AUTH_KEY and EMAIl are correct from .env

So my-media gives error results (queries https://demo.mediacms.io/api/v1/media?author=user instead of https://demo.mediacms.io/api/v1/media?author=markos in my case)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not able to replicate this error. I am getting correct media and username :(

@mgogoulos
Copy link
Contributor

Adding this as a baseline for the CMD client, thanks!

@mgogoulos mgogoulos merged commit 0d4918a into mediacms-io:main Jan 31, 2022
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 this pull request may close these issues.

2 participants