Skip to content

Conversation

@FreeMonkey19
Copy link

@FreeMonkey19 FreeMonkey19 commented Mar 16, 2020

Assignment Submission: Slack CLI

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Question Answer
How did you go about exploring the Slack API? Did you learn anything that would be useful for your next project involving an API? I read the API documentation which was pretty friendly with the exception of 'user token' and 'bot token' (a classmate helped me figure this out). Then I used Postman to see the JSON and to know how to drill into the object to get what I needed. For future projects similar to this, I will use Postman again.
Give a short summary of the request/response cycle. Where does your program fit into that scheme? The request/response cycle as I understand it: In a GET request, I ask the API for information. The API has a specific endpoint in which I can get information I need such as Users and Channels for this project. I set up my GET in the fashion that the API requires - send my request to the endpoint and receive a response from the API. I can then manipulate the data to fit the needs of my app.
How does your program check for and handle errors when using the Slack API? I did not get this far. However, for this specific API you cannot check for a 200 status code because Slack gives a 200 even when the request is a failure! Bad Slack!! So I would have to check that the response["ok"] == true (something like that).
How did the design and organization of your project change over time? This is a struggle for me. After implementing my get_all_users and get_all_channels methods in Workspace - I began to think that maybe I should have done that in the User and Channel classes instead ( use self.list_all ), but this did not make sense to me until yesterday. And I was worried about refactoring and breaking my code - so I left it as is. However, next time...and there will be a next time...I will use class methods for 'get.all'.
Did you use any of the inheritance idioms we've talked about in class? How? I'm not clear on inheritance idioms. I need to do some research here. If you mean did I have a parent class...yes. Recipient is the parent of User and Channel. I used super(slack_id, name).
How does VCR aid in testing a program that uses an API? VCR is a valuable tool that allows developers to test their API even when the API is down (the info needed is saved to a 'cassette' so don't need the API all the time). Also, because VCR takes a snapshot of the query/command to the API, it saves on money - if indeed the API was charging for using its service.

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