Skip to content

Commit d150f49

Browse files
committed
Clone and Customize
1 parent cdf2881 commit d150f49

File tree

7 files changed

+335
-217
lines changed

7 files changed

+335
-217
lines changed

source/images/favicon.ico

14.7 KB
Binary file not shown.

source/images/logo.png

3.92 KB
Loading

source/includes/_errors.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
# Errors
22

3-
<aside class="notice">
4-
This error section is stored in a separate file in <code>includes/_errors.md</code>. Slate allows you to optionally separate out your docs into many files...just save them to the <code>includes</code> folder and add them to the top of your <code>index.md</code>'s frontmatter. Files are included in the order listed.
5-
</aside>
3+
> Handling Errors
64
7-
The Kittn API uses the following error codes:
5+
```shell
6+
# Select a client library to see examples of handling different kinds of errors.
7+
```
88

9+
Recursion.Space API uses conventional HTTP response codes to indicate the success or failure of an API call. In general: Codes in the <code>2xx</code> range indicate success. Codes in the <code>4xx</code> range indicate an error that failed given the information provided. Codes in the <code>5xx</code> range indicate an error with Recursion.Space servers (these are rare).
910

10-
Error Code | Meaning
11-
---------- | -------
12-
400 | Bad Request -- Your request is invalid.
13-
401 | Unauthorized -- Your API key is wrong.
14-
403 | Forbidden -- The kitten requested is hidden for administrators only.
15-
404 | Not Found -- The specified kitten could not be found.
16-
405 | Method Not Allowed -- You tried to access a kitten with an invalid method.
17-
406 | Not Acceptable -- You requested a format that isn't json.
18-
410 | Gone -- The kitten requested has been removed from our servers.
19-
418 | I'm a teapot.
20-
429 | Too Many Requests -- You're requesting too many kittens! Slow down!
21-
500 | Internal Server Error -- We had a problem with our server. Try again later.
22-
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later.
11+
| Error Code | Meaning |
12+
| ---------- | --------------------------------------------------------------- |
13+
| 400 | Bad Request -- Your request is invalid. |
14+
| 403 | Authentication -- You do not have permission to view resource. |
15+
| 405 | Bad Method -- Method used (GET, POST, DELETE, PUT) not allowed. |
16+
| 418 | I'm a teapot. |

source/includes/_modules.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# MODULES
2+
3+
Modules refer to the safety and training "courses" that can be created within the system.
4+
5+
## Module List
6+
7+
> `GET` /v1/modules/{space_id}
8+
9+
```shell
10+
curl "https://api.recursion.space/v1/modules/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" \
11+
-H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
12+
```
13+
14+
> RESPONSE
15+
16+
```json
17+
[
18+
{
19+
"id": #,
20+
"name": "Proper Tool Lesson",
21+
"brand": "DeWaukee",
22+
"model": "TorqueHammer 3000",
23+
"general_reading": "<p>Lorem ipsum dolor sit amet....</p>",
24+
"video": "https://youtube.com",
25+
"classmaker": "https://classmaker.com",
26+
"required_training": true,
27+
"classlink": "https://calendar.com",
28+
"archive": false
29+
30+
},
31+
]
32+
```
33+
34+
Returns the details for all modules created at the selected space.
35+
36+
### Returns
37+
38+
| Parameter | Type | Description |
39+
| ----------------- | :-----: | ------------------------------------------------------------ |
40+
| id | integer | Identification number of the module. |
41+
| name | string | The user defined name for the module. |
42+
| brand | string | Brand name of tool the module is associated with. |
43+
| model | string | Model name of the tool the module is associated with. |
44+
| general_reading | string | HTML formatted reading material. |
45+
| video | string | URL for an instructional video for the module. |
46+
| classmaker | string | URL for the test/quiz of the module. |
47+
| required_training | boolean | Indicates if in-person training is a requirement. |
48+
| classlink | string | URL to the registration location for the in-person training. |
49+
| archive | boolean | Indicator if the module is active or not. |
50+
51+
## Module Progress
52+
53+
> `GET` /v1/moduleprogress/{username} <br> `POST` /v1/moduleprogress/{username}
54+
55+
```shell
56+
curl "https://api.recursion.space/v1/moduleprogress/username" \
57+
-H "Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
58+
59+
curl -X POST "https://api.recursion.space/v1/moduleprogress/username" \
60+
-H "Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
61+
-d "module=##"
62+
-d "param=value"
63+
```
64+
65+
> GET RESPONSE
66+
67+
```json
68+
[
69+
{
70+
"module": #,
71+
"general_reading_completed": true,
72+
"video_completed": false,
73+
"classmaker_initiated": true,
74+
"classmaker_completed": false,
75+
"required_training_initiated": false,
76+
"required_training_completed": false,
77+
"username": "AwesomeMember"
78+
},
79+
]
80+
```
81+
82+
`GET: Returns the progress for all modules associated with a selected user.` <br>
83+
`POST: Update one or more progress parameters for a selected module.`
84+
85+
### Returns
86+
87+
| Parameter | Type | Description |
88+
| --------------------------- | :-----: | --------------------------------------------------------------------------- |
89+
| module | integer | The ID of the modules. |
90+
| general_reading_completed | boolean | An indication of the user has clicked open the reading material. |
91+
| video_completed | boolean | And indication if the user has viewed the video of the module. |
92+
| classmaker_initiated | boolean | An indicator that the user has clicked the associated exam link. |
93+
| classmaker_completed | boolean | Set by the admin once the user has module exam has been passed sucessfully. |
94+
| required_training_initiated | boolean | An indicator that he user has clicked to schedule a training time. |
95+
| required_training_completed | boolean | Set by the admin once the required training has been complete. |
96+
| username | string | Username associated with the operators account. |

source/includes/_space.md

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# SPACE
2+
3+
## Space Details
4+
5+
> `GET` /v1/spaces <br> `GET` /v1/spaces/{space_id}
6+
7+
```shell
8+
curl "https://api.recursion.space/v1/spaces/{xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx}" \
9+
-H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
10+
```
11+
12+
> RESPONSE
13+
14+
```json
15+
[
16+
{
17+
"id": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
18+
"name": "The Void",
19+
"address": "1331 12th Ave",
20+
"address2": "STE 205",
21+
"city": "Altoona",
22+
"state": "PA",
23+
"zipcode": "16601",
24+
"country": "United States",
25+
"email": "demo@recursion.space",
26+
"timezone": "UTC"
27+
}
28+
]
29+
```
30+
31+
Return a list of spaces owned by the API Token holder, or return information on a specific space by filtering with the space id.
32+
33+
### Returns
34+
35+
| Parameter | Type | Description |
36+
| --------- | :----: | ---------------------------------------- |
37+
| id | string | The unique space identifier. |
38+
| name | string | Your name for the space. |
39+
| address | string | The physical address of the space. |
40+
| address2 | string | Address line for STE, UNIT, BLD, ect. |
41+
| city | string | City component of the spaces address. |
42+
| state | string | State component of the spaces address. |
43+
| zipcode | string | Zipcode component of the spaces address. |
44+
| country | string | Country where the space is located. |
45+
| email | string | Primary/General email for the space. |
46+
| timezone | string | Selected timezone for the space. |
47+
48+
## Operators Details
49+
50+
> `GET` /v1/operators/{space_id}
51+
52+
```shell
53+
curl "https://api.recursion.space/v1/operators/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" \
54+
-H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
55+
```
56+
57+
> RESPONSE
58+
59+
```json
60+
[
61+
{
62+
"facility": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
63+
"cardNumber": "0123456789",
64+
"phone_number": ,
65+
"address": "1331 12th Ave",
66+
"city": "Altoona",
67+
"state": "PA",
68+
"zip_code": "16601",
69+
"username": "DemoUser",
70+
"first_name": "Lorem",
71+
"last_name": "Ipsum",
72+
"email": "demo@recursion.space",
73+
},
74+
]
75+
```
76+
77+
Retrive information for all operators ("admins") for the selected space.
78+
79+
### Returns
80+
81+
| Parameter | Type | Description |
82+
| ------------ | :----: | --------------------------------------------------- |
83+
| facility | string | The facility id for which the operator belongs to. |
84+
| cardNumber | string | The RFID number assigned to the operator. |
85+
| phone_number | string | Operator provided phone number. |
86+
| address | string | Operator provided address. |
87+
| city | string | City component of address provided by operator. |
88+
| state | string | State component of address provided by operator. |
89+
| zip_code | string | Zip Code component of address provided by operator. |
90+
| username | string | Username associated with the operators account. |
91+
| first_name | string | Operators first name. |
92+
| last_name | string | Operators last name. |
93+
| email | string | Operator provided email. |
94+
95+
## Member Details
96+
97+
> `GET` /v1/members/{space_id}
98+
99+
```shell
100+
curl "https://api.recursion.space/v1/members/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" \
101+
-H "Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
102+
```
103+
104+
> RESPONSE
105+
106+
```json
107+
[
108+
{
109+
"cardNumber": "0123456789",
110+
"access_group": 123,
111+
"phone_number": "calico",
112+
"address": 6,
113+
"city": 7,
114+
"state": ,
115+
"zip_code": ,
116+
"username": ,
117+
"first_name": ,
118+
"last_name": ,
119+
"email": ,
120+
"restricted_nodes": []
121+
},
122+
]
123+
```
124+
125+
Retrieve information for all members associated with a space.
126+
127+
### Returns
128+
129+
| Parameter | Type | Description |
130+
| ---------------- | :-----: | ------------------------------------------------------------------------- |
131+
| cardNumber | string | The RFID number assigned to your member. |
132+
| access_group | integer | The ID for the access group that the member belongs to. |
133+
| phone_number | string | Member provided phone number. |
134+
| address | string | Member provided address. |
135+
| city | string | City component of address provided by member. |
136+
| state | string | State component of address provided by member. |
137+
| zip_code | string | Zip Code component of address provided by member. |
138+
| username | string | Username associated with the members account. |
139+
| first_name | string | Members first name. |
140+
| last_name | string | Members last name. |
141+
| email | string | Member provided email. |
142+
| restricted_nodes | array | List of IDs the member does not have access to within their access group. |
143+
144+
## Access Details
145+
146+
> GET /v1/permissions/{space_id}
147+
148+
```shell
149+
curl "https://api.recursion.space/v1/permissions/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" \
150+
-H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
151+
```
152+
153+
> RESPONSE
154+
155+
```json
156+
[
157+
{
158+
"id": 2,
159+
"name": "Max",
160+
"startTime": "unknown",
161+
"endTime": 5,
162+
"monday": 10,
163+
"tuesday": false,
164+
"wednesday": false,
165+
"thursday": false,
166+
"friday": false,
167+
"saturday": false,
168+
"sunday": false,
169+
"twenty_four_seven": true,
170+
"default_fallback": false,
171+
"facility": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
172+
"allowedNodes": [19]
173+
}
174+
]
175+
```
176+
177+
Returns the available permissions, or access groups, for the space.
178+
179+
### Returns
180+
181+
| Parameter | Type | Description |
182+
| ----------------- | :-----------: | --------------------------------------------------------------------- |
183+
| id | integer | The ID of the access group. |
184+
| name | string | Name descriptor for the access group. |
185+
| startTime | integer | The daily start time when access is permitted for this group. |
186+
| endTime | integer | The daily end time when access is no longer permitted for this group. |
187+
| monday | boolean | True if access is is allowed for a Monday, otherwise false. |
188+
| tuesday | boolean | True if access is is allowed for a Tuesday, otherwise false. |
189+
| wednesday | boolean | True if access is is allowed for a Wednesday, otherwise false. |
190+
| thursday | boolean | True if access is is allowed for a Thursday, otherwise false. |
191+
| friday | boolean | True if access is is allowed for a Friday, otherwise false. |
192+
| saturday | boolean | True if access is is allowed for a Saturday, otherwise false. |
193+
| sunday | boolean | True if access is is allowed for a Sunday, otherwise false. |
194+
| twenty_four_seven | boolean | Set true if group is allowed access 24 hours a day, 7 days a week. |
195+
| facility | string | The ID for which the access group belongs to. |
196+
| allowedNodes | integer array | List of nodes permitted to be used within this group. |

0 commit comments

Comments
 (0)