With StoragePy you can instantly have a testing platform for your JSONs. That is, a solid RESTfull API + DB waits for you!
For using the API you must first sign up and get a valid username. Only an email address is required for signing up.
Users can sign up through:
- Official Website
- Post request
One's username is calculated MD5-hashing his/her email address.
If you lose your username, you can still calculate it or sign up again (no data will be lost, I swear).
Enter you email into the appropriate field at the beggining of the page.
You will receive an alert containing your assigned username as response. And that's it!
Using a post request containing your email is enough for signing up. All you need to do is:
- Prepare a
POST
request tohttp://api.storagepy.tk/signup
- Add
content-Type: "application/x-www-form-urlencoded"
to headers - Set
email=your_email
as data - Don't worry about
Access-Control-Allow-Origin
- Wait for a 201 response containing
{ "hash" : username }
The response above means you're done and the server is ready for you.
Sample request:
curl -X POST -H "Content-Type:application/x-www-form-urlencoded" -d 'email=johnsnow%40gmail.com' http://api.storagepy.tk/signup
The only personal information we store is your email address. Since we hash it for signing up, anyone with access to your username will not be able to recover your email address. Besides that, we do not encourage you to put any sensitive data on our databases, it's a testing platform!
All the requests must fulfill the following requirements:
- Have
http://api.storagepy.tk/
as the base url. - Expect a response in
JSON
format. - Send data (if applicable) in
JSON
format.
Returns json data from the specified user.
-
URL
/:user_id
-
Method:
GET
-
URL Params
user_id=[32-byte hex-string]
-
Data Params
None
-
Success Response:
- Code: 200
Content:{ 'data' : your_data_as_json }
- Code: 200
-
Error Response:
- Code: 404 NOT FOUND
Content:{ 'error' : 'Not found' }
OR
- Code: 400 BAD REQUEST
Content:{ 'error' : 'Bad request' }
- Code: 404 NOT FOUND
-
Sample Call:
$.ajax({ url: "/d41d8cd98f00b204e9800998ecf8427e", type : "GET", success : function(r) { console.log(r); } });
Inserts or updates data from the specified user. Returns new data.
-
URL
/:user_id
-
Method:
POST
orPUT
-
URL Params
user_id=[32-byte hex-string]
-
Data Params
your_data_as_json
-
Success Response:
- Code: 200
PUT
|| 201POST
Content:{ 'data' : your_data_as_json }
- Code: 200
-
Error Response:
- Code: 404 NOT FOUND
Content:{ 'error' : 'Not found' }
OR
- Code: 400 BAD REQUEST
Content:{ 'error' : 'Bad request' }
OR
- Code: 413 PAYLOAD TOO LARGE
Content:{ 'error' : 'Payload too large' }
- Code: 404 NOT FOUND
-
Sample Call:
your_data_as_json = JSON.stringify(your_data) $.ajax({ url: "/d41d8cd98f00b204e9800998ecf8427e", type : "POST", // POST || PUT contentType: "application/json", data: your_data_as_json success : function(r) { console.log(r); } });
Delete data from the specified user. Returns true
if succeeded.
-
URL
/:user_id
-
Method:
DELETE
-
URL Params
user_id=[32-byte hex-string]
-
Data Params
None
-
Success Response:
- Code: 200
Content:{ 'result' : true }
- Code: 200
-
Error Response:
- Code: 404 NOT FOUND
Content:{ 'error' : 'Not found' }
OR
- Code: 400 BAD REQUEST
Content:{ 'error' : 'Bad request' }
- Code: 404 NOT FOUND
-
Sample Call:
$.ajax({ url: "/d41d8cd98f00b204e9800998ecf8427e", type : "DELETE", success : function(r) { console.log(r); } });
We believe our users will make a fair use of the platform. Therefore, each user has a really high quota for requests and a 5mb quota for storage.