SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
usable
                              REST APIs
{"links":[
 {"rel":"author",    "uri":"http://javier-ramirez.com"},
 {"rel":"work",      "uri":"http://aspgems.com"},
 {"rel":"blog",      "uri":"http://formatinternet.com"},
 {"rel":"twittEr",   "uri":"http//twitter.com/supercoco9"}
]}
1996
1995
1996
1994
2001
1999
2004
Web usability is an
approach to make web sites
    easy to use for an
  end-user, without the
   requirement that any
   specialized training be
         undertaken.[
Learnability
EfficIeNcy
MemorabiliTy
Errors
SatisfActiOn
I want YOU
  to make
a (REST) API
REST in a
                       nutshell

client server stateless layered and cacheable
Resources
     Resource Identifiers
     Resource metadata
Uniform interface
     operations
     Representations
     Representation metadata
Optionally: code on demand
making a REST API
  with Rails?



   easy
BASIC
    WEB/api
functionality
   IN RAILS
Cohesion

pleasE
separation of concerns
SUCCESS consistently




       fail consistently
expose
   ONLY
 WHAT IS
 Strictly
necessary
resources are not models
Aggregation/
 composition




               Multiple
           representations
Multiple consumers
All your
 FORMAT
are belong
 to us
> curl -d "login=ficticious_user@invoicefu.com&password=keepdreaming" https://invoicefu.com/api/session?format=json

{"user":{"id":108,"name":"Nicolas Carroll","email":"ficticioususer@invoicefu.com","locale":"en","twitter_nickname
":null,"facebook_uid":null,"facebook_nickname":null,"api_key":"dbd349b30b6d9fde97b01b827e6be5ed1e4fbe72","links":
[{"rel":"session","uri":"https://invoicefu.com/api/session","methods":"GET,POST,DESTROY"},"rel":"account","uri":"
https://invoicefu.com/api/accounts/108-cole-mertz-fake","methods":"GET,PUT"},"rel":"clients","uri":"https://invoi
cefu.com/api/accounts/108-cole-mertz-fake/clients","methods":"GET,POST"},{"rel":"new_client","uri":"https://invoi
cefu.com/api/accounts/108-cole-mertz-fake/clients/new","methods":"GET"},{"rel":"invoices","uri":"https://invoicef
u.com/api/accounts/108-cole-mertz-fake/invoices","methods":"GET,POST"},{"rel":"new_invoice","uri":"https://invoic
efu.com/api/accounts/108-cole-mertz-fake/invoices/new","methods":"GET"},{"rel":"proformas","uri":"https://invoice
fu.com/api/accounts/108-cole-mertz-fake/proformas","methods":"GET,POST"},{"rel":"new_proforma","uri":"https://inv
oicefu.com/api/accounts/108-cole-mertz-fake/proformas/new","methods":"GET"}]}}
can I haz cat readable anzwa
>   curl -d "login=ficticioususer@invoicefu.com&password=yeahyeah" "https://invoicefu.com/api/session?&format=xml

<?xml version="1.0" encoding="UTF-8"?>
<user>
  <id>108</id>
  <name>Nicolas Carroll</name>
  <email>user000007@invoicefu.com</email>
  <locale>en</locale>
  <twitter-nickname nil="true"></twitter-nickname>
  <facebook-uid nil="true"></facebook-uid>
  <facebook-nickname nil="true"></facebook-nickname>
  <api-key>dbd349b30b6d9fde97b01b827e6be5ed1e4fbe72</api-key>
  <links>
    <link>
       <rel>session</rel>
       <uri>https://invoicefu-localhost.com/api/session</uri>
       <methods>GET,POST,DESTROY</methods>
    </link>
    <link>
       <rel>account</rel>
       <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake</uri>
       <methods>GET,PUT</methods>
    </link>
    <link>
       <rel>clients</rel>
       <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/clients</uri>
       <methods>GET,POST</methods>
    </link>
    <link>
       <rel>new_client</rel>
       <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/clients/new</uri>
       <methods>GET</methods>
    </link>
    (…)

  </links>
</user>
Accept: application/vnd.aspgems.invoicefu.v1.xml

   THE
 ACCEPT
 HEADER


HTTP/REST Standard        Not everyone          Less obvious
Unambiguous               supports headers      Harder to use
Resources !=              or custom types       Non standard content-
Representations                                 types
Version as you need it                          Skips HTTP server logs
templates
        for new
       resources
> curl "https://invoicefu.com/api/v1/accounts/108-cole-mertz-fake/invoices/new?
api_key=ddd349b30b6d9fde97b01b827e6be5ed1e4fbe72&format=json"

{"invoice":{"number":"2011/30","issued_on":"2011-12-
12","proforma_id":null,"notes":null,"footer":null,"locale":"en","currency_code":"USD","currency_sym
bol":"$","ac_name":"Cole-Mertz#FAKE","ac_company_number_name":"Company
number","ac_company_number":"25465828K","ac_tax_number_name":"VAT
Number","ac_tax_number":"ES25464828k","ac_address":"234 brecknock
road","ac_city":"london","ac_province":null,"ac_postal_code":"n18 5bq","ac_country_name":"United
Kingdom","cl_email":null,"cl_name":null,"cl_company_number_name":null,"cl_company_number":null,"cl_
tax_number_name":null,"cl_tax_number":null,"cl_address":null,"cl_city":null,"cl_province":null,"cl_
postal_code":null,"cl_country_name":null,"invoice_lines":[],"discount_percent":null,"tax_lines":
[{"name":"TVA","signed_percent":"19.6"}],"paid":"0.0","links":
[{"rel":"payments","uri":"https://invoicefu.com/api/accounts/108-cole-mertz-
fake/invoices//payments","methods":"POST"},
{"rel":"account","uri":"https://invoicefu.com/api/accounts/108-cole-mertz-
fake","methods":"GET,PUT"},{"rel":"client","uri":null,"methods":"GET,PUT,DELETE"},
{"rel":"proforma","uri":null,"methods":"GET,PUT,DELETE"},{"rel":"pdf","uri":null,"methods":"GET"},
{"rel":"invoices","uri":"https://invoicefu.com/api/accounts/108-cole-mertz-
fake/invoices","methods":"GET,POST"}]}}j
EASy
  To
 FIND
> curl https://invoicefu.com?format=xml   (or   curl -H "Accept: application/xml" "https://invoicefu.com")

<?xml version="1.0" encoding="UTF-8"?>
<invoicefu>
  <links>
    <link>
      <rel>session</rel>
      <uri>https://invoicefu.com/api/session</uri>
      <methods>POST.DELETE</methods>
    </link>
    <link>
      <rel>countries</rel>
      <uri>https://invoicefu.com/api/countries</uri>
      <methods>GET</methods>
    </link>
    <link>
      <rel>api_v1</rel>
      <uri>https://invoicefu.com/api/session?api_version=1</uri>
      <methods>POST.DELETE</methods>
    </link>
    <link>
      <rel>xml_representation</rel>
      <uri>https://invoicefu.com/api/session?format=xml</uri>
      <methods>POST.DELETE</methods>
    </link>
    <link>
      <rel>json_representation</rel>
      <uri>https://invoicefu.com/api/session?format=json</uri>
      <methods>POST.DELETE</methods>
    </link>
    <link>
      <rel>strict_parameters</rel>
      <uri>https://invoicefu.com/api/session?strict=true</uri>
      <methods>POST.DELETE</methods>
    </link>
  </links>
>   curl -d "login=ficticioususer@invoicefu.com&password=yeahyeah" "https://invoicefu.com/api/session?&format=xml

<?xml version="1.0" encoding="UTF-8"?>
<user>
  <id>108</id>
  <name>Nicolas Carroll</name>
  <email>user000007@invoicefu.com</email>
  <locale>en</locale>
  <twitter-nickname nil="true"></twitter-nickname>
  <facebook-uid nil="true"></facebook-uid>
  <facebook-nickname nil="true"></facebook-nickname>
  <api-key>dbd349b30b6d9fde97b01b827e6be5ed1e4fbe72</api-key>
  <links>
    <link>
       <rel>session</rel>
       <uri>https://invoicefu-localhost.com/api/session</uri>
       <methods>GET,POST,DESTROY</methods>
    </link>
    <link>
       <rel>account</rel>
       <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake</uri>
       <methods>GET,PUT</methods>
    </link>
    <link>
       <rel>clients</rel>
       <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/clients</uri>
       <methods>GET,POST</methods>
    </link>
    <link>
       <rel>new_client</rel>
       <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/clients/new</uri>
       <methods>GET</methods>
    </link>
    <link>
       <rel>invoices</rel>
       <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/invoices</uri>
       <methods>GET,POST</methods>
    </link>

     (…)

  </links>
</user>
BASIC ACCESS AUTHENTICATION
 authenticate_or_request_with_http_basic do |login, password|
   User.find_by_login_and_password login, password
 end
User and password must be passed every time




TOKEN
Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )
User.find_by_login_and_api_key( params[:login], params[:api_key] )
Client can send it as a parameter or as a header




OAUTH
Depends on third party libraries
Requires initial registration of client and more integration
Performance
params &
 debug
> curl "https://invoicefu.com/api/accounts/108-cole-mertz-fake/invoices/new?
api_key=ddd349b30b6d9fde97b01b827e6be5ed1e4fbe72&format=xml&debug=1"

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>extra params found: debug. Allowed params are:
account_id,client_id,invoice_id,proforma_id</error>
</errors>


> curl "https://invoicefu.com/api/accounts/108-cole-mertz-fake/invoices/new?
api_key=ddd349b30b6d9fde97b01b827e6be5ed1e4fbe72&format=xml&debug=1&strict=false"
<?xml version="1.0" encoding="UTF-8"?>
<invoice>
  <number>2011/30</number>
  <issued-on>2011-12-11</issued-on>
  <proforma-id nil="true"></proforma-id>
    (...)

 <links>
   (...)

    <link>
      <rel>invoices</rel>
      <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/invoices</uri>
      <methods>GET,POST</methods>
    </link>
  </links>
</invoice>
helping
     your users

      WADL
json schema
{                                                <?xml version="1.0"?>
     "name":"Product",                           <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     "properties":{                               xsi:schemaLocation="http://wadl.dev.java.net/2009/02 wadl.xsd"
        "id":{                                    xmlns:tns="urn:yahoo:yn"
           "type":"number",                       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                                                  xmlns:yn="urn:yahoo:yn"
           "description":"Product identifier",
                                                  xmlns:ya="urn:yahoo:api"
           "required":true                        xmlns="http://wadl.dev.java.net/2009/02">
        },                                         <grammars>
        "name":{                                     <include
           "description":"Name of the                  href="NewsSearchResponse.xsd"/>
product",                                            <include
           "type":"string",                            href="Error.xsd"/>
           "required":true                         </grammars>
        },
        "price":{                                  <resources base="http://api.search.yahoo.com/NewsSearchService/V1/">
                                                     <resource path="newsSearch">
           "required":true,
                                                       <method name="GET" id="search">
           "type": "number",                             <request>
           "minimum":0,                                    <param name="appid" type="xsd:string"
           "required":true                                   style="query" required="true"/> 22
        },                                                 <param name="type" style="query" default="all">
        "tags":{                                             <option value="all"/>
           "type":"array",                                   <option value="any"/>
           "items":{                                         <option value="phrase"/>
             "type":"string"                               </param>
           }                                               <param name="start" style="query" type="xsd:int" default="1"/>
                                                           <param name="language" style="query" type="xsd:string"/>
        }
                                                         </request>
     },                                                  <response status="200">
     "links":[                                             <representation mediaType="application/xml"
        {                                                    element="yn:ResultSet"/>
           "rel":"full",                                 </response>
           "href":"{id}"                                 <response status="400">
        },                                                 <representation mediaType="application/xml"
        {                                                    element="ya:Error"/>
           "rel":"comments",                             </response>
           "href":"comments/?id={id}"                  </method>
                                                     </resource>
        }
                                                   </resources>
     ]
   }                                             </application>
tools
curl
Hurl
Httparty
restclient
apigee
Usable Rest APIs by Javier Ramirez at London Ruby User Group
Usable Rest APIs by Javier Ramirez at London Ruby User Group

Weitere ähnliche Inhalte

Andere mochten auch

Finanzierung startup startimpuls bern jan 2013
Finanzierung startup startimpuls bern jan 2013Finanzierung startup startimpuls bern jan 2013
Finanzierung startup startimpuls bern jan 2013Nicolas Berg
 
120525 af internship invitation
120525 af internship invitation120525 af internship invitation
120525 af internship invitationDenish Anugra
 
Avaluacio multimedia
Avaluacio multimediaAvaluacio multimedia
Avaluacio multimediaMiriam Robles
 
Co working lloret by esther
Co working lloret   by estherCo working lloret   by esther
Co working lloret by estherCoWorking Lloret
 
El abuso sexual infantil
El abuso sexual infantilEl abuso sexual infantil
El abuso sexual infantilAreli Balboa
 
El Big Data y Business Intelligence en mi empresa: ¿de qué me sirve?
El Big Data y Business Intelligence en mi empresa: ¿de qué me sirve?El Big Data y Business Intelligence en mi empresa: ¿de qué me sirve?
El Big Data y Business Intelligence en mi empresa: ¿de qué me sirve?Alex Rayón Jerez
 
Trucos publicitarios colores
Trucos publicitarios coloresTrucos publicitarios colores
Trucos publicitarios coloresJair Reséndiz
 
Motor and gear engineering specialized in design, engineering and manufactu...
Motor and gear engineering   specialized in design, engineering and manufactu...Motor and gear engineering   specialized in design, engineering and manufactu...
Motor and gear engineering specialized in design, engineering and manufactu...Motor & Gear Engineering, Inc.
 
Chapter 3 (brand positioning)
Chapter 3 (brand positioning)Chapter 3 (brand positioning)
Chapter 3 (brand positioning)Jawad Chaudhry
 
Demostración de guiones periodísticos televisivos.
Demostración de guiones periodísticos televisivos.Demostración de guiones periodísticos televisivos.
Demostración de guiones periodísticos televisivos.Jibél Rojas
 
Virtual desktop infrastructure
Virtual desktop infrastructureVirtual desktop infrastructure
Virtual desktop infrastructureGokulan Subramani
 
2012 World Footwear Yearbook
2012 World Footwear Yearbook2012 World Footwear Yearbook
2012 World Footwear YearbookMelih ÖZCANLI
 

Andere mochten auch (20)

Edificio vicson margarita danies
Edificio vicson   margarita daniesEdificio vicson   margarita danies
Edificio vicson margarita danies
 
Finanzierung startup startimpuls bern jan 2013
Finanzierung startup startimpuls bern jan 2013Finanzierung startup startimpuls bern jan 2013
Finanzierung startup startimpuls bern jan 2013
 
120525 af internship invitation
120525 af internship invitation120525 af internship invitation
120525 af internship invitation
 
Avaluacio multimedia
Avaluacio multimediaAvaluacio multimedia
Avaluacio multimedia
 
Mil millones de bocas
Mil millones de bocasMil millones de bocas
Mil millones de bocas
 
Co working lloret by esther
Co working lloret   by estherCo working lloret   by esther
Co working lloret by esther
 
Resume revamp
Resume revampResume revamp
Resume revamp
 
Normas
NormasNormas
Normas
 
El abuso sexual infantil
El abuso sexual infantilEl abuso sexual infantil
El abuso sexual infantil
 
El Big Data y Business Intelligence en mi empresa: ¿de qué me sirve?
El Big Data y Business Intelligence en mi empresa: ¿de qué me sirve?El Big Data y Business Intelligence en mi empresa: ¿de qué me sirve?
El Big Data y Business Intelligence en mi empresa: ¿de qué me sirve?
 
Trucos publicitarios colores
Trucos publicitarios coloresTrucos publicitarios colores
Trucos publicitarios colores
 
Cmc origen sistema solar
Cmc origen sistema solarCmc origen sistema solar
Cmc origen sistema solar
 
Unidad3 valoraciones perito
Unidad3 valoraciones peritoUnidad3 valoraciones perito
Unidad3 valoraciones perito
 
Motor and gear engineering specialized in design, engineering and manufactu...
Motor and gear engineering   specialized in design, engineering and manufactu...Motor and gear engineering   specialized in design, engineering and manufactu...
Motor and gear engineering specialized in design, engineering and manufactu...
 
Chapter 3 (brand positioning)
Chapter 3 (brand positioning)Chapter 3 (brand positioning)
Chapter 3 (brand positioning)
 
Demostración de guiones periodísticos televisivos.
Demostración de guiones periodísticos televisivos.Demostración de guiones periodísticos televisivos.
Demostración de guiones periodísticos televisivos.
 
Virtual desktop infrastructure
Virtual desktop infrastructureVirtual desktop infrastructure
Virtual desktop infrastructure
 
2012 World Footwear Yearbook
2012 World Footwear Yearbook2012 World Footwear Yearbook
2012 World Footwear Yearbook
 
El TDAH en jóvenes y adultos. Por Javier Quintero
El TDAH en jóvenes y adultos. Por Javier QuinteroEl TDAH en jóvenes y adultos. Por Javier Quintero
El TDAH en jóvenes y adultos. Por Javier Quintero
 
Empresa telmex
Empresa telmexEmpresa telmex
Empresa telmex
 

Mehr von javier ramirez

¿Se puede vivir del open source? T3chfest
¿Se puede vivir del open source? T3chfest¿Se puede vivir del open source? T3chfest
¿Se puede vivir del open source? T3chfestjavier ramirez
 
QuestDB: The building blocks of a fast open-source time-series database
QuestDB: The building blocks of a fast open-source time-series databaseQuestDB: The building blocks of a fast open-source time-series database
QuestDB: The building blocks of a fast open-source time-series databasejavier ramirez
 
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...javier ramirez
 
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...javier ramirez
 
Deduplicating and analysing time-series data with Apache Beam and QuestDB
Deduplicating and analysing time-series data with Apache Beam and QuestDBDeduplicating and analysing time-series data with Apache Beam and QuestDB
Deduplicating and analysing time-series data with Apache Beam and QuestDBjavier ramirez
 
Your Database Cannot Do this (well)
Your Database Cannot Do this (well)Your Database Cannot Do this (well)
Your Database Cannot Do this (well)javier ramirez
 
Your Timestamps Deserve Better than a Generic Database
Your Timestamps Deserve Better than a Generic DatabaseYour Timestamps Deserve Better than a Generic Database
Your Timestamps Deserve Better than a Generic Databasejavier ramirez
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...javier ramirez
 
QuestDB-Community-Call-20220728
QuestDB-Community-Call-20220728QuestDB-Community-Call-20220728
QuestDB-Community-Call-20220728javier ramirez
 
Processing and analysing streaming data with Python. Pycon Italy 2022
Processing and analysing streaming  data with Python. Pycon Italy 2022Processing and analysing streaming  data with Python. Pycon Italy 2022
Processing and analysing streaming data with Python. Pycon Italy 2022javier ramirez
 
QuestDB: ingesting a million time series per second on a single instance. Big...
QuestDB: ingesting a million time series per second on a single instance. Big...QuestDB: ingesting a million time series per second on a single instance. Big...
QuestDB: ingesting a million time series per second on a single instance. Big...javier ramirez
 
Servicios e infraestructura de AWS y la próxima región en Aragón
Servicios e infraestructura de AWS y la próxima región en AragónServicios e infraestructura de AWS y la próxima región en Aragón
Servicios e infraestructura de AWS y la próxima región en Aragónjavier ramirez
 
Primeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverlessPrimeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverlessjavier ramirez
 
How AWS is reinventing the cloud
How AWS is reinventing the cloudHow AWS is reinventing the cloud
How AWS is reinventing the cloudjavier ramirez
 
Analitica de datos en tiempo real con Apache Flink y Apache BEAM
Analitica de datos en tiempo real con Apache Flink y Apache BEAMAnalitica de datos en tiempo real con Apache Flink y Apache BEAM
Analitica de datos en tiempo real con Apache Flink y Apache BEAMjavier ramirez
 
Getting started with streaming analytics
Getting started with streaming analyticsGetting started with streaming analytics
Getting started with streaming analyticsjavier ramirez
 
Getting started with streaming analytics: Setting up a pipeline
Getting started with streaming analytics: Setting up a pipelineGetting started with streaming analytics: Setting up a pipeline
Getting started with streaming analytics: Setting up a pipelinejavier ramirez
 
Getting started with streaming analytics: Deep Dive
Getting started with streaming analytics: Deep DiveGetting started with streaming analytics: Deep Dive
Getting started with streaming analytics: Deep Divejavier ramirez
 
Getting started with streaming analytics: streaming basics (1 of 3)
Getting started with streaming analytics: streaming basics (1 of 3)Getting started with streaming analytics: streaming basics (1 of 3)
Getting started with streaming analytics: streaming basics (1 of 3)javier ramirez
 
Monitorización de seguridad y detección de amenazas con AWS
Monitorización de seguridad y detección de amenazas con AWSMonitorización de seguridad y detección de amenazas con AWS
Monitorización de seguridad y detección de amenazas con AWSjavier ramirez
 

Mehr von javier ramirez (20)

¿Se puede vivir del open source? T3chfest
¿Se puede vivir del open source? T3chfest¿Se puede vivir del open source? T3chfest
¿Se puede vivir del open source? T3chfest
 
QuestDB: The building blocks of a fast open-source time-series database
QuestDB: The building blocks of a fast open-source time-series databaseQuestDB: The building blocks of a fast open-source time-series database
QuestDB: The building blocks of a fast open-source time-series database
 
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
 
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
 
Deduplicating and analysing time-series data with Apache Beam and QuestDB
Deduplicating and analysing time-series data with Apache Beam and QuestDBDeduplicating and analysing time-series data with Apache Beam and QuestDB
Deduplicating and analysing time-series data with Apache Beam and QuestDB
 
Your Database Cannot Do this (well)
Your Database Cannot Do this (well)Your Database Cannot Do this (well)
Your Database Cannot Do this (well)
 
Your Timestamps Deserve Better than a Generic Database
Your Timestamps Deserve Better than a Generic DatabaseYour Timestamps Deserve Better than a Generic Database
Your Timestamps Deserve Better than a Generic Database
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
 
QuestDB-Community-Call-20220728
QuestDB-Community-Call-20220728QuestDB-Community-Call-20220728
QuestDB-Community-Call-20220728
 
Processing and analysing streaming data with Python. Pycon Italy 2022
Processing and analysing streaming  data with Python. Pycon Italy 2022Processing and analysing streaming  data with Python. Pycon Italy 2022
Processing and analysing streaming data with Python. Pycon Italy 2022
 
QuestDB: ingesting a million time series per second on a single instance. Big...
QuestDB: ingesting a million time series per second on a single instance. Big...QuestDB: ingesting a million time series per second on a single instance. Big...
QuestDB: ingesting a million time series per second on a single instance. Big...
 
Servicios e infraestructura de AWS y la próxima región en Aragón
Servicios e infraestructura de AWS y la próxima región en AragónServicios e infraestructura de AWS y la próxima región en Aragón
Servicios e infraestructura de AWS y la próxima región en Aragón
 
Primeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverlessPrimeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverless
 
How AWS is reinventing the cloud
How AWS is reinventing the cloudHow AWS is reinventing the cloud
How AWS is reinventing the cloud
 
Analitica de datos en tiempo real con Apache Flink y Apache BEAM
Analitica de datos en tiempo real con Apache Flink y Apache BEAMAnalitica de datos en tiempo real con Apache Flink y Apache BEAM
Analitica de datos en tiempo real con Apache Flink y Apache BEAM
 
Getting started with streaming analytics
Getting started with streaming analyticsGetting started with streaming analytics
Getting started with streaming analytics
 
Getting started with streaming analytics: Setting up a pipeline
Getting started with streaming analytics: Setting up a pipelineGetting started with streaming analytics: Setting up a pipeline
Getting started with streaming analytics: Setting up a pipeline
 
Getting started with streaming analytics: Deep Dive
Getting started with streaming analytics: Deep DiveGetting started with streaming analytics: Deep Dive
Getting started with streaming analytics: Deep Dive
 
Getting started with streaming analytics: streaming basics (1 of 3)
Getting started with streaming analytics: streaming basics (1 of 3)Getting started with streaming analytics: streaming basics (1 of 3)
Getting started with streaming analytics: streaming basics (1 of 3)
 
Monitorización de seguridad y detección de amenazas con AWS
Monitorización de seguridad y detección de amenazas con AWSMonitorización de seguridad y detección de amenazas con AWS
Monitorización de seguridad y detección de amenazas con AWS
 

Kürzlich hochgeladen

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Kürzlich hochgeladen (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

Usable Rest APIs by Javier Ramirez at London Ruby User Group

  • 1. usable REST APIs {"links":[ {"rel":"author", "uri":"http://javier-ramirez.com"}, {"rel":"work", "uri":"http://aspgems.com"}, {"rel":"blog", "uri":"http://formatinternet.com"}, {"rel":"twittEr", "uri":"http//twitter.com/supercoco9"} ]}
  • 9. Web usability is an approach to make web sites easy to use for an end-user, without the requirement that any specialized training be undertaken.[
  • 11. I want YOU to make a (REST) API
  • 12. REST in a nutshell client server stateless layered and cacheable Resources Resource Identifiers Resource metadata Uniform interface operations Representations Representation metadata Optionally: code on demand
  • 13. making a REST API with Rails? easy
  • 14. BASIC WEB/api functionality IN RAILS
  • 17. SUCCESS consistently fail consistently
  • 18. expose ONLY WHAT IS Strictly necessary
  • 20. Aggregation/ composition Multiple representations
  • 22. All your FORMAT are belong to us
  • 23. > curl -d "login=ficticious_user@invoicefu.com&password=keepdreaming" https://invoicefu.com/api/session?format=json {"user":{"id":108,"name":"Nicolas Carroll","email":"ficticioususer@invoicefu.com","locale":"en","twitter_nickname ":null,"facebook_uid":null,"facebook_nickname":null,"api_key":"dbd349b30b6d9fde97b01b827e6be5ed1e4fbe72","links": [{"rel":"session","uri":"https://invoicefu.com/api/session","methods":"GET,POST,DESTROY"},"rel":"account","uri":" https://invoicefu.com/api/accounts/108-cole-mertz-fake","methods":"GET,PUT"},"rel":"clients","uri":"https://invoi cefu.com/api/accounts/108-cole-mertz-fake/clients","methods":"GET,POST"},{"rel":"new_client","uri":"https://invoi cefu.com/api/accounts/108-cole-mertz-fake/clients/new","methods":"GET"},{"rel":"invoices","uri":"https://invoicef u.com/api/accounts/108-cole-mertz-fake/invoices","methods":"GET,POST"},{"rel":"new_invoice","uri":"https://invoic efu.com/api/accounts/108-cole-mertz-fake/invoices/new","methods":"GET"},{"rel":"proformas","uri":"https://invoice fu.com/api/accounts/108-cole-mertz-fake/proformas","methods":"GET,POST"},{"rel":"new_proforma","uri":"https://inv oicefu.com/api/accounts/108-cole-mertz-fake/proformas/new","methods":"GET"}]}}
  • 24. can I haz cat readable anzwa > curl -d "login=ficticioususer@invoicefu.com&password=yeahyeah" "https://invoicefu.com/api/session?&format=xml <?xml version="1.0" encoding="UTF-8"?> <user> <id>108</id> <name>Nicolas Carroll</name> <email>user000007@invoicefu.com</email> <locale>en</locale> <twitter-nickname nil="true"></twitter-nickname> <facebook-uid nil="true"></facebook-uid> <facebook-nickname nil="true"></facebook-nickname> <api-key>dbd349b30b6d9fde97b01b827e6be5ed1e4fbe72</api-key> <links> <link> <rel>session</rel> <uri>https://invoicefu-localhost.com/api/session</uri> <methods>GET,POST,DESTROY</methods> </link> <link> <rel>account</rel> <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake</uri> <methods>GET,PUT</methods> </link> <link> <rel>clients</rel> <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/clients</uri> <methods>GET,POST</methods> </link> <link> <rel>new_client</rel> <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/clients/new</uri> <methods>GET</methods> </link> (…) </links> </user>
  • 25. Accept: application/vnd.aspgems.invoicefu.v1.xml THE ACCEPT HEADER HTTP/REST Standard Not everyone Less obvious Unambiguous supports headers Harder to use Resources != or custom types Non standard content- Representations types Version as you need it Skips HTTP server logs
  • 26.
  • 27.
  • 28. templates for new resources > curl "https://invoicefu.com/api/v1/accounts/108-cole-mertz-fake/invoices/new? api_key=ddd349b30b6d9fde97b01b827e6be5ed1e4fbe72&format=json" {"invoice":{"number":"2011/30","issued_on":"2011-12- 12","proforma_id":null,"notes":null,"footer":null,"locale":"en","currency_code":"USD","currency_sym bol":"$","ac_name":"Cole-Mertz#FAKE","ac_company_number_name":"Company number","ac_company_number":"25465828K","ac_tax_number_name":"VAT Number","ac_tax_number":"ES25464828k","ac_address":"234 brecknock road","ac_city":"london","ac_province":null,"ac_postal_code":"n18 5bq","ac_country_name":"United Kingdom","cl_email":null,"cl_name":null,"cl_company_number_name":null,"cl_company_number":null,"cl_ tax_number_name":null,"cl_tax_number":null,"cl_address":null,"cl_city":null,"cl_province":null,"cl_ postal_code":null,"cl_country_name":null,"invoice_lines":[],"discount_percent":null,"tax_lines": [{"name":"TVA","signed_percent":"19.6"}],"paid":"0.0","links": [{"rel":"payments","uri":"https://invoicefu.com/api/accounts/108-cole-mertz- fake/invoices//payments","methods":"POST"}, {"rel":"account","uri":"https://invoicefu.com/api/accounts/108-cole-mertz- fake","methods":"GET,PUT"},{"rel":"client","uri":null,"methods":"GET,PUT,DELETE"}, {"rel":"proforma","uri":null,"methods":"GET,PUT,DELETE"},{"rel":"pdf","uri":null,"methods":"GET"}, {"rel":"invoices","uri":"https://invoicefu.com/api/accounts/108-cole-mertz- fake/invoices","methods":"GET,POST"}]}}j
  • 29. EASy To FIND
  • 30. > curl https://invoicefu.com?format=xml (or curl -H "Accept: application/xml" "https://invoicefu.com") <?xml version="1.0" encoding="UTF-8"?> <invoicefu> <links> <link> <rel>session</rel> <uri>https://invoicefu.com/api/session</uri> <methods>POST.DELETE</methods> </link> <link> <rel>countries</rel> <uri>https://invoicefu.com/api/countries</uri> <methods>GET</methods> </link> <link> <rel>api_v1</rel> <uri>https://invoicefu.com/api/session?api_version=1</uri> <methods>POST.DELETE</methods> </link> <link> <rel>xml_representation</rel> <uri>https://invoicefu.com/api/session?format=xml</uri> <methods>POST.DELETE</methods> </link> <link> <rel>json_representation</rel> <uri>https://invoicefu.com/api/session?format=json</uri> <methods>POST.DELETE</methods> </link> <link> <rel>strict_parameters</rel> <uri>https://invoicefu.com/api/session?strict=true</uri> <methods>POST.DELETE</methods> </link> </links>
  • 31. > curl -d "login=ficticioususer@invoicefu.com&password=yeahyeah" "https://invoicefu.com/api/session?&format=xml <?xml version="1.0" encoding="UTF-8"?> <user> <id>108</id> <name>Nicolas Carroll</name> <email>user000007@invoicefu.com</email> <locale>en</locale> <twitter-nickname nil="true"></twitter-nickname> <facebook-uid nil="true"></facebook-uid> <facebook-nickname nil="true"></facebook-nickname> <api-key>dbd349b30b6d9fde97b01b827e6be5ed1e4fbe72</api-key> <links> <link> <rel>session</rel> <uri>https://invoicefu-localhost.com/api/session</uri> <methods>GET,POST,DESTROY</methods> </link> <link> <rel>account</rel> <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake</uri> <methods>GET,PUT</methods> </link> <link> <rel>clients</rel> <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/clients</uri> <methods>GET,POST</methods> </link> <link> <rel>new_client</rel> <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/clients/new</uri> <methods>GET</methods> </link> <link> <rel>invoices</rel> <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/invoices</uri> <methods>GET,POST</methods> </link> (…) </links> </user>
  • 32. BASIC ACCESS AUTHENTICATION authenticate_or_request_with_http_basic do |login, password| User.find_by_login_and_password login, password end User and password must be passed every time TOKEN Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join ) User.find_by_login_and_api_key( params[:login], params[:api_key] ) Client can send it as a parameter or as a header OAUTH Depends on third party libraries Requires initial registration of client and more integration
  • 35. > curl "https://invoicefu.com/api/accounts/108-cole-mertz-fake/invoices/new? api_key=ddd349b30b6d9fde97b01b827e6be5ed1e4fbe72&format=xml&debug=1" <?xml version="1.0" encoding="UTF-8"?> <errors> <error>extra params found: debug. Allowed params are: account_id,client_id,invoice_id,proforma_id</error> </errors> > curl "https://invoicefu.com/api/accounts/108-cole-mertz-fake/invoices/new? api_key=ddd349b30b6d9fde97b01b827e6be5ed1e4fbe72&format=xml&debug=1&strict=false" <?xml version="1.0" encoding="UTF-8"?> <invoice> <number>2011/30</number> <issued-on>2011-12-11</issued-on> <proforma-id nil="true"></proforma-id> (...) <links> (...) <link> <rel>invoices</rel> <uri>https://invoicefu-localhost.com/api/accounts/108-cole-mertz-fake/invoices</uri> <methods>GET,POST</methods> </link> </links> </invoice>
  • 36.
  • 37. helping your users WADL json schema
  • 38. { <?xml version="1.0"?> "name":"Product", <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" "properties":{ xsi:schemaLocation="http://wadl.dev.java.net/2009/02 wadl.xsd" "id":{ xmlns:tns="urn:yahoo:yn" "type":"number", xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:yn="urn:yahoo:yn" "description":"Product identifier", xmlns:ya="urn:yahoo:api" "required":true xmlns="http://wadl.dev.java.net/2009/02"> }, <grammars> "name":{ <include "description":"Name of the href="NewsSearchResponse.xsd"/> product", <include "type":"string", href="Error.xsd"/> "required":true </grammars> }, "price":{ <resources base="http://api.search.yahoo.com/NewsSearchService/V1/"> <resource path="newsSearch"> "required":true, <method name="GET" id="search"> "type": "number", <request> "minimum":0, <param name="appid" type="xsd:string" "required":true style="query" required="true"/> 22 }, <param name="type" style="query" default="all"> "tags":{ <option value="all"/> "type":"array", <option value="any"/> "items":{ <option value="phrase"/> "type":"string" </param> } <param name="start" style="query" type="xsd:int" default="1"/> <param name="language" style="query" type="xsd:string"/> } </request> }, <response status="200"> "links":[ <representation mediaType="application/xml" { element="yn:ResultSet"/> "rel":"full", </response> "href":"{id}" <response status="400"> }, <representation mediaType="application/xml" { element="ya:Error"/> "rel":"comments", </response> "href":"comments/?id={id}" </method> </resource> } </resources> ] } </application>