-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
124 lines (92 loc) · 3.23 KB
/
apiary.apib
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
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# HybridPOC
HybridPOC API is a simple API allowing users to do stuff.
# Login API [/login]
Login endpoint used to authentificate a user. Returns an active session id.
## Login [POST]
The API takes a JSON object containing the users credentials.
+ username (string) - Username as string
+ password (string) - Password as string
+ Request (application/json)
{
"username": "Username",
"password": "Password"
}
+ Response 200 (application/json)
{
"sessionID" : "be2aa4e2-19a7-4387-9e52-8f3d810b6cfb"
}
+ Response 401 (application/json)
{
"errorMessage" : "Username or password incorrect. Please retry"
}
## Group Locations
Resources related to locations in the API.
## Location [/locations/{location_id}]
A Location object has the following attributes:
+ ShopID
+ Name
+ Address
+ ContactDetails
+ Latitude
+ Longitude
+ Parameters
+ location_id (required, number, `1`) ... ID of the Location in form of an integer
### View a Location Detail [GET]
+ Response 200 (application/json)
{
"ShopID" : "1",
"Name": "Shop no 1",
"Address": "Cluj-Napoca, Plopilor 50",
"ContactDetails" : {
"Phone":"0368425540",
"Web":"http://shop1.t.com",
"Email":"shop1@t.com",
"Facebook":"shop1@facebook.com"
},
"Location" : {
"Latitude": "425540",
"Longitude" : "42550"
}
}
## Locations Collection [/locations{?page}]
+ Parameters
+ page (optional, number, `1`) ... The page of locations to return
### List All Locations [GET]
+ Response 200 (application/json)
+ Headers
Link: </locations?page=2>; rel="next"
+ Body
[
{
"ShopID" : "1",
"Name": "Shop no 1",
"Address": "Cluj-Napoca, Plopilor 50",
"ContactDetails" : {
"Phone":"0368425540",
"Web":"http://shop1.t.com",
"Email":"shop1@t.com",
"Facebook":"shop1@facebook.com"
},
"Location" : {
"Latitude": "425540",
"Longitude" : "42550"
}
},
{
"ShopID" : "2",
"Name": "Shop no 2",
"Address": "Cluj-Napoca, Plopilor 55",
"ContactDetails" : {
"Phone":"0368425545",
"Web":"http://shop2.t.com",
"Email":"shop2@t.com",
"Facebook":"shop2@facebook.com"
},
"Location" : {
"Latitude": "424540",
"Longitude" : "42650"
}
}
]