Inviqa, Session Digital, Sensio Labs UK
Twitter: | blongden |
GitHub: | blongden |
Email: | [email protected] |
http://.../[email protected]& passwd_hash=2ab548fae3162ccfa1a2d41a55557a92& user_name=CrunchAll
<user>
<emailaddr>[email protected]</emailaddr>
<username>CrunchAll</username>
</user>
Users can create messages that are visible to other users who follow them.
GET /users/blongden/messages HTTP/1.1
Host: example.com
POST /users/blongden/messages HTTP/1.1
Host: example.com
PUT /users/blongden/messages/1 HTTP/1.1
Host: example.com
DELETE /users/blongden/messages/1 HTTP/1.1
Host: example.com
Hypermedia is used as a logical extension of the term hypertext in which graphics, audio, video, plain text and hyperlinks intertwine to create a generally non-linear medium of information.
<img src='http://example.com/logo' />
<a href='http://example.com/search' title='view search page'>
Search
</a>
<form method='get'>...</form>
<form method='post'>...</form>
"_links": {
"next": { "href": "/orders?page=2" },
"self": { "href": "/orders" }
},
"_embedded": { "order": [
"_links": {
"customer": {
"href": "/customer/bob",
"title": "Bob Jones <[email protected]>"
},
"self": { "href": "/orders/123" }
},
"currency": "USD", "total": 30
]}
<?xml version="1.0"?>
<resource href="/orders">
<link rel="next" href="/orders?page=2"/>
<link rel="search" href="/orders?id={order_id}"/>
<resource rel="order" href="/orders/123">
<link rel="customer" href="/customer/bob" title="Bob Jones <[email protected]>"/>
<total>30</total>
<currency>USD</currency>
</resource>
</resource>
<?php
$hal = new \Nocarrier\Hal('/orders');
$hal->addLink('next', '/orders?page=2');
$hal->addLink('search', '/orders?id={order_id}');
$resource = new \Nocarrier\Hal(
'/orders/123',
array(
'total' => 30.00,
'currency' => 'GBP',
)
);
$resource->addLink('customer', '/customer/bob', 'Bob Jones <[email protected]>');
$hal->addResource('order', $resource);
echo $hal->asXml();
echo $hal->asJson();
http://.../rels/message
{
"name": "Ben",
"phone": "07777000000"
}
{
"name": "Ben",
"phone": [ "07777000000", "07777000001" ]
}
<?xml version="1.0"?>
<contact>
<name>Ben</name>
<phone>07777000000</phone>
</contact>
<?xml version="1.0"?>
<contact>
<name>Ben</name>
<phone>07777000000</phone>
<phone>07777000001</phone>
</contact>
http://.../users/blongden?zoom=messages
{
"_links": {
"self": { href: "http://.../users/blongden" },
"messages": { href: "http://.../users/blongden/messages" }
}
"_embedded": {
"messages": { ... }
}
}