-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathswagger.yaml
164 lines (161 loc) · 5 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
swagger: '2.0'
info:
title: Steps Bot API Specification
description: >-
The official API documentation for steps-bot. You will need to have a running instance of the [coach-app](https://github.com/IDEOorg/steps) to test these API endpoints on your local environment.
version: 1.0.0
basePath: /
schemes:
- https
- http
paths:
/sms/receive:
post:
tags:
- Twilio
summary: A webhook for incoming messages to Twilio.
description: 'For implementation, see twilioController.hears() in index.js located in the root directory of the steps-bot code.'
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: message
description: Pet object that needs to be added to the store
required: true
schema:
type: object
properties:
user:
type: integer
example: 2359383456
text:
type: string
example: 'Hi'
responses:
'200':
description: OK
security:
/facebook/receive:
get:
tags:
- Facebook
summary: Performs the Facebook webhook verification handshake with the verify token
description: Perform the FB webhook verification handshake with your verify token. This is required to ensure your webhook is authentic and working
produces:
- application/json
parameters:
- name: hub.verify_token
in: query
description: FB webhook token
required: true
type: string
- name: hub.challenge
in: query
description: FB challenge token
required: true
type: string
- name: hub.mode
in: query
description: FB webhook mode
required: true
type: string
default: subscribe
responses:
'200':
description: OK
'403':
description: Forbidden
post:
tags:
- Facebook
summary: Webhook triggered in Facebook upon receipt of new message from user.
description: Message is parsed and then processed by the bot. Aka fbEndpoint in the bot code. See fbEndpoint() in index.js
consumes:
- application/json
produces:
- application/json
parameters:
- name: body
in: body
description:
required: true
schema:
type: object
properties:
object:
type: string
entry:
type: array
items:
properties:
id:
type: string
time:
type: integer
messaging:
type: array
items:
properties:
sender:
type: object
properties:
id:
type: string
recepient:
type: object
properties:
id:
type: string
responses:
'200':
description: ok
/helpresponse:
get:
tags:
- Help Request/Response
summary: An endpoint for receiving a coach's response to a help request
description: Returns a message from the coach app. This message is submitted from within the coach (web) application by subitting a form. For implementation, see routes() in server.js and getCoachResponse() in index.js located in the root directory of the steps-bot code.
produces:
- application/json
parameters:
- in: query
name: user_id
description: ID of the user whose request has been responded
required: true
schema:
type: integer
responses:
'200':
description: OK
/redirect:
get:
tags:
- Media
summary: An endpoint for tracking when a user clicks a link to a media object
description: When user clicks a link on a media object, it is sent to this endpoint so that a tracking function can be called. The user is then redirected to their original destination (media.url)
produces:
- application/json
parameters:
- in: query
name: contentId
description: ID of the media object
required: true
schema:
type: integer
- in: query
name: contentUrl
description: URL of the media object
required: true
schema:
type: string
- in: query
name: userId
description: ID of the user
required: true
schema:
type: integer
externalDocs:
description: Find out more about Steps Bot
url: 'https://github.com/IDEOorg/steps-bot'