SlideShare une entreprise Scribd logo
1  sur  42
Télécharger pour lire hors ligne
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

Contenu connexe

En vedette

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
 

En vedette (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
 

Plus de 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
 

Plus de 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
 

Dernier

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Dernier (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

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>