-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsessions.json
More file actions
186 lines (186 loc) · 7.81 KB
/
sessions.json
File metadata and controls
186 lines (186 loc) · 7.81 KB
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
{
"title": "Session",
"category": "ancillary",
"docpath": "sessions",
"introduction": [
"Sessions are the keys to the Amatino kingdom. All requests to the Amatino API, except those requests to create Sessions themselves, must include two HTTP headers: An integer session identifier, and a Hashed Message Authentication Code (HMAC) signed with a Session API Key.",
"Creating a Session with a POST request is analogous to 'logging in', and deleting a Session with a DELETE request is analogous to 'logging out'. Your application might wish to create multiple Sessions for a <a href=\"/documentation/user\" class=\"link\">User</a>. For example, one per device.",
"The formula for the Amatino API HMAC signature is <span class=\"monospace\">SHA512((Unix timestamp in seconds) + (URI path) + (JSON data))</span>, using the Session API key as the hash key. The HMAC should be URL-safe Base64 encoded. For more help with generating request signatures, check out the <a class=\"list\" href=\"/knowledge/request-signatures\">Amatino API Request Signature knowledge base article.</a>"
],
"object": {
"name": "Session",
"exposition": "When returning a Session object to you, Amatino will use the following structure",
"form": {
"root": "object",
"components": [
{
"key": {
"value": "\"api_key\"",
"mono": true
},
"type": {
"value": "JSON String",
"mono": false
},
"description": {
"value": "A URL-safe base-64 encoded 256-bit random number generated in a cryptographically secure manner",
"mono": false
},
"example": {
"value": "\"EPcmwPnjFQFWrZjYtM3J6GZMrGA0gC-40cUD0NKK_K0A\"",
"mono": true
},
"note": {
"value": "Amatino replaces all <span class=\"monospace\">\"=\"</span> padding characters with the character <span class=\"monospace\">\"A\"</span>.",
"mono": false
}
},
{
"key": {
"value": "\"session_id\"",
"mono": true
},
"type": {
"value": "JSON Number",
"mono": false
},
"description": {
"value": "An integer Session identifier",
"mono": false
},
"example": {
"value": 4200100,
"mono": true
}
}
]
}
},
"actions": [
{
"name": "Create",
"method": "POST",
"path": "/session",
"description": "Create a new Amatino API Session",
"return_root_type": "JSON Object",
"required_json_data": {
"root": "object",
"components": [
{
"key": {
"value": "\"account_email\"",
"mono": true
},
"description": {
"value": "The email address associated with the User for which a Session is to be created",
"mono": false
},
"type": {
"value": "JSON String or JSON Null",
"mono": false
},
"example": {
"value": "\"clever@cookie.com\"",
"mono": true
},
"note": {
"value": "Supply either an account_email or user_id, but not both",
"mono": false
}
},
{
"key": {
"value": "\"user_id\"",
"mono": true
},
"description": {
"value": "The integer identifier associated with the User for which a Session is to be created",
"mono": false
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"example": {
"value": "8675392677",
"mono": true
},
"note": {
"value": "Supply either an account_email or user_id, but not both",
"mono": false
}
},
{
"key": {
"value": "\"secret\"",
"mono": true
},
"description": {
"value": "The passphrase associated with the User for which a Session is to be created",
"mono": false
},
"type": {
"value": "JSON String",
"mono": false
},
"example": {
"value": "\"excellent high entropy passphrase\"",
"mono": true
}
}
]
},
"required_headers": null,
"required_url_parameters": null,
"returns": {
"root": "object",
"components": {
"object": "session"
}
}
}, {
"name": "Delete",
"method": "DELETE",
"path": "/session",
"return_root_type": "JSON Object",
"description": "Delete a Session, ending its ability to be used to authenticated to the Amatino API",
"required_json_data": null,
"required_headers": [
{
"key": "X-Signature",
"content": "Your <a class=\"link\" href=\"/documentation/sessions\">Session</a> signature",
"example": "\"yxATCPRKAAXHNiPctNQPHEGGVJF\"..."
},
{
"key": "X-Session-ID",
"content": "An an integer <a class=\"link\" href=\"/documentation/sessions\">Session</a> ID",
"example": 7449059267091272858
}
],
"required_url_parameters": null,
"returns": {
"root": "object",
"components": [
{
"key": {
"value": "\"session_id\"",
"mono": true
},
"type": {
"value": "JSON Number",
"mono": false
},
"description": {
"value": "The id of a deleted session",
"mono": false
},
"example": {
"value": 4200100,
"mono": true
}
}
]
}
}
]
}