Unofficial AuthRocket API client
Project description
Unofficial AuthRocket API client. Extends the Requests library, provides a few helper functions.
See also
The Requests documentation.
Making a request
import authrocket
# Create an API object.
# Config values can be found on your realm's integration page.
api = authrocket.API(
url="https://api-e1.authrocket.com/v1/",
key="ko_XYZ", # Must start with `ko_`, rather than old-style `key_`
realm_id="rl_ABC"
)
# Fetch the first page of users.
response = api.get("users")
print response.json()
Pagination
Use iter_from_pages to handle paginated responses:
for user in api.iter_from_pages("GET", "users"):
print user
Path variables
Some APIs take variables via the path, e.g “users/123”. Rather than use string interpolation, you should pass these via the variables argument - it’s more secure. For example:
response = api.get("user/{id}", variables={"id": "123"})
print response.json()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
authrocket-0.1.1.tar.gz
(3.1 kB
view details)
File details
Details for the file authrocket-0.1.1.tar.gz
.
File metadata
- Download URL: authrocket-0.1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50b20bb7e5693295e9e7fdbc7364a4449c127b733ce9aa95538ac7d43108dac4 |
|
MD5 | 14667e3f07190b11f96c98b48d32cff4 |
|
BLAKE2b-256 | e3b2173a24903bc3bf926ffbb507015a953cf4aa8b47020d613b57d8d13ef360 |