Skip to content

Commit 3c01ac1

Browse files
committed
Minimize confusion about delete by query endpoint
1 parent 44df116 commit 3c01ac1

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

docs/api/about.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ You must set the [`Api-Key`](#api-key) header if you have a Webhook.site account
2626
* In API URLs, you *cannot* use Token Aliases in place of the Token ID.
2727
* Webhook.site API Keys *must* be specified using the `Api-Key` HTTP header.
2828
* Fair use guidelines, rate limits, and other limitations apply as described by the [Terms of Service](https://webhook.site/terms).
29+
* If you're interacting with Tokens or Requests, make sure you keep the `/token/` part! (Otherwise Webhook.site won't recognize it as an API URL.)
2930

3031
## API Key
3132

docs/api/requests.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,15 @@ Deletes all requests associated with the token, or if `query`, `date_from` and/o
321321

322322
### Query string parameters
323323

324-
* `date_from`, `date_to` - filter requests by date, format `yyyy-MM-dd HH:mm:ss`
325-
* `query` - filter requests by a query string search. [See here for examples](#search-query-examples).
324+
* `date_from`, `date_to` - filter requests by date (format `yyyy-MM-dd HH:mm:ss`) or [date expressions](/api/date-expressions.html).
325+
* `query` - filter requests by a Search Query. [See here for examples](#search-query-examples).
326326

327327

328328
### Full URL Example
329329

330-
A request to the following URL will delete all requests on a Token older than 14 days, due to the `query` parameter being `created_at:[* TO now-14d]`. You could use this in a [Webhook.site Schedule](/schedules.html) to delete old requests from a URL periodically.
330+
A request to the following URL will delete all requests on a Token older than 7 days, due to the `date_to` parameter being `now-7d`. You could use this in a [Webhook.site Schedule](/schedules.html) to delete old requests from a URL periodically.
331331

332-
`https://webhook.site/token/00000000-0000-0000-0000-000000000000/request?query=created_at:[* TO now-14d]`
332+
<code>https://webhook.site/token/<span class="url-param">tokenId</span>/request?date_to=<span class="url-param">now-7d</span></code>
333333

334334
### Response
335335

docs/index.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,16 @@ Using the Webhook.site API (specifically, the [Delete Multiple Requests endpoint
152152

153153
To set it up, first, [create an API Key](https://webhook.site/api-keys).
154154

155-
Then create a Schedule like the following screenshot.
155+
Then [create a Schedule](https://webhook.site/control-panel/schedules/create) like the following screenshot.
156156

157-
In this example, Webhook.site will remove data older than 14 days every 24 hours. `now-12h` would be 12 hours. [More date format examples](/api/date-expressions.html).
157+
In this example, Webhook.site will remove data older than 7 days every 24 hours. (`now-12h` would be 12 hours. [More date format examples](/api/date-expressions.html)).
158158

159-
Remember to click the URL Encode button before saving.
160-
161-
* URL: `https://webhook.site/token/00000000-0000-0000-000000000/request?query=created_at:[* TO now-14d]` - replace `00000000-0000-0000-000000000` with the URL/Token ID.
159+
* URL: <code>https://webhook.site/token/<span class="url-param">tokenId</span>/request?date_to=now-7d</code>
160+
* Replace `tokenId` with the URL/Token ID. Make sure to keep the `/token/` part, though!
161+
* Make sure to click the *URL Encode* button after entering the URL.
162162
* Method: `DELETE`
163-
* Headers: `Api-Key: 00000000-0000-0000-000000000` - replace `00000000-0000-0000-000000000` with your API key.
163+
* Headers: `Api-Key: 00000000-0000-0000-000000000`
164+
* Replace `00000000-0000-0000-000000000` with your API key.
164165

165166
<figure markdown="span">
166167
![Automatically remove requests with Schedules](/images/schedule-autodelete.png){ width="300" }
@@ -169,7 +170,7 @@ Remember to click the URL Encode button before saving.
169170

170171
## What's a Webhook.site "Token"?
171172

172-
A *Token* is how a Webhook.site URL is referred to in our API, it's the technical name for it. A *Token* corresponds to a unique UUID, which is also the Web address, email address and DNSHook address. A Token acts as a container for requests, emails and DNS queries. [More about Tokens](/api/tokens.html)
173+
A *Token* is how a Webhook.site URL is referred to in our API, it's the technical name for it. A *Token* corresponds to a unique [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier), which is also the Web address, email address and DNSHook address. A Token acts as a container for requests, emails and DNS queries. [More about Tokens](/api/tokens.html)
173174

174175
## How do I transfer my Webhook.site account and data?
175176

0 commit comments

Comments
 (0)