pandadocs package

Submodules

pandadocs.api module

class pandadocs.api.Session(*args, **kwargs)[source]

Bases: requests_oauthlib.oauth2_session.OAuth2Session

Pass in the client_id and token dict to get an authenticated connection. For server-side flows, use the pandadocs-tokentool to get the token dict. Otherwise, you will need to authorize the user, and fetch a token at runtime using the authorization_url and fetch_token methods.

Here’s an example of a token dict:

token = {
    u'access_token': u'54be934eb3fdf031ccadd2406f2',
    u'expires_at': 1499753835.037497,
    u'expires_in': 31535999,
    u'refresh_token': u'2c1dd5a32d0aff0298c3b2214',
    u'scope': [u'read', u'write', u'read+write'],
    u'token_type': u'Bearer'
}
Parameters:
  • client_id (str) – the client ID from your application
  • token (dict) – the token dict with the access token
authorization_url(*args, **kwargs)[source]
create_document(data)[source]

Creat document from a template or file

Parameters:
  • id (str) – the template UUID
  • data (dict) – data to fill within the document
create_session(id, email, lifetime=300)[source]

Create session for a document

Parameters:
  • id (str) – the document UUID
  • email (str) – recipient’s email address
  • lifetime (int) – in seconds (default 300s)
download_document(id)[source]

Download a document

Parameters:id (str) – the document UUID
fetch_token(*args, **kwargs)[source]
get_document(id)[source]

Get document details

Parameters:id (str) – the document UUID
get_session(data, email)[source]

Get session details for a document

get_template(id)[source]

Get detailed information about a specific template

Parameters:id (str) – the template UUID
get_templates(page=None)[source]

Get a list of templates accessible to the currently authorized user. The results are paged, so you will only receive the first page by default.

Parameters:page (int) – an optional integer indicating the page you want to retrieve
iter_templates()[source]

Helper generator to iterate over all templates accessible to the user

iter_templates_pages()[source]

Helper generator to iterate over all pages of the list of templates

send_document(id, message='', silent=True)[source]

Send a document to a user

Parameters:
  • id (str) – the document UUID
  • message (str) – message to send to the recipient
  • silent (boolean) – if True, does not send an email; instead puts the document into sent state. This is useful if the document will be signed in an iframe session

Module contents