Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
71  source/25_push_notifiations.xml
... ...
@@ -0,0 +1,71 @@
  1
+<document>
  2
+  <title>Push Notifications</title>
  3
+  <position>24</position>
  4
+  <section>
  5
+    <docs>
  6
+      <![CDATA[
  7
+      The server sends push notifications so clients can update in realtime. 
  8
+      There are two different channels. One for realtime updates to records
  9
+      and one for the feed. You may only subscribe to channels for a specific user.
  10
+      There are no global channels. The server only sends push notifications for records
  11
+      the user can access. This follows the principle that the API only shows you 
  12
+      what a user has access to.
  13
+
  14
+      The general format for a channel is like this: `/name/user-api-key`. 
  15
+      Replace "user-api-key" with a user.
  16
+
  17
+      The client is only allowed to receive message.
  18
+      ]]>
  19
+    </docs>
  20
+  </section>
  21
+  <section title="Update Channel">
  22
+    <docs>
  23
+      <![CDATA[
  24
+      ### Channel: /updates/user-api-key
  25
+
  26
+      The update channel pushes out all create, update and delete actions. 
  27
+      Each message contains the action and the record itself. The enire record
  28
+      is sent in each message. For example, the complete record is sent on update
  29
+      and **not** just the changes. This is so the client can pull in a complete record
  30
+      if they don't have it in memory already.
  31
+
  32
+      <dl>
  33
+        <dt>action</dt>
  34
+        <dd>Either: <code>create</code>, <code>update</code>, or <code>delete</code></dd>
  35
+
  36
+        <dt>resource</dt>
  37
+        <dd>The name of the resource type. Example: <code>user</code></dd>
  38
+
  39
+        <dt>data</dt>
  40
+        <dd>The raw data</dd>
  41
+      </dl>
  42
+
  43
+      When a record is deleted, only the ID is given in `data`.
  44
+      ]]>
  45
+    </docs>
  46
+    <reference>
  47
+      <![CDATA[
  48
+      ### Channel: /updates/user-api-key
  49
+
  50
+      ```javascript
  51
+      {
  52
+        "action": "update",
  53
+        "resource": todo",
  54
+        "data": { ... }
  55
+      }
  56
+      ```
  57
+      ]]>
  58
+    </reference>
  59
+  </section>
  60
+  <section title="Feed Channel">
  61
+    <docs>
  62
+      <![CDATA[
  63
+      ### Channel: /feed/user-api-key
  64
+
  65
+      The feed channel receives everything that comes into the user's feed.
  66
+      New entries are sent when they are added or changed. Each message is in the
  67
+      `Activity` format.
  68
+      ]]>
  69
+    </docs>
  70
+  </section>
  71
+</document>
168  source/99_examples.xml
@@ -17,8 +17,8 @@
17 17
 // Announcement
18 18
 {
19 19
   "id": 1,
20  
-  "created_at": "2012-04-15T13:29:00Z",
21  
-  "updated_at": "2012-04-15T13:29:00Z",
  20
+  "created_at": "2012-04-15T21:58:31Z",
  21
+  "updated_at": "2012-04-15T21:58:31Z",
22 22
   "title": "Announcement 1",
23 23
   "message": "Long form text",
24 24
   "user": 9,
@@ -31,10 +31,10 @@
31 31
 // CallList
32 32
 {
33 33
   "id": 1,
34  
-  "created_at": "2012-04-15T13:29:01Z",
35  
-  "updated_at": "2012-04-15T13:29:01Z",
  34
+  "created_at": "2012-04-15T21:58:32Z",
  35
+  "updated_at": "2012-04-15T21:58:32Z",
36 36
   "description": "Call List 1",
37  
-  "finish_by": "2012-04-22T13:28:58Z",
  37
+  "finish_by": "2012-04-22T21:58:29Z",
38 38
   "todos": [
39 39
 
40 40
   ],
@@ -59,11 +59,11 @@
59 59
 // Campaign
60 60
 {
61 61
   "id": 2,
62  
-  "created_at": "2012-04-15T13:29:01Z",
63  
-  "updated_at": "2012-04-15T13:29:01Z",
  62
+  "created_at": "2012-04-15T21:58:32Z",
  63
+  "updated_at": "2012-04-15T21:58:32Z",
64 64
   "name": "Campaign 2",
65 65
   "description": "Long form text",
66  
-  "ends_at": "2012-04-22T13:28:58Z",
  66
+  "ends_at": "2012-04-22T21:58:29Z",
67 67
   "currency": "USD",
68 68
   "target": "10000.0",
69 69
   "public": true,
@@ -116,8 +116,8 @@
116 116
 // Comment
117 117
 {
118 118
   "id": 1,
119  
-  "created_at": "2012-04-15T13:29:01Z",
120  
-  "updated_at": "2012-04-15T13:29:01Z",
  119
+  "created_at": "2012-04-15T21:58:33Z",
  120
+  "updated_at": "2012-04-15T21:58:33Z",
121 121
   "text": "Text 1",
122 122
   "user": 14
123 123
 }
@@ -126,11 +126,11 @@
126 126
 // Contact
127 127
 {
128 128
   "id": 2,
129  
-  "created_at": "2012-04-15T13:29:02Z",
130  
-  "updated_at": "2012-04-15T13:29:02Z",
  129
+  "created_at": "2012-04-15T21:58:33Z",
  130
+  "updated_at": "2012-04-15T21:58:33Z",
131 131
   "name": "Contact 1",
132 132
   "contacted_at": null,
133  
-  "became_lead_at": "2012-04-15T13:29:02Z",
  133
+  "became_lead_at": "2012-04-15T21:58:33Z",
134 134
   "became_prospect_at": null,
135 135
   "became_opportunity_at": null,
136 136
   "became_customer_at": null,
@@ -176,8 +176,8 @@
176 176
   "addresses": [
177 177
     {
178 178
       "id": 1,
179  
-      "created_at": "2012-04-15T13:29:02Z",
180  
-      "updated_at": "2012-04-15T13:29:02Z",
  179
+      "created_at": "2012-04-15T21:58:33Z",
  180
+      "updated_at": "2012-04-15T21:58:33Z",
181 181
       "name": "Address 1",
182 182
       "street": "826 Hazel",
183 183
       "state": "CA",
@@ -189,8 +189,8 @@
189 189
   "phone_numbers": [
190 190
     {
191 191
       "id": 3,
192  
-      "created_at": "2012-04-15T13:29:02Z",
193  
-      "updated_at": "2012-04-15T13:29:02Z",
  192
+      "created_at": "2012-04-15T21:58:33Z",
  193
+      "updated_at": "2012-04-15T21:58:33Z",
194 194
       "name": "Phone Number",
195 195
       "value": "+52313872481",
196 196
       "accepted_values": null,
@@ -200,8 +200,8 @@
200 200
   "email_addresses": [
201 201
     {
202 202
       "id": 2,
203  
-      "created_at": "2012-04-15T13:29:02Z",
204  
-      "updated_at": "2012-04-15T13:29:02Z",
  203
+      "created_at": "2012-04-15T21:58:33Z",
  204
+      "updated_at": "2012-04-15T21:58:33Z",
205 205
       "name": "Email",
206 206
       "value": "email-1@example.com",
207 207
       "accepted_values": null,
@@ -221,10 +221,10 @@
221 221
 // Deal
222 222
 {
223 223
   "id": 1,
224  
-  "created_at": "2012-04-15T13:29:02Z",
225  
-  "updated_at": "2012-04-15T13:29:02Z",
  224
+  "created_at": "2012-04-15T21:58:34Z",
  225
+  "updated_at": "2012-04-15T21:58:34Z",
226 226
   "description": "This deal rocks!",
227  
-  "close_by": "2012-04-22T13:29:02Z",
  227
+  "close_by": "2012-04-22T21:58:33Z",
228 228
   "state": "pending",
229 229
   "public": true,
230 230
   "contact": 3,
@@ -246,8 +246,8 @@
246 246
   "line_items": [
247 247
     {
248 248
       "id": 1,
249  
-      "created_at": "2012-04-15T13:29:02Z",
250  
-      "updated_at": "2012-04-15T13:29:02Z",
  249
+      "created_at": "2012-04-15T21:58:34Z",
  250
+      "updated_at": "2012-04-15T21:58:34Z",
251 251
       "name": "Radium",
252 252
       "quantity": 1,
253 253
       "price": "1000.0",
@@ -256,8 +256,8 @@
256 256
     },
257 257
     {
258 258
       "id": 2,
259  
-      "created_at": "2012-04-15T13:29:02Z",
260  
-      "updated_at": "2012-04-15T13:29:02Z",
  259
+      "created_at": "2012-04-15T21:58:34Z",
  260
+      "updated_at": "2012-04-15T21:58:34Z",
261 261
       "name": "Radium",
262 262
       "quantity": 1,
263 263
       "price": "1000.0",
@@ -266,8 +266,8 @@
266 266
     },
267 267
     {
268 268
       "id": 3,
269  
-      "created_at": "2012-04-15T13:29:02Z",
270  
-      "updated_at": "2012-04-15T13:29:02Z",
  269
+      "created_at": "2012-04-15T21:58:34Z",
  270
+      "updated_at": "2012-04-15T21:58:34Z",
271 271
       "name": "Radium",
272 272
       "quantity": 1,
273 273
       "price": "1000.0",
@@ -284,11 +284,11 @@
284 284
 // Email
285 285
 {
286 286
   "id": 2,
287  
-  "created_at": "2012-04-15T13:29:03Z",
288  
-  "updated_at": "2012-04-15T13:29:03Z",
  287
+  "created_at": "2012-04-15T21:58:34Z",
  288
+  "updated_at": "2012-04-15T21:58:34Z",
289 289
   "subject": "Hey",
290 290
   "message": "Long form text",
291  
-  "sent_at": "2012-04-15T13:29:03Z",
  291
+  "sent_at": "2012-04-15T21:58:34Z",
292 292
   "user": 22,
293 293
   "users": [
294 294
     22
@@ -311,8 +311,8 @@
311 311
 // Following
312 312
 {
313 313
   "id": 1,
314  
-  "created_at": "2012-04-15T13:29:04Z",
315  
-  "updated_at": "2012-04-15T13:29:04Z",
  314
+  "created_at": "2012-04-15T21:58:35Z",
  315
+  "updated_at": "2012-04-15T21:58:35Z",
316 316
   "approved": true,
317 317
   "user": 27,
318 318
   "contact": 4
@@ -322,8 +322,8 @@
322 322
 // Group
323 323
 {
324 324
   "id": 7,
325  
-  "created_at": "2012-04-15T13:29:04Z",
326  
-  "updated_at": "2012-04-15T13:29:04Z",
  325
+  "created_at": "2012-04-15T21:58:35Z",
  326
+  "updated_at": "2012-04-15T21:58:35Z",
327 327
   "name": "Group 7",
328 328
   "email": null,
329 329
   "phone": null,
@@ -374,10 +374,10 @@
374 374
 // Im
375 375
 {
376 376
   "id": 3,
377  
-  "created_at": "2012-04-15T13:29:04Z",
378  
-  "updated_at": "2012-04-15T13:29:04Z",
  377
+  "created_at": "2012-04-15T21:58:35Z",
  378
+  "updated_at": "2012-04-15T21:58:35Z",
379 379
   "message": "Hey man",
380  
-  "sent_at": "2012-04-15T13:29:04Z",
  380
+  "sent_at": "2012-04-15T21:58:35Z",
381 381
   "sender": 30,
382 382
   "users": [
383 383
     29,
@@ -398,10 +398,10 @@
398 398
 // Invitation
399 399
 {
400 400
   "id": 2,
401  
-  "created_at": "2012-04-15T13:29:04Z",
402  
-  "updated_at": "2012-04-15T13:29:04Z",
  401
+  "created_at": "2012-04-15T21:58:35Z",
  402
+  "updated_at": "2012-04-15T21:58:35Z",
403 403
   "state": "pending",
404  
-  "hash_key": "856a6dda9cfa683f93c008a8e9b911938cd5252c",
  404
+  "hash_key": "5fc5f7d45729fad8f10e17e1bf6bc00530b167cb",
405 405
   "meeting": 1,
406 406
   "user": 32
407 407
 }
@@ -410,12 +410,12 @@
410 410
 // Meeting
411 411
 {
412 412
   "id": 2,
413  
-  "created_at": "2012-04-15T13:29:04Z",
414  
-  "updated_at": "2012-04-15T13:29:04Z",
  413
+  "created_at": "2012-04-15T21:58:35Z",
  414
+  "updated_at": "2012-04-15T21:58:35Z",
415 415
   "topic": "Meeting 2",
416 416
   "location": "The office",
417  
-  "starts_at": "2012-04-15T14:28:58Z",
418  
-  "ends_at": "2012-04-15T15:28:58Z",
  417
+  "starts_at": "2012-04-15T22:58:29Z",
  418
+  "ends_at": "2012-04-15T23:58:29Z",
419 419
   "contacts": [
420 420
 
421 421
   ],
@@ -428,10 +428,10 @@
428 428
   "invitations": [
429 429
     {
430 430
       "id": 3,
431  
-      "created_at": "2012-04-15T13:29:04Z",
432  
-      "updated_at": "2012-04-15T13:29:04Z",
  431
+      "created_at": "2012-04-15T21:58:35Z",
  432
+      "updated_at": "2012-04-15T21:58:35Z",
433 433
       "state": "confirmed",
434  
-      "hash_key": "0f1afc27fbfd69f7a320bebea4e496a9deedcb25",
  434
+      "hash_key": "86c3e3fc1a842626cde1168e273e1c511d3e7798",
435 435
       "meeting": 2,
436 436
       "user": 33
437 437
     }
@@ -442,8 +442,8 @@
442 442
 // Note
443 443
 {
444 444
   "id": 1,
445  
-  "created_at": "2012-04-15T13:29:05Z",
446  
-  "updated_at": "2012-04-15T13:29:05Z",
  445
+  "created_at": "2012-04-15T21:58:36Z",
  446
+  "updated_at": "2012-04-15T21:58:36Z",
447 447
   "message": "Long form text"
448 448
 }
449 449
 
@@ -451,12 +451,12 @@
451 451
 // PhoneCall
452 452
 {
453 453
   "id": 1,
454  
-  "created_at": "2012-04-15T13:29:05Z",
455  
-  "updated_at": "2012-04-15T13:29:05Z",
  454
+  "created_at": "2012-04-15T21:58:37Z",
  455
+  "updated_at": "2012-04-15T21:58:37Z",
456 456
   "outcome": null,
457 457
   "duration": 600,
458 458
   "kind": "accepted",
459  
-  "dialed_at": "2012-04-08T13:28:58Z",
  459
+  "dialed_at": "2012-04-08T21:58:29Z",
460 460
   "contacts": [
461 461
     6
462 462
   ],
@@ -475,8 +475,8 @@
475 475
 // Product
476 476
 {
477 477
   "id": 1,
478  
-  "created_at": "2012-04-15T13:29:06Z",
479  
-  "updated_at": "2012-04-15T13:29:06Z",
  478
+  "created_at": "2012-04-15T21:58:38Z",
  479
+  "updated_at": "2012-04-15T21:58:38Z",
480 480
   "name": "Radium",
481 481
   "description": null,
482 482
   "currency": "USD",
@@ -490,9 +490,9 @@
490 490
 // Reminder
491 491
 {
492 492
   "id": 1,
493  
-  "created_at": "2012-04-15T13:29:06Z",
494  
-  "updated_at": "2012-04-15T13:29:06Z",
495  
-  "time": "2012-04-22T13:28:58Z",
  493
+  "created_at": "2012-04-15T21:58:38Z",
  494
+  "updated_at": "2012-04-15T21:58:38Z",
  495
+  "time": "2012-04-22T21:58:29Z",
496 496
   "via": "sms",
497 497
   "todo": 1,
498 498
   "user": 43
@@ -502,10 +502,10 @@
502 502
 // Sms
503 503
 {
504 504
   "id": 4,
505  
-  "created_at": "2012-04-15T13:29:06Z",
506  
-  "updated_at": "2012-04-15T13:29:06Z",
  505
+  "created_at": "2012-04-15T21:58:38Z",
  506
+  "updated_at": "2012-04-15T21:58:38Z",
507 507
   "message": "Less than 255 characters",
508  
-  "sent_at": "2012-04-15T13:29:06Z",
  508
+  "sent_at": "2012-04-15T21:58:38Z",
509 509
   "user": 45,
510 510
   "users": [
511 511
     45
@@ -528,11 +528,11 @@
528 528
 // Todo
529 529
 {
530 530
   "id": 2,
531  
-  "created_at": "2012-04-15T13:29:07Z",
532  
-  "updated_at": "2012-04-15T13:29:07Z",
  531
+  "created_at": "2012-04-15T21:58:39Z",
  532
+  "updated_at": "2012-04-15T21:58:39Z",
533 533
   "kind": "general",
534 534
   "description": "Finish programming radium",
535  
-  "finish_by": "2012-04-22T13:28:58Z",
  535
+  "finish_by": "2012-04-22T21:58:29Z",
536 536
   "finished": false,
537 537
   "contacts": [
538 538
 
@@ -546,9 +546,9 @@
546 546
   ],
547 547
   "user": {
548 548
     "id": 47,
549  
-    "created_at": "2012-04-15T13:29:07Z",
550  
-    "updated_at": "2012-04-15T13:29:07Z",
551  
-    "name": "Lillian Mcdonald",
  549
+    "created_at": "2012-04-15T21:58:39Z",
  550
+    "updated_at": "2012-04-15T21:58:39Z",
  551
+    "name": "Sara Carpenter",
552 552
     "email": "user-39@example.com",
553 553
     "phone": "38539383924839",
554 554
     "public": true,
@@ -609,9 +609,9 @@
609 609
 // User
610 610
 {
611 611
   "id": 48,
612  
-  "created_at": "2012-04-15T13:29:07Z",
613  
-  "updated_at": "2012-04-15T13:29:07Z",
614  
-  "name": "Matthew Sanders",
  612
+  "created_at": "2012-04-15T21:58:39Z",
  613
+  "updated_at": "2012-04-15T21:58:39Z",
  614
+  "name": "Harold Mason",
615 615
   "email": "user-40@example.com",
616 616
   "phone": "38540384024840",
617 617
   "public": true,
@@ -670,8 +670,8 @@
670 670
 // Account
671 671
 {
672 672
   "id": 3,
673  
-  "created_at": "2012-04-15T13:29:07Z",
674  
-  "updated_at": "2012-04-15T13:29:07Z",
  673
+  "created_at": "2012-04-15T21:58:39Z",
  674
+  "updated_at": "2012-04-15T21:58:39Z",
675 675
   "name": "Account 1",
676 676
   "is_public": true,
677 677
   "users": [
@@ -695,17 +695,17 @@
695 695
 // Activity
696 696
 {
697 697
   "id": 49,
698  
-  "created_at": "2012-04-15T13:29:07Z",
699  
-  "updated_at": "2012-04-15T13:29:07Z",
  698
+  "created_at": "2012-04-15T21:58:39Z",
  699
+  "updated_at": "2012-04-15T21:58:39Z",
700 700
   "kind": "todo",
701 701
   "tag": "created",
702  
-  "timestamp": "2012-04-15T13:29:07Z",
  702
+  "timestamp": "2012-04-15T21:58:39Z",
703 703
   "owner": {
704 704
     "user": {
705 705
       "id": 50,
706  
-      "created_at": "2012-04-15T13:29:07Z",
707  
-      "updated_at": "2012-04-15T13:29:07Z",
708  
-      "name": "Steve Austin",
  706
+      "created_at": "2012-04-15T21:58:39Z",
  707
+      "updated_at": "2012-04-15T21:58:39Z",
  708
+      "name": "Robert Austin",
709 709
       "email": "user-42@example.com",
710 710
       "phone": "38542384224842",
711 711
       "public": true,
@@ -763,11 +763,11 @@
763 763
   "reference": {
764 764
     "todo": {
765 765
       "id": 3,
766  
-      "created_at": "2012-04-15T13:29:07Z",
767  
-      "updated_at": "2012-04-15T13:29:07Z",
  766
+      "created_at": "2012-04-15T21:58:39Z",
  767
+      "updated_at": "2012-04-15T21:58:39Z",
768 768
       "kind": "general",
769 769
       "description": "Finish programming radium",
770  
-      "finish_by": "2012-04-22T13:28:58Z",
  770
+      "finish_by": "2012-04-22T21:58:29Z",
771 771
       "finished": false,
772 772
       "contacts": [
773 773
 
@@ -781,9 +781,9 @@
781 781
       ],
782 782
       "user": {
783 783
         "id": 49,
784  
-        "created_at": "2012-04-15T13:29:07Z",
785  
-        "updated_at": "2012-04-15T13:29:07Z",
786  
-        "name": "Clarence Austin",
  784
+        "created_at": "2012-04-15T21:58:39Z",
  785
+        "updated_at": "2012-04-15T21:58:39Z",
  786
+        "name": "Jason Stone",
787 787
         "email": "user-41@example.com",
788 788
         "phone": "38541384124841",
789 789
         "public": true,

No commit comments for this range

Something went wrong with that request. Please try again.