Make a Bin
Make a new bin - There are a few options avaliable when making a bin. It comes down to the level of privacy you want the bin to have. Keep in mind that the bin uses a unique uuid4 which is already impossible to guess (in practical terms).
The response will change based on the privacy type you select. See examples below. All responses will be in json.
Makebin accepts GET requests only. It accepts options as a url query or as a header.
Response consists of:
- binid : Unique bin identifier, used as part of the url
- link : Direct link to GET and POST webhooks for the bin
- postlink : Direct link to POST webhooks with token (includes bin key)
- getlink : Direct link to GET webhooks with token (includes bin key)
- header : Header needed for private bins (only private bins)
- token : To be used as part of the url or header for private bins (only private bins)
Basic webhook bin
Create a unique webhook bin that can be posted to and read from by anyone with the link
curl https://webhookbin.net/v1/makebin
import requests
res = requests.get("https://webhookbin.net/v1/makebin")
print(res.text)
{
"binid": "456ce34d-19f6-4561-8bcf-f819001f9d50",
"link": "https://webhookbin.net/v1/bin/456ce34d-19f6-4561-8bcf-f819001f9d50",
"postlink": "https://webhookbin.net/v1/bin/456ce34d-19f6-4561-8bcf-f819001f9d50",
"getlink": "https://webhookbin.net/v1/bin/456ce34d-19f6-4561-8bcf-f819001f9d50"
}
Private Bins
A key in the form of a header or url query is needed for these bins. Do not lose this key. It cannot be recovered as the server only has a hashed/salted version.
Private Read and Write
Make a bin that requires a key for both writing to it and reading from it.
curl https://webhookbin.net/v1/makebin?private=both
curl -H "private: both" https://webhookbin.net/v1/makebin
import requests
header = {"Private":"both"}
res = requests.get("https://webhookbin.net/v1/makebin",headers=header)
print(res.text)
Private Read Only
Make a bin that only requires a key to read but anyone with the url can write to it.
curl https://webhookbin.net/v1/makebin?private=post
curl -H "private: post" https://webhookbin.net/v1/makebin
import requests
header = {"Private":"post"}
res = requests.get("https://webhookbin.net/v1/makebin",headers=header)
print(res.text)
Private Write Only
Make a bin that only requires a key to write to but anyone with the url can read from it.
curl https://webhookbin.net/v1/makebin?private=get
curl -H "private: get" https://webhookbin.net/v1/makebin
import requests
header = {"Private":"get"}
res = requests.get("https://webhookbin.net/v1/makebin",headers=header)
print(res.text)
Private Bin Response
The response when making a private bin has an added token and header.
The postlink will have the binauth key added when a key is required to write to a bin, and the getlink will have the key added when a key is required to read from a bin.
{
"binid": "6a51f8b3-dcc4-465c-a000-651f18964172",
"link": "https://webhookbin.net/v1/bin/6a51f8b3-dcc4-465c-a000-651f18964172",
"postlink": "https://webhookbin.net/v1/bin/6a51f8b3-dcc4-465c-a000-651f18964172?Binauth=xLmbYbdbnHgCNv1krJjxqAA0midVxJ7UTW9tSqFW1lM",
"getlink": "https://webhookbin.net/v1/bin/6a51f8b3-dcc4-465c-a000-651f18964172?Binauth=xLmbYbdbnHgCNv1krJjxqAA0midVxJ7UTW9tSqFW1lM",
"token": "xLmbYbdbnHgCNv1krJjxqAA0midVxJ7UTW9tSqFW1lM",
"header": {
"Binauth": "xLmbYbdbnHgCNv1krJjxqAA0midVxJ7UTW9tSqFW1lM"
}
}