Git Product home page Git Product logo

eskiz-pkg's Introduction

Integration Eskiz SMS API with Python | SMS Service

Sourcode and Resources for Eskiz & Python


Support Telegram - http://t.me/Muhammadalive
Documentation & More https://documenter.getpostman.com/view/663428/RzfmES4z?version=latest


Getting started

There are two ways to install the library:

  • Installation using pip (a Python package manager):
$ pip install eskiz-pkg
  • Installation from source (requires git):
$ git clone https://github.com/Muhammadali-Akbarov/eskiz-pkg
$ cd eskiz-pkg
$ python setup.py install

or:

$ pip install git+https://github.com/Muhammadali-Akbarov/eskiz-pkg

Library Structure

└── eskiz
    β”œβ”€β”€ client.py
    └── __init__.py

Credentials

URL: https://notify.eskiz.uz/api/
Email: [email protected]
Password: j6DWtQjjpLDNjWEk74Sx

Doc

Auth

Example for auth get token:

Request

from pprint import pprint

from eskiz.client import SMSClient


client = SMSClient(
    api_url="https://notify.eskiz.uz/api/",
    email="[email protected]",
    password="j6DWtQjjpLDNjWEk74Sx",
)

resp = client._auth()
pprint(resp)

Response

{
    "message": "token_generated",
    "data": {
      "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjUwOCwicm9sZSI6InVzZXIiLCJkYXRhIjp7ImlkIjo1MDgsIm5hbWUiOiJPT08gU01BUlQgUklWT0pMQU5JU0ggTUFSS0FaSSIsImVtYWlsIjoiYXRhZGppdGRpbm92QGdtYWlsLmNvbSIsInJvbGUiOiJ1c2VyIiwiYXBpX3Rva2VuIjoiZXlKMGVYQWlPaUpLVjFRaUxDSmhiR2NpT2lKSVV6STFOaUo5LmV5SnpkV0lpT2pVd09Dd2ljbTlzWlNJNkluVnpaWElpTENKa1lYUmhJanA3SW1sa0lqbzFNRGdzSW01aGJXVWlPaUpQVDA4Z1UwMUJVbFFnVWtsV1QwcE1RVTVKVTBnZ1RVRlNTMEZhU1NJc0ltVnRZV2xzSWpvaVlYUmhaR3BwZEdScGJtOTJRR2R0WVdsc0xtTnZiU0lzSW5KdmJHVWlPaUoxYzJWeUlpd2lZWEJwWDNSdmEyVnVJam9pWlhsS01HVllRV2xQYVVwTFZqRlJhVXhEU21oaVIyIiwic3RhdHVzIjoiYWN0aXZlIiwic21zX2FwaV9sb2dpbiI6ImVza2l6MiIsInNtc19hcGlfcGFzc3dvcmQiOiJlJCRrIXoiLCJ1el9wcmljZSI6NTAsInVjZWxsX3ByaWNlIjo1MCwiYmFsYW5jZSI6ODgxMjUsImlzX3ZpcCI6MCwiaG9zdCI6InNlcnZlcjEiLCJjcmVhdGVkX2F0IjoiMjAyMS0wNS0wOVQxMjo0NzoxNi4wMDAwMDBaIiwidXBkYXRlZF9hdCI6IjIwMjItMDktMjFUMTQ6MzA6MDIuMDAwMDAwWiJ9LCJpYXQiOjE2NjM4MjM0NjAsImV4cCI6MTY2NjQxNTQ2MH0.mrqsquTf9PJ_sjVHW7J3ysHTXEZG4M67IWuXsuM75v8"
    },
    "token_type": "bearer"
}

Refresh Token

Example for refresh token:

Request

from pprint import pprint

from eskiz.client import SMSClient


client = SMSClient(
    api_url="https://notify.eskiz.uz/api/",
    email="[email protected]",
    password="j6DWtQjjpLDNjWEk74Sx",
)

resp = client._refresh_token()
pprint(resp)

Response

{'status': 'success'}

Add Contact

Example for add user info to contact list:

Request

from pprint import pprint

from eskiz.client import SMSClient


client = SMSClient(
    api_url="https://notify.eskiz.uz/api/",
    email="[email protected]",
    password="j6DWtQjjpLDNjWEk74Sx",
)

resp = client._add_sms_contact(
    first_name="Muhammadali",
    phone_number="998888351717",
    group="test"
)
pprint(resp)

Response

{
    "status": "success",
    "data": {
      "contact_id": 250812
    }
}

Send SMS

Example for send SMS:

Request

from pprint import pprint

from eskiz.client import SMSClient


client = SMSClient(
    api_url="https://notify.eskiz.uz/api/",
    email="[email protected]",
    password="j6DWtQjjpLDNjWEk74Sx",
)

resp = client._send_sms(
    phone_number="998888351717",
    message="Hello from Python❀️"
)
pprint(resp)

Response

{
    "id": "59f0e35a-2c73-4726-a232-3d4050174315",
    "status": "waiting",
    "message": "Waiting for SMS provider"
}

eskiz-pkg's People

Contributors

muhammadali-akbarov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.