Skip to content

postzen-dev/postzen-python

Repository files navigation

postzen-python

The PostZen Public API lets server-side integrations manage profiles, connected social accounts, OAuth connection flows, media uploads, and post creation.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Generator version: 7.23.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.10+

Installation & Usage

pip install

pip install postzen-sdk

Then import the package:

import postzen

From source

pip install git+https://github.com/postzen-dev/postzen-python.git

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import postzen
from postzen.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.postzen.dev
# See configuration.py for a list of all supported configuration parameters.
configuration = postzen.Configuration(
    host = "https://api.postzen.dev"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = postzen.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with postzen.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = postzen.AccountsApi(api_client)
    account_id = 'account_id_example' # str | PostZen account id.

    try:
        # Disconnect an account
        api_response = api_instance.disconnect_account(account_id)
        print("The response of AccountsApi->disconnect_account:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AccountsApi->disconnect_account: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.postzen.dev

Class Method HTTP request Description
AccountsApi disconnect_account DELETE /v1/accounts/{accountId} Disconnect an account
AccountsApi list_accounts GET /v1/accounts List accounts
ConnectApi complete_connect POST /v1/connect/{platform} Complete an OAuth connection
ConnectApi create_connect_url GET /v1/connect/{platform} Create an OAuth connect URL
MediaApi create_media_presign POST /v1/media/presign Create a presigned media upload URL
PostsApi create_post POST /v1/posts Create a post
ProfilesApi create_profile POST /v1/profiles Create a profile
ProfilesApi delete_profile DELETE /v1/profiles/{profileId} Delete a profile
ProfilesApi get_profile GET /v1/profiles/{profileId} Get a profile
ProfilesApi list_profiles GET /v1/profiles List profiles
ProfilesApi update_profile PUT /v1/profiles/{profileId} Update a profile

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication

Author

About

PostZen's Official Python SDK

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors