API Reference

CORS Enabled

Request A JSON

GET /b/:id
Private Bins

In-order to request a private bin, you need to pass a security-key key in the request headers. You can find your security key here once you sign-in. This key is required every time when you request for a bin or an updated version of the bin if the record which is stored is private.

Request Specific Version (if you update)
GET /b/:id/:version   #if you update the JSON using the Update API
Request Latest Version (if you update)
GET /b/:id/latest   #if you update the JSON using the Update API
Add /pretty (Optional parameter) for pretty JSON response
GET /b/:id/pretty
GET /b/:id/(:version|latest)/pretty #if you update the JSON
On Success (Server Response)
STATUS
200 OK
On Error (Server Response)
STATUS
422 Unprocessable Entity
DATA
success: false, (Invalid snippet ID | Snippet not found)
Example (jQuery) - Request Original Version
$.get('//jsonbin.io/b/591a01528c8d6246313db019', function(data) {
  //use the data here
  console.log(data); //returns json object
});
Demo Fiddle


Example (jQuery) - Request Specific Version
$.get('//jsonbin.io/b/591a01528c8d6246313db019/1', function(data) {
  //use the data here
  console.log(data); //returns json object
});
Demo Fiddle

Create A JSON

POST (RAW) /b/new
ON SUCCESS (SERVER RESPONSE)
STATUS
200 OK
DATA
success: true,
data: {STRINGIFIED_JSON},
id: SNIPPET_ID
On Error (Server Response)
STATUS
422 Unprocessable Entity
DATA
success: false,
(Snippet (parameter is missing | cannot be blank, invalid json, please try again))
Example (Raw - Type JSON)
{
  "snippet": "{\"name\": \"John Doe\"}" //Stringified JSON
}
Private Bins

In-order to create a private bin, you need to pass a security-key key in the request headers. You can find your security key here once you sign-in. If security-key is missing, the record won't be stored as a private record.


Update A JSON

POST (RAW) /b/update/:id
On Success (Server Response)
STATUS
200 OK
DATA
success:true,
data:{STRINGIFIED_JSON},
version: {SNIPPET_VERSION_ID},
parentId: {PARENT_SNIPPET_ID}
On Error (Server Response)
STATUS
422 Unprocessable Entity
DATA
success: false,
(Snippet not found | Snippet parameter is missing | Invalid JSON, Please try again | Something went wrong)
Example (Raw - Type JSON)
{
  "snippet": "{\"name\": \"John Doe\", \"newdata\": \"new version will be created\"}" //Stringified JSON
}
Private Bins

In-order to update a private bin, you need to pass a security-key key in the request headers. You can find your security key here once you sign-in. You cannot update a private record without providing security-code key in the request header.