WebAPI/SimplePush: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 190: Line 190:
  {"channels":[{"channelID":"1ced595d7f6c9f60cc5c9395dc6b72aa7e1a69a7","version":"42"},{"channelID":"bf08e25861c900c3ab343670eee1873d0b724eef","version":"1"}]}
  {"channels":[{"channelID":"1ced595d7f6c9f60cc5c9395dc6b72aa7e1a69a7","version":"42"},{"channelID":"bf08e25861c900c3ab343670eee1873d0b724eef","version":"1"}]}


==== POST /update ====
<h4> POST /update </h4>
 
<p>Refresh the server from the client.
Refresh the server from the client.
</p><p>This request requires a X-UserAgent-ID header. If the UserAgent attempts to POST information to the server which already has data for that X-UserAgent-ID, the server will deny the request with a 403 error. In that case, the UserAgent should request re-registration for all Channels.  
 
</p>
This request requires a X-UserAgent-ID header. If the UserAgent attempts to POST information to the server which already has data for that X-UserAgent-ID, the server will deny the request with a 403 error. In that case, the UserAgent should request re-registration for all Channels.  
<ol><li> Server state <b>MUST</b> be considered the canonical state, <i>unless</i> the server has NO state.
 
</li><li> On an /update call, the server <b>MUST</b> <i>atomically</i> update its state.
===== Arguments =====
</li></ol>
The POST body is a JSON encoded block which matches the form and structure of the GET /update/ request.
<h5> Arguments </h5>
 
<p>The POST body is a JSON encoded block which matches the form and structure of the GET /update/ request.
===== Returns =====
</p>
This will return an empty object.
<h5> Returns </h5>
 
<p>This will return an empty object.
===== Example =====
</p>
 
<h5> Example </h5>
POST http://push.m.o/update
<pre class="_fck_mw_lspace">POST http://push.m.o/update
{"channels":[{"channelID":"1ced595d7f6c9f60cc5c9395dc6b72aa7e1a69a7","version":"42"},{"channelID":"bf08e25861c900c3ab343670eee1873d0b724eef","version":"1"}]}
{&quot;channels&quot;:[{&quot;channelID&quot;:&quot;1ced595d7f6c9f60cc5c9395dc6b72aa7e1a69a7&quot;,&quot;version&quot;:&quot;42&quot;},{&quot;channelID&quot;:&quot;bf08e25861c900c3ab343670eee1873d0b724eef&quot;,&quot;version&quot;:&quot;1&quot;}]}
 
</pre>
---
<pre class="_fck_mw_lspace">---
{}
{}
</pre>


==== PUT /update/<ChannelID> ====
==== PUT /update/<ChannelID> ====
Confirmed users
93

edits

Navigation menu