Using the SCHEMA DOCS READ API, you can READ the Schema docs which can be used to validate records if attached to a Collection.
Root
https://api.jsonbin.io/v3
Route
/s/<SCHEMA_DOC_ID>
Request Type
GET
Request Headers
Header | Value | Required |
X-Master-Key | <YOUR_SECRET_KEY> | Yes |
X-Master-Key
X-Master-Key is required to Read a Schema Doc. You can find your X-Master-Key on the API Keys page after signing-in.
Basic Code Samples
curl -v\
-H "Content-Type: application/json" \
-H "X-Master-Key: <YOUR_API_KEY>" \
--request GET \
https://api.jsonbin.io/v3/s/<SCHEMA_DOC_ID>
let req = new XMLHttpRequest();
req.onreadystatechange = () => {
if (req.readyState == XMLHttpRequest.DONE) {
console.log(req.responseText);
}
};
req.open("GET", "https://api.jsonbin.io/v3/s/<SCHEMA_DOC_ID>", true);
req.setRequestHeader("X-Master-Key", "<YOUR_API_KEY>");
req.send();
import requests
url = 'https://api.jsonbin.io/v3/s/<SCHEMA_DOC_ID>'
headers = {
'X-Master-Key': '<YOUR_API_KEY>'
}
data = {}
req = requests.get(url, json=data, headers=headers)
print(req.text)
require 'net/http'
require 'json'
uri = URI("https://api.jsonbin.io/v3/s/<SCHEMA_DOC_ID>")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
req = Net::HTTP::Get.new(uri)
req['X-Master-Key'] = '<YOUR_API_KEY>'
http.request(req)
end
puts res.body
Request Response
Success 200
{
"record":{
<SCHEMA_VALIDATION_JSON>
},
"metadata": {
"id":"<SCHEMA_DOC_ID>",
"createdAt": <DATE/TIME>,
"name": "User Validation"
}
}
Error 400, 401, 403
{
"message": "<ERROR_MESSAGE>"
}
Status Code | Error Message |
---|---|
401 Unauthorized |
You need to pass X-Master-Key in the header |
400 Bad Request |
Invalid Schema Id provided |
401 Unauthorized |
Invalid X-Master-Key provided |
404 Not Found |
Schema Doc not found |
403 Forbidden |
Requests exhausted. Buy additional requests at https://jsonbin.io/pricing |