API Repository for Static Pages Client
Install using your favourite package manager
pip install static_pages_client
Name | Type | Description |
---|---|---|
set_host | function | Set client host |
set_silent | function | Silence errors |
set_api_key | function | Set client api key |
set_authorization | function | Set client authorization token |
make_application | function | Create a static pages application |
make_application_user | function | Create a static pages application user or users |
make_application_user_token | function | Create an application user authorization token |
requester | function | Static api caller |
v1 | function | Exposes v1 caller api methods |
v2 | function | Exposes v2 caller api method |
static = StaticAPI(host='domain/api/')
static.make_application()
hash
equals to X-API-Key
header
static.set_api_key(key='hash')
static.make_application_user(users=[{
'email': '[email protected]',
}])
static.make_application_user(user={
'email': '[email protected]',
})
token = static.make_application_user_token(email='[email protected]', secret='super')
Or use the settings
property in application to setup secret
and use tokens from your own main service
static.set_authorization(token=token)
static.v1(method='get', endpoint='article/')
static.v2(method='post', endpoint='job/', data={'i18n': {'ro': {'title': 'Static'}}})