pescheck-client 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +39 -1
- data/lib/pescheck-client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 243d140166fd9c39d585cd5d3eee97ee6e26f2a45dec15a90f7044a99a08d614
|
|
4
|
+
data.tar.gz: 68fbc0e037ce4742db376d028459cfc3018ea6a6b2b90d0c100971fdbda0949d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1065e3ace53d9fa575148223cd67320620f1f4fd07126f00eb71781afcdc86fd7a178a7fa4713548f088b2d53d76591a32fac72cb95b99fa262c5958123e116c
|
|
7
|
+
data.tar.gz: 4f094bdf5518b7876f6e5ba5899983452ae31097ac3d927135182dfa956a68f68dbb1732d31729e8f4c49ea151bd2ef7c48fbb190813d14d365170f853eebb3e
|
data/README.md
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
> **Official Pescheck API client** - part of the [pescheck-clients](https://github.com/pescheckit/pescheck-clients) SDKs.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- pescheck-quickstart:start (generated by scripts/postprocess.mjs) -->
|
|
4
|
+
|
|
5
|
+
## Quickstart
|
|
6
|
+
|
|
7
|
+
**1. Get API credentials.** Create a test account at [dashboard-staging.pescheck.io](https://dashboard-staging.pescheck.io/). In the dashboard, enable the **API & MCP Access** add-on (*Settings → Add-ons*), then create an app under *Development → Add app*. You get a client ID and a client secret.
|
|
8
|
+
|
|
9
|
+
**2. Get an access token** from the environment you want to use (staging while you integrate):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
curl -X POST https://api-staging.pescheck.io/api/o/token/ \
|
|
13
|
+
-d grant_type=client_credentials \
|
|
14
|
+
-d client_id=YOUR_CLIENT_ID \
|
|
15
|
+
-d client_secret=YOUR_CLIENT_SECRET
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Copy the `access_token` from the response (it is valid for one hour), and point the client at the same environment:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
export PESCHECK_BASE_URL=https://api-staging.pescheck.io
|
|
22
|
+
export PESCHECK_ACCESS_TOKEN=paste-the-access-token-here
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**3. Make your first call:**
|
|
26
|
+
|
|
27
|
+
```ruby
|
|
28
|
+
require 'pescheck-client'
|
|
29
|
+
|
|
30
|
+
config = Pescheck::Configuration.new # host from PESCHECK_BASE_URL
|
|
31
|
+
config.access_token = ENV.fetch('PESCHECK_ACCESS_TOKEN')
|
|
32
|
+
|
|
33
|
+
checks = Pescheck::ChecksApi.new(Pescheck::ApiClient.new(config)).v2_checks_list
|
|
34
|
+
puts "#{checks.length} check types available"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**4. Go live.** Use your production credentials and request the token from `https://api.pescheck.io/api/o/token/`. Then unset `PESCHECK_BASE_URL`: the client uses production by default. Your code does not change.
|
|
38
|
+
|
|
39
|
+
Setting the host in code (as some examples below do) overrides `PESCHECK_BASE_URL`.
|
|
40
|
+
|
|
41
|
+
<!-- pescheck-quickstart:end -->
|
|
4
42
|
|
|
5
43
|
# pescheck-client
|
|
6
44
|
|