From 5da7e1eff0e0fdc7ab596409cba06c7e20f43645 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Tue, 8 Dec 2015 15:57:08 -0500 Subject: [PATCH] Move stuff to the wiki and leave just a `README` here --- -.md | 20 -------------------- Following.md | 47 ----------------------------------------------- Health.md | 28 ---------------------------- Home.md | 17 ----------------- News.md | 41 ----------------------------------------- README.md | 12 ++++++++++-- Root.md | 20 -------------------- Users.md | 32 -------------------------------- 8 files changed, 10 insertions(+), 207 deletions(-) delete mode 100644 -.md delete mode 100644 Following.md delete mode 100644 Health.md delete mode 100644 Home.md delete mode 100644 News.md delete mode 100644 Root.md delete mode 100644 Users.md diff --git a/-.md b/-.md deleted file mode 100644 index 3e0422c..0000000 --- a/-.md +++ /dev/null @@ -1,20 +0,0 @@ -### GET `/` - -Provides basic information about the API and related support materials. It is intended as a "catch all" for individuals who are exploring or testing the API for the first time. - -#### Request URL -`https://api.scratch.mit.edu/` - -#### Example Request -```bash -curl -X GET "https://api.scratch.mit.edu/" -``` - -#### Example Response -```json -{ - "api": "api.scratch.mit.edu", - "help": "help@scratch.mit.edu", - "website": "scratch.mit.edu" -} -``` \ No newline at end of file diff --git a/Following.md b/Following.md deleted file mode 100644 index cd96cc4..0000000 --- a/Following.md +++ /dev/null @@ -1,47 +0,0 @@ -### GET `/users/:id/following` - -Returns an array of users that the specified user is following. - -#### Request URL -`https://api.scratch.mit.edu/users/:id/following` - -#### Request Parameters -* **:id** – the username of the user for whom to get the following list - -#### Example Request -```bash -curl -X GET "https://api.scratch.mit.edu/users/mres/following" -curl -X GET "https://api.scratch.mit.edu/users/mres/following?limit=2" -``` - -#### Example Response -```json -[ - { - "id":4373272, - "username":"FunKitten2006", - "history":{ - "joined":"2014-06-22T22:52:19.000Z", - "login":"2015-12-04T15:50:56.000Z" - }, - "profile":{ - "id":4373272, - "avatar":"437/3272.png", - "status":"I am working on making Scratch videos to help Scratchers. I now have a new studio called \nTutor Help Studio. I hope this will help a lot of kids on Scratch. Thank you Scratch Team and thanks too you.","bio":"I love creating stuff on Scratch." - } - }, - { - "id":11756170, - "username":"cartoonnetwork", - "history":{ - "joined":"2015-09-09T18:30:33.000Z", - "login":"2015-12-04T15:27:05.000Z" - }, - "profile":{ - "id":11756170, - "avatar":"1175/6170.png", - "status":"We’re working on our We Bare Bears projects: playing hide and seek with the bears, showing off our sweet b-ball moves, and creating interactive #bearstack stories! Have fun remixing our projects!","bio":"We’re home to a bunch of creative and fun programs like Adventure Time and We Bare Bears, that not only encourage kids to think outside the box, but way outside of their own world." - } - } -] -``` \ No newline at end of file diff --git a/Health.md b/Health.md deleted file mode 100644 index ca2d178..0000000 --- a/Health.md +++ /dev/null @@ -1,28 +0,0 @@ -### GET `/health` - -Used by the load balancer and related monitoring systems to return the status of a given API node. - -#### Request URL -`https://api.scratch.mit.edu/health` - -#### Example Request -```bash -curl -X GET "https://api.scratch.mit.edu/health" -``` - -#### Example Response -```json -{ - "uptime":3083522, - "load":[ - 0.0537109375, - 0.0458984375, - 0.0478515625 - ], - "sql":{ - "started":"2015-11-24T17:26:38.842Z", - "min":0, - "max":20 - } -} -``` \ No newline at end of file diff --git a/Home.md b/Home.md deleted file mode 100644 index 58fb039..0000000 --- a/Home.md +++ /dev/null @@ -1,17 +0,0 @@ -Welcome to the Scratch REST API! Here you can find information on how to read and write data from and to [Scratch](https://scratch.mit.edu) programmatically. To get started, here's some general information on how our API works, and its current status. - -## Getting Started -The Scratch REST API is interactable through HTTPS requests. Though some of our endpoints require that you are an authenticated Scratch user to access, you can easily get started and see how the API works with some of our public enpoints. For example: - -`curl -X GET https://api.scratch.mit.edu/users/mres/following` - -will return a JSON object containing the list of people user `mres` is following. All API endpoints will fall under the `api.scratch.mit.edu` domain. - -## Query Parameters -The API provides two optional query parameters that can be used to limit and/or paginate routes that return an array. `limit` defaults to `20` items which is the maximum number of items that the API will return at any one time. `offset` defaults to `0` but can be any number up to `9007199254740991` (the maximum 64-bit floating point value). - -## Rate Limits -coming soon! - -## Authentication -coming soon! \ No newline at end of file diff --git a/News.md b/News.md deleted file mode 100644 index 99ec831..0000000 --- a/News.md +++ /dev/null @@ -1,41 +0,0 @@ -### GET `/news` - -Returns the latest news items from the Scratch's [Tumblr](blogscratch.tumblr.com) account. This route parses each Tumblr post and returns an array of objects suitable for rendering on the Scratch splash page. - -#### Request URL -`https://api.scratch.mit.edu/news` - -#### Example Request -```bash -curl -X GET "https://api.scratch.mit.edu/news" -``` - -#### Example Response -```json -[ - { - "copy": "Create a project to celebrate the 150th Anniversary of Alice in Wonderland for the new Scratch Design Studio!", - "headline": "New Scratch Design Studio!", - "id": 133670008323, - "image": "https://40.media.tumblr.com/1c34c83f9dcaee31422e88bd88de4f00/tumblr_inline_nwuaehA1SR1szpavb_540.png", - "stamp": "2015-11-21T18:46:35.000Z", - "url": "https://scratch.mit.edu/studios/1672164/" - }, - { - "copy": "We\u2019re launching the first of many upgrades to the Scratch website! Learn more\u2026", - "headline": "Updates to Scratch Homepage!", - "id": 131962619508, - "image": "https://36.media.tumblr.com/b8e8bc37f38a135a0f873a6fe7788701/tumblr_inline_nwuak8hOun1szpavb_540.png", - "stamp": "2015-09-26T18:12:32.000Z", - "url": "https://scratch.mit.edu/discuss/topic/163894/" - }, - { - "copy": "Want to know what\u2019s happening on Scratch? Check out the latest video update!", - "headline": "Scratch Video Update: Episode 11", - "id": 130146748093, - "image": "https://40.media.tumblr.com/b563e9425dfca8ac53396d997db312ba/tumblr_inline_nwua1f4Chy1szpavb_540.png", - "stamp": "2015-09-29T18:55:34.000Z", - "url": "https://scratch.mit.edu/discuss/topic/154790/" - } -] -``` \ No newline at end of file diff --git a/README.md b/README.md index e53b1e5..d473b04 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ -# scratch-rest-api -Documentation for how to interact with the Scratch REST API +# Scratch REST API +Welcome to the Scratch REST API! Here you can find information on how to read and write data from and to [Scratch](https://scratch.mit.edu) programmatically. + +### This API is in development +Right now, we're in the process of building the next version of Scratch. Part of that includes building this REST API to allow people to access the site's data directly. It might take some time to complete the entire thing, but we will continue to update this repo with new documentation as we build new parts of the API. + +### To Get Started +Head over to the [wiki](https://github.com/LLK/scratch-rest-api/wiki) to find out more information about how to use this API, and what features are currently available. + +Also make sure to check out Scratch's [open source web client](https://github.com/LLK/scratch-www) too! diff --git a/Root.md b/Root.md deleted file mode 100644 index 3e0422c..0000000 --- a/Root.md +++ /dev/null @@ -1,20 +0,0 @@ -### GET `/` - -Provides basic information about the API and related support materials. It is intended as a "catch all" for individuals who are exploring or testing the API for the first time. - -#### Request URL -`https://api.scratch.mit.edu/` - -#### Example Request -```bash -curl -X GET "https://api.scratch.mit.edu/" -``` - -#### Example Response -```json -{ - "api": "api.scratch.mit.edu", - "help": "help@scratch.mit.edu", - "website": "scratch.mit.edu" -} -``` \ No newline at end of file diff --git a/Users.md b/Users.md deleted file mode 100644 index ee119ae..0000000 --- a/Users.md +++ /dev/null @@ -1,32 +0,0 @@ -### GET `/users/:id` - -Returns basic information about the specified user based on the provided username. - -#### Request URL -`https://api.scratch.mit.edu/users/:id` - -#### Request Parameters -* **:id** – the username of the user for whom to get information - -#### Example Request -```bash -curl -X GET "https://api.scratch.mit.edu/users/mres" -``` - -#### Example Response -```json -{ - "history": { - "joined": "2007-03-07T03:50:14.000Z", - "login": "2015-11-25T06:16:12.000Z" - }, - "id": 167, - "profile": { - "avatar": "0/0167.png", - "bio": "I'm a professor at the MIT Media Lab. But more important: I'm a member of the Scratch Team! \n\nCheck out my TED talk about Scratch: http://bit.ly/mres-ted-talk", - "id": 29, - "status": "I'm working on new technologies and activities to support the four P's of creative learning: Projects, Peers, Passion, and Play" - }, - "username": "mres" -} -``` \ No newline at end of file