This repository has been archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
api_v1.json
83 lines (83 loc) · 2.16 KB
/
api_v1.json
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
{
"openapi": "3.0.3",
"info": {
"version": "v1",
"title": "CWA-Data Event-Driven-User-Survey (EDUS) API",
"license": {
"name": "Apache 2.0"
}
},
"paths": {
"/version/{version}/otp": {
"post": {
"summary": "Post one-time-passcode (OTP)",
"tags": [
"redeem otp"
],
"parameters": [
{
"name": "version",
"in": "path",
"description": "API version",
"required": true,
"schema": {
"$ref": "#/components/schemas/Version"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/otp"
},
"example": {
"otp": "b3c0bcec-d6ab-41a7-b2f6-b005cfaa76cb"
}
}
}
},
"responses": {
"200": {
"description": "OTP was valid and is now marked as used - it's redeemed"
},
"400": {
"description": "OTP could be expired or already redeemed",
"content": {
"application/json": {
"examples": {
"redeemed": {
"value": "{\n \"otp\": \"b3c0bcec-d6ab-41a7-b2f6-b005cfaa76cb\",\n \"state\": \"redeemed\"\n}"
},
"expired": {
"value": "{\n \"otp\": \"b3c0bcec-d6ab-41a7-b2f6-b005cfaa76cb\",\n \"state\": \"expired\"\n}"
}
}
}
}
},
"404": {
"description": "OTP never existed and is not valid"
},
"500": {
"description": "server errros while processing the request"
}
}
}
}
},
"components": {
"schemas": {
"Version": {
"type": "string",
"description": "A string of form 'v[\\d+]'",
"example": "v1"
},
"otp": {
"type": "string",
"format": "json",
"description": "A single one-time-passcode to participate in a survey"
}
}
}
}