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

Documentation on the API #28

Closed
xrd opened this issue Dec 5, 2017 · 7 comments
Closed

Documentation on the API #28

xrd opened this issue Dec 5, 2017 · 7 comments
Assignees

Comments

@xrd
Copy link

xrd commented Dec 5, 2017

Is there documentation on using the API that appears in the routes? Is this a standard interaction if you know the routing framework for Django? My goal is to have a webhook hit the app and add data to the database. Is there a way to protect this other than IP whitelisting?

@cdubz
Copy link
Member

cdubz commented Dec 5, 2017

Thanks for the prompt. I keep thinking about this and then forgetting it.

So the app uses the Django REST Framework plugin and should be fairly straight forward. If you run the development server you can access the full API Browser from the user menu and poke around.

I need to figure out how security works though and get some documentation in. I believe it uses the Django account for auth but I have no idea how.

I’ll work on this soon. Any support/observations are welcome if you do mess around with it.

@xrd
Copy link
Author

xrd commented Dec 5, 2017

I'm not a Python user generally. Can you point me to directions on how to run the app in development mode? Is that in the readme?

I'll poke around with curl and see if I can come up with some examples of how it works and add them to the thread.

@cdubz
Copy link
Member

cdubz commented Dec 5, 2017

See Development - Installation for instructions.

After reading up on this bit, I don't think you'll get very far though. I believe I need to configure Token Authentication in order to allow requests outside of a regular app session authentication. I'll work on getting this and some documentation in place soon.

@cdubz cdubz self-assigned this Dec 5, 2017
@xrd
Copy link
Author

xrd commented Dec 5, 2017

OK. My intention was to find a way to allow Google Home to communicate with the app. Since I'm not much of a python person, I hacked together a ruby version which you can find in a branch on my fork. If you are interested, I can share the DialogFlow project with you so you can understand how it works. Right now all that works is just adding feedings, but it will be simple enough to add the rest.

@cdubz cdubz closed this as completed Dec 5, 2017
@cdubz
Copy link
Member

cdubz commented Dec 5, 2017

Oops! Didn't mean to close that, hah.

I have made the necessary changes to use token-based authentication through DRF. Just need to add documentation and then I'll push it all up (after work in a few hours).

@cdubz cdubz reopened this Dec 5, 2017
@xrd
Copy link
Author

xrd commented Dec 5, 2017

Cool. I'll check it out then. Also, my fork has nginx+ssl support which is necessary for Google Home if you want that for this project.

@cdubz
Copy link
Member

cdubz commented Dec 6, 2017

Just pushed all the new API code and documentation. If you update an existing instance, you'll need to run the the migrate command again as some database changes were made.

Hop on gitter or open another issue if you have suggestions or trouble.

I'll take a look at your fork. It would be good to have instruction for SSL set up now, but I worry about things getting too complicated.

@cdubz cdubz closed this as completed Dec 6, 2017
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

No branches or pull requests

2 participants