Skip to content

Commit 879f7c8

Browse files
committed
updates
1 parent b9dbf5a commit 879f7c8

8 files changed

Lines changed: 50 additions & 42 deletions

File tree

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Getting Started
22

3-
## API Key
3+
## Your application and credentials
44

5-
All requests to the API require authorization through an API key. To get your key visit https://dashboard.freestuffbot.xyz/ and click on **Your Application**. Create an application if not done already, then scroll down until you find your API key.
5+
To interact with any part of the FreeStuff API you need to create an application on https://dashboard.freestuffbot.xyz/.
6+
Once signed in you should find a button to view FreeStuff API settings on your home page.
7+
Go to Plans & Billing, then sign up for the free tier.
8+
9+
If you choose to upgrade to a tier with REST API access you can find your API key under "Settings". This is also where your App's public key for webhook verification is located.
610

711

812
## Libraries
913

1014
There are libraries to interact with the API available for the following languages / ecosystems. Using such an API wrapper is the easiest way to interact with FreeStuff's API and we highly recommend using an existing API wrapper if one is available that fits your setup. Please refer to the libary's documentation for usage.
1115

1216
- [Node / Bun (Official)](/libraries/node)
13-
- [Golang (Community Maintained)](/libraries/golang)
1417

content/3.api-v2/2.concepts.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,32 @@ More channels may be added in the future but here is our current list:
5757
:data-model{name="Channel"}
5858

5959

60-
## Summary
60+
## Content Summary
6161

6262
FreeStuff has different Channels with different purposes.
6363

6464
A Channel is used to publish Announcements.
6565

6666
An Announcement is a collection of Products, all with the same type but of potentially different kinds.
67+
68+
69+
## Compatibility Dates
70+
71+
::alert{type="info"}
72+
If you are using a client library you do not need to worry about compatibility dates. Your library will handle all of this for you and use a version that it is compatible with.
73+
::
74+
75+
API v2 introduces compatibility dates. These act as versioning for the format of the data you can access through FreeStuff's API.
76+
77+
> In simpler terms: Requesting a product through different compatibility dates will always return the same product but the data format might change.
78+
> For example, an older version might not include the product's description, while other version might change some field's name from "title" to "product_name".
79+
80+
We made this decision to allow our data model to evolve and API users to make use of this without introducing a new API version every time.
81+
82+
REST endpoints and the overarching structure of webhook deliveries will never have any breaking changes under v2 but compatibility dates allow our datamodel to have such.
83+
84+
A compatibility date always follows the format `YYYY-MM-DD` and should generally be set to the date you start working on your API integration.
85+
Avoid picking dates in the past as documentation might not reflect older data models.
86+
While possible, never pick compatibilty dates from the future as this always delivers data in the most up to date format, which is usually not what you want as breaking changes can be introduced any moment this way.
87+
88+
While the REST API and Webhooks handle setting/configuring the compatibility date differently, the data retrieved will always be in the same format for the same compatibility date, regardless of the interface it is accessed through.
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
# Usage & Auth
1+
# Rest API
22

33
::alert{type="info"}
44
If you are on the free tier and do not have access to the REST Api you can skip this page.
55
::
66

7-
## Base Url
7+
## Base Url & Auth
88

99
All endpoints are available on `https://api.freestuffbot.xyz/v2`
1010

11+
You should already have an API key. If not please check out the [Getting Started](/introduction/getting-started) page.
1112

12-
## Auth
13+
Your API key should be present in the `Authorization` header on every request to the API.
14+
Prefix your API key with the word `Basic`.
1315

14-
You should already have an API key. If not please check out the [Getting Started](/introduction/getting-started) page.
16+
> Assuming your API key is "ABCDEFGHIJKLMNOPQRSTUVWXYZ", this is how your header should look like:\
17+
> `Authorization: Basic ABCDEFGHIJKLMNOPQRSTUVWXYZ`
18+
19+
20+
## List of endpoints
21+
22+
:endpoint{name="get-ping"}
1523

16-
Your API key should be present in the `Authorization` header on every request to the API. Prefix your API key with the word `Basic` as your access is of type basic.
24+
:endpoint{name="get-products"}
1725

18-
So assuming your API key is "ABCDEFGHIJKLMNOPQRSTUVWXYZ", this is how your header should look like:
19-
`Authorization: Basic ABCDEFGHIJKLMNOPQRSTUVWXYZ`
26+
:endpoint{name="get-products-id"}
2027

content/3.api-v2/4.endpoints.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
File renamed without changes.

content/4.libraries/2.golang.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

data/api-v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
],
265265
"responses": [
266266
{
267-
"code": 200,
267+
"code": 204,
268268
"desc": "Success",
269269
"returns": {
270270
"body": "@",

nuxt.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export default defineNuxtConfig({
22
// https://github.com/nuxt-themes/docus
33
extends: '@nuxt-themes/docus',
4+
45
// devtools: { enabled: true },
56

67
typescript: {
@@ -10,9 +11,12 @@ export default defineNuxtConfig({
1011
}
1112
}
1213
},
14+
1315
modules: [
1416
// Remove it if you don't use Plausible analytics
1517
// https://github.com/nuxt-modules/plausible
1618
// '@nuxtjs/plausible'
17-
]
18-
})
19+
],
20+
21+
compatibilityDate: '2025-05-05'
22+
})

0 commit comments

Comments
 (0)