diff --git a/templates/zerver/api/fixtures.json b/templates/zerver/api/fixtures.json index 3e61bb12f2..1f9f418910 100644 --- a/templates/zerver/api/fixtures.json +++ b/templates/zerver/api/fixtures.json @@ -317,5 +317,66 @@ "msg":"", "result":"success", "uri":"\/user_uploads\/1\/4e\/m2A3MSqFnWRLUf9SaPzQ0Up_\/zulip.txt" + }, + "get-events-from-queue": { + "events":[ + { + "id":0, + "message":{ + "avatar_url":"https:\/\/url\/for\/othello-bots\/avatar", + "client":"website", + "content":"Something is rotten in the state of Denmark.", + "content_type":"text\/x-markdown", + "display_recipient":"Denmark", + "id":12345678, + "recipient_id":12314, + "sender_email":"othello-bot@example.com", + "sender_full_name":"Othello Bot", + "sender_id":13215, + "sender_realm_str":"example", + "sender_short_name":"othello-bot", + "subject":"Castle", + "subject_links":[ + + ], + "timestamp":1375978403, + "type":"stream" + }, + "type":"message" + }, + { + "id":1, + "message":{ + "avatar_url":"https:\/\/url\/for\/othello-bots\/avatar", + "client":"website", + "content":"I come not, friends, to steal away your hearts.", + "content_type":"text\/x-markdown", + "display_recipient":[ + { + "email":"hamlet@example.com", + "full_name":"Hamlet of Denmark", + "id":31572, + "short_name":"hamlet" + } + ], + "id":12345679, + "recipient_id":18391, + "sender_email":"othello-bot@example.com", + "sender_full_name":"Othello Bot", + "sender_id":13215, + "sender_realm_str":"example", + "sender_short_name":"othello-bot", + "subject":"", + "subject_links":[ + + ], + "timestamp":1375978404, + "type":"private" + }, + "type":"message" + } + ], + "msg":"", + "result":"success" } } diff --git a/templates/zerver/api/get-events-from-queue.md b/templates/zerver/api/get-events-from-queue.md index be999ee330..37e53c3f9b 100644 --- a/templates/zerver/api/get-events-from-queue.md +++ b/templates/zerver/api/get-events-from-queue.md @@ -119,68 +119,4 @@ You may also pass in the following keyword arguments to `call_on_each_event`: A typical successful JSON response may look like: -``` -{ - 'result':'success', - 'msg':'', - 'events':[ - { - 'type':'message', - 'id':0, - 'message':{ - 'content_type':'text/x-markdown', - 'avatar_url':'https://url/for/othello-bots/avatar', - 'timestamp':1375978403, - 'display_recipient':'Denmark', - 'sender_id':13215, - 'sender_full_name':'Othello Bot', - 'sender_email':'othello-bot@example.com', - 'sender_short_name':'othello-bot', - 'sender_realm_str':'example', - 'content':'Something is rotten in the state of Denmark.', - 'recipient_id':12314, - 'client':'website', - 'subject_links':[ - - ], - 'subject':'Castle', - 'type':'stream', - 'id':12345678, - - } - }, - { - 'type':'message', - 'id':1, - 'message':{ - 'content_type':'text/x-markdown', - 'avatar_url':'https://url/for/othello-bots/avatar', - 'timestamp':1375978404, - 'display_recipient':[ - { - 'full_name':'Hamlet of Denmark', - 'email':'hamlet@example.com', - 'short_name':'hamlet', - 'id':31572 - } - ], - 'sender_id':13215, - 'sender_full_name':'Othello Bot', - 'sender_email':'othello-bot@example.com', - 'sender_short_name':'othello-bot', - 'sender_realm_str':'example', - 'content':'I come not, friends, to steal away your hearts.', - 'recipient_id':18391, - 'client':'website', - 'subject_links':[ - - ], - 'subject':'', - 'type':'private', - 'id':12345679, - - } - } - ] -} -``` +{generate_code_example|get-events-from-queue|fixture}