fromecoderdojo

Inspiring kids to be creative and have fun with the internet

API Integration CSS HTML API Game programming II Game programming Algorithms JavaScript HTML/CSS
7 October 2019

API Integration

by Agustin & Felipe

Description

In this class we are going to learn about web services exposed via REST entpoints. We will be using those to show how dynamic content is generated in the backend and we will build a simple HTML site to consume the information and show it to users via a browser. If none of this makes sense to you, then come along and find out! :)

Kids work

Server

Client

Course #8

curl -X GET \
  https://dtawyo8d49.execute-api.us-east-1.amazonaws.com/test/animals \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Host: dtawyo8d49.execute-api.us-east-1.amazonaws.com' \
[{
  "id": 1,
  "name": "Tiger",
  "picture": "https://images.app.goo.gl/1nZRXrPixorEXYgS7",
  "fun_fact": "The tiger is the biggest species of the cat family"
},
{
  "id": 2,
  "name": "Badger",
  "picture": "https://images.app.goo.gl/hVf5rGCNGbHutaNQ6",
  "fun_fact": "UK biggest predator"
}]


curl http://host/path
curl -H 'Accept: application/json' http://host/path
curl -verbose http://host/path
curl -XPUT ....

Playing time

Let’s try to integrate with our animals API to find out more details about the data we consume

tags: api - kids