Skip to content

Commit 8a522b9

Browse files
committed
[updated] Readme and bumped version
1 parent 758fc04 commit 8a522b9

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,17 @@ pip install glean-requests
1212

1313
### REST API Client
1414

15+
For more information on the REST API, see the [Glean documentation](https://developers.glean.com/client/overview/#section/Introduction).
16+
1517
```python
1618
from glean_requests import GleanRestClient
1719

1820
# Initialize the client
19-
# https://developers.glean.com/client/overview/#section/Introduction
2021
client = GleanRestClient(
2122
api_token="your_api_token",
2223
subdomain="your_subdomain",
23-
act_as="optional_user_to_act_as", # Optional
24-
auth_type="OAUTH" # Optional
2524
)
2625

27-
# Make a POST request
2826
# Example Search
2927
# https://developers.glean.com/client/operation/search/
3028
payload = { "query": "your_query" }
@@ -33,31 +31,42 @@ response = client.post("search", json=payload)
3331

3432
### Indexing API Client
3533

34+
For more information on the Indexing API, see the [Glean documentation](https://developers.glean.com/docs/indexing_api/indexing_api_getting_started/).
35+
3636
```python
3737
from glean_requests import GleanIndexingClient
3838

3939
# Initialize the client
40-
# https://developers.glean.com/docs/indexing_api/indexing_api_getting_started/
4140
client = GleanIndexingClient(
4241
api_token="your_api_token",
4342
subdomain="your_subdomain",
44-
act_as="optional_user_to_act_as", # Optional
45-
auth_type="OAUTH" # Optional
4643
)
4744

48-
# Make API requests
4945
# Example Get Datasource Configuration
5046
# https://developers.glean.com/indexing/tag/Datasources/paths/~1getdatasourceconfig/post/
5147
payload = {"datasource": "testing"}
5248
response = client.post("getdatasourceconfig", json=payload)
5349
```
5450

51+
### Authentication
52+
53+
For more information on Authentication, see the [Glean documentation](https://developers.glean.com/docs/client_api/client_api_scopes/).
54+
55+
```python
56+
client = GleanRestClient(
57+
api_token="your_api_token",
58+
subdomain="your_subdomain",
59+
act_as="optional_user_to_act_as", # For Global Tokens
60+
auth_type="OAUTH" # Optional
61+
)
62+
```
63+
5564
## Features
5665

5766
- Simple interface for making authenticated requests to Glean's API endpoints
5867
- Support for both REST and Indexing APIs
59-
- Automatic handling of authentication and session management
60-
- Support for acting as another user
68+
- Automatic handling of authentication headers and urls
69+
- Support for [global tokens](https://developers.glean.com/docs/client_api/client_api_scopes/#global)
6170

6271
## License
6372

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "glean-requests"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
description = "A minimal wrapper of the requests library for Glean's API"
55
readme = "README.md"
66
requires-python = ">=3.8"

0 commit comments

Comments
 (0)