Skip to main content

Python library for the Sertiva Web API

Project description

Sertipy

Python library for the Sertiva Web API

Instalation

pip install sertipy

or upgrade

pip install sertipy --upgrade

Quick Start

To get started, install sertipy and create an account on Sertiva. Add your client ID and client SECRET to your environment:

User authentication

# import library or package sertipy
from sertipy.client import Sertiva

# make obj client sertiva
sertiva = Sertiva(client_id='<your_client_id>', client_secret='<your_client_secret>')

Feature

Sertipy supports all of the features of the Sertiva Web API including access to all end points, and support for user authorization. For details on the capabilities check Sertiva Web API

Designs

# to get list designs
sertiva.designs.list()

# to get detail design
sertiva.designs.detail('<design_id>')

Templates

# to get list templates
sertiva.templates.list()

# to get detail template
sertiva.templates.detail('<template_id>')

# create new template
sertiva.templates.create('<design_id>', '<title>', '<description>')

# update template
sertiva.templates.update('<template_id>', '<title>', '<description>')

Recipients

# to get list draft recipients
sertiva.recipients.list('<template_id>')

# create new draft recipient
data_create = [
    {
        "name": "John Doe",
        "email": "john@doe.com",
        "fields": {
            "credentialSubject": {
                "activityDate": "2021-05-01T19:23:24.000000"
            }
        }
    },
]

sertiva.recipients.create('<template_id>', data_create)

# update draft recipient
data_update = [
    {
        "id": "72150eae-b469-4fbf-9b02-226075a9cf10",
        "phone": "0898989898989",
        "fields": {
            "credentialSubject": {
                "credentialNumber": "ID/1/1000"
            }
        }
    },
]

sertiva.recipients.update('<template_id>', data_update)

# delete recipient
data_delete = ['72150eae-b469-4fbf-9b02-226075a9cf10']

sertiva.recipients.delete('<template_id>', data_delete)

Credentials

# get list all credentials
sertiva.credentials.list()

# get detail some credential
sertiva.credentials.detail('<credential_id>')

Main

Issue using data recipients in draft

# with all data in draft
sertiva.mains.issue('<template_id>', '<issuance_date>', '<expiration_date>')

# with recipient ids
recipient_ids = ['6ad5c6e0-9ac7-488b-b05f-d8b32b73b4cf']

sertiva.mains.issue('<template_id>', '<issuance_date>', '<expiration_date>', recipient_ids)

Issue Using data recipients directly (without make draft recipient)

recipients = [{
    "id": "72150eae-b469-4fbf-9b02-226075a9cf10",
    "name": "John Doe",
    "email": "john@doe.com",
    "fields": {
        "credentialSubject": {
            "credentialNumber": "ID/1/1000",
            "activityDate": "2021-05-01T19:23:24.000000"
        }
    }
},]
sertiva.mains.issue('<template_id>', '<issuance_date>', '<expiration_date>', recipients)
  • for data id you can make with uuid

Verify and Revoke

# verify credential
data_to_verify = ['72150eae-b469-4fbf-9b02-226075a9cf10']

sertiva.mains.verify(data_to_verify)

# revoke credential
data_to_revoke = ['72150eae-b469-4fbf-9b02-226075a9cf10']
reason = 'wrong certificate'

sertiva.mains.revoke(data_to_revoke, reason)

Reporting Issues

If you have suggestions, bugs or other issues specific to this library, file them here. Or just send a pull request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sertipy-1.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

sertipy-1.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file sertipy-1.1.0.tar.gz.

File metadata

  • Download URL: sertipy-1.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8

File hashes

Hashes for sertipy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5d49c439a618a9be7781531f4408707896ff74ae1f16de6f52ad24e69bf0bf66
MD5 48f21e1bb6d07c2ddbf3696f2d351b3c
BLAKE2b-256 2b2f89614e59ac5ce9a0151348477f6bdf5051b9b4ac24ed36edc3ca0fd5b96d

See more details on using hashes here.

File details

Details for the file sertipy-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: sertipy-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8

File hashes

Hashes for sertipy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff993373dd16e3cf9078b450349b219cb1c47bb3e7045fa817971d8c81afa696
MD5 02ea1bf33e8b44b9e65d4fb9eeb73ad0
BLAKE2b-256 c95a4a33efbb309f1f9541c03b56e07e1cdd3a0353669a9ac044d33aafa9b119

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page