Difference between revisions of "REST API"

From the Directed Edge Developer Base
Jump to: navigation, search
(start new api documentation)
 
(basic structure)
Line 1: Line 1:
The [http://www.directededge.com/ Directed Edge] [[Wikipedia:REST|REST API]] is a fairly simple way of modeling a collection of items and the relationships between them.  These relationships are used as the basis for finding similar items or delivering personalized recommendations to a user.
+
The Directed Edge [[Wikipedia:REST|REST]] API is a fairly simple way of modeling a collection of items and the relationships between them.  These relationships are used as the basis for finding similar items or delivering personalized recommendations to a user.  Information is encoded using our [[XML Format]] using notions from the [[API Concepts]].
  
== Introduction ==
+
REST APIs allow for using the [[Wikipedia:Hypertext Transfer Protocol#Request_methods|HTTP methods]] GET, PUT, POST and DELETE on various resources.  We'll explain below which of these are allowed.
  
=== Everything is an item ===
+
Let's have a look at an example URL:
  
A product is an ''item''. A user is an ''item''. A web page is an ''item''.
+
  <nowiki>https://username:password@webservices.directededge.com/api/v1/wikipedia/</nowiki>
  
Items have tags, which is the usual way to differentiate between themSo a user is just an item with the tag "user"A product is an item with the tag "product".
+
This is the URL for the wikipedia databaseMany of the elements are constant &mdash; notably the host name, and the ''api/v1'' sectionsWe'll break down the other components in the following sections.
  
You can create item types in an ad-hoc fashion, and items can have multiple tags, so you can also have an item with the tags ''product'' and ''sci-fi'', for example.
+
== HTTP and HTTPS ==
  
== XML Format ==
+
== API Authentication ==
 +
 
 +
== Database resource ==
 +
 
 +
=== HTTP GET ===
 +
 
 +
=== HTTP PUT ===
  
== API Authentication ==
+
== Item resource ==
 +
 
 +
=== HTTP GET ===
  
=== HTTP Basic ===
+
=== HTTP PUT ===
  
== Database API ==
+
=== HTTP DELETE ===
  
== Item API ==
+
=== Add and remove sub-resources ===
  
=== Name ===
+
==== HTTP PUT ====
  
=== Links ===
+
== Related / recommended resources ==
  
=== Tags ===
+
=== HTTP GET ===
  
=== Properties ===
+
=== Query Parameters ===

Revision as of 02:34, 23 May 2009

The Directed Edge REST API is a fairly simple way of modeling a collection of items and the relationships between them. These relationships are used as the basis for finding similar items or delivering personalized recommendations to a user. Information is encoded using our XML Format using notions from the API Concepts.

REST APIs allow for using the HTTP methods GET, PUT, POST and DELETE on various resources. We'll explain below which of these are allowed.

Let's have a look at an example URL:

https://username:password@webservices.directededge.com/api/v1/wikipedia/

This is the URL for the wikipedia database. Many of the elements are constant — notably the host name, and the api/v1 sections. We'll break down the other components in the following sections.

HTTP and HTTPS

API Authentication

Database resource

HTTP GET

HTTP PUT

Item resource

HTTP GET

HTTP PUT

HTTP DELETE

Add and remove sub-resources

HTTP PUT

Related / recommended resources

HTTP GET

Query Parameters