This repository has been archived by the owner on Mar 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
/
ussd_collection.http
127 lines (122 loc) · 3.05 KB
/
ussd_collection.http
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
#### mermaid text
POST http://localhost:8007/ussd_airflow/mermaid_text
Accept: */*
Cache-Control: no-cache
Content-Type: application/json
{
"journey": {
"initial_screen": {
"type": "initial_screen",
"next_screen": "enter_height",
"default_language": "en"
},
"enter_height": {
"type": "input_screen",
"text": {
"en": "Enter your height\n",
"sw": "Weka ukubwa lako\n"
},
"input_identifier": "height",
"default_next_screen": "enter_age",
"next_screen": [
{
"condition": "input|int == 60",
"next_screen": "height_above_60"
},
{
"condition": "input|int == 30",
"next_screen": "height_below_30"
}
],
"validators": [
{
"regex": "^[0-9]{1,7}$",
"text": {
"en": "Enter number between 1 and 7\n",
"sw": "Weka namba kutoka 1 hadi 7\n"
}
}
]
},
"enter_age": {
"type": "input_screen",
"text": {
"en": "Enter your age\n",
"sw": "Weka miaka yako\n"
},
"input_identifier": "age",
"next_screen": "show_information",
"options": [
{
"text": {
"en": "back",
"sw": "rudi"
},
"next_screen": "enter_height"
}
],
"validators": [
{
"regex": "^[0-9]{1,7}$",
"text": {
"en": "Only nubers are allowed\n",
"sw": "Nambari pekee ndio zimekubalishwa\n",
"default": "en"
}
},
{
"expression": "ussd_request.input|int < 100",
"text": {
"en": "Number over 100 is not allowed\n",
"sw": "Nambari juu ya 100 haikubalishwi\n"
}
}
]
},
"show_information": {
"text": {
"en": "Your age is {{ age }} and your height is {{ height }}.\nEnter anything to go back to the first screen\n",
"sw": "Miaka yako in {{ age }} na ukubwa wako in {{ height }}.\nWeka kitu ingine yoyote unende kwenye screen ya kwanza\n"
},
"type": "input_screen",
"input_identifier": "foo",
"next_screen": "enter_height"
},
"height_above_60": {
"type": "quit_screen",
"text": "We are not interested with height above 60"
},
"height_below_30": {
"type": "quit_screen",
"text": "We are not interested with height below 30"
}
},
"mermaid_options": {
}
}
###
POST http://localhost:8007/ussd_airflow/validate_journey
Accept: */*
Cache-Control: no-cache
Content-Type: application/json
{
"journey": {
"initial_screen": {
"type": "initial_screen",
"next_screen": "enter_height",
"default_language": "en"
},
"enter_height": {
"type": "input_screen",
"next_screen": "no_screen",
"text": {
"en": "Enter your height\n",
"sw": "Weka ukubwa lako\n"
},
"validators": [
]
}
},
"error_type": "mermaid_txt"
}
###