Creative Computing: Week 12
Interface Concept Presentations
Assignments
Interface: Build your API interface! Due week 15.
Getting Started with the Cooper Hewitt API
Jump to Creating an Account, Understanding Objects, Understanding AJAX, or Using the Cooper Hewitt API.
Creating an Account
Before gaining access to the Cooper Hewitt's API, we need to make an account. We can do this by going to the Cooper Hewitt Collection Site, selecting the "You" dropdown from the top left, and selecting "Create an Account." This gives us access to the API Homepage, which will serve as a reference going forward. If you ever need to find something out about the API, that page is a good place to start.
Once you have your account, the next thing you need to do is create an access token. Access tokens are what the API uses to know that you are you, and not somebody else. Every time you request information from the API, you will provide your access token so the API knows who you are. You can create an access token on this page. Enter a name for your application, set the permissions to "read," and make the token valid until you revoke it. Agree to the terms, and you will be given an access token. We will need this token later on, so leave this tab open. If you ever need to get your access token again, you can find it on the list of all your access tokens.
Understanding Objects
There's one last data type in JavaScript we haven't covered that you'll need to know before proceeding: objects. Objects are like Arrays in that they can contain many other kinds of variables. The difference with objects is that the order doesn't matter, and instead of a position in an array (0, 1, 2, etc.), the object's elements have names.
Here's an empty object: