See: https://jsonbin.io/api-reference
Execute the following commands after registration:
rm -f jsonbin.json
http --session=./jsonbin.json https://api.jsonbin.io/ 'secret-key:<secret-key>' -v
cat jsonbin.json
The secret key to be substituted into the command above can be found here (requires login): https://jsonbin.io/api-keys.
In the following, HTTPie will include the secret-key
header field with the secret key in subsequent requests when the --session-read-only=./jsonbin.json
command line option is specified.
Uploading JSON data with public visibility:
http --session-read-only=./jsonbin.json https://api.jsonbin.io/b name:hello private:false text="Hello, World!" -v
Your uploaded data is available here (requires login): https://jsonbin.io/dashboard.
Querying data by the identifier ("id"
) provided in the response:
http https://api.jsonbin.io/b/<id> -v
Uploading JSON data with private visibility:
http --session-read-only=./jsonbin.json https://api.jsonbin.io/b name:credentials private:true username=admin password=secret -v
Querying data by the identifier ("id"
) provided in the response:
http https://api.jsonbin.io/b/<id> -v # Error (Unauthorized)
http --session-read-only=./jsonbin.json https://api.jsonbin.io/b/<id> -v
Uploading JSON data from the file system:
http https://api.thetvdb.com/series/80379 -d -o The_Big_Bang_Theory.json
http --session-read-only=./jsonbin.json https://api.jsonbin.io/b name:The_Big_Bang_Theory private:false @The_Big_Bang_Theory.json -v
Deleting JSON data:
http --session-read-only=./jsonbin.json DELETE https://api.jsonbin.io/b/<id> -v
The returned status code is 502 (Bad Gateway
), however, the bin is deleted.
Downloading some JSON data for testing purposes:
http https://api.thetvdb.com/series/121361 -d -o Game_of_Thrones.json
http https://api.thetvdb.com/series/153021 -d -o The_Walking_Dead.json
Creating a collection:
http --session-read-only=./jsonbin.json https://api.jsonbin.io/c name="TheTVDB Data" -v
Storing test data in the newly created collection based on the identifier ("id"
) provided in the response:
http --session-read-only=./jsonbin.json https://api.jsonbin.io/b name:Game_of_Thrones private:false collection-id:<id> @Game_of_Thrones.json -v
http --session-read-only=./jsonbin.json https://api.jsonbin.io/b name:The_Walking_Dead private:false collection-id:<id> @The_Walking_Dead.json -v
Your collections can be found here (requires login): https://jsonbin.io/dashboard.