Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
We have the response body as a String. Let's convert it into an Object so that we can access the data more programmatically.
API URL
Due to a recent change in the routing of our website the path as shown in the video is no longer working. You'll want to change the URL to be:
// Connect to the API URL
https://teamtreehouse.com/profiles/csalgado.json
Documentation
Snippet
function printMessage(username, badgeCount, points) {
const message = `${username} has ${badgeCount} total badge(s) and ${points} points in JavaScript`;
console.log(message);
}
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up