Skip to content

settrade/stt-openapi-signer-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Settrade OpenAPI parameters signer

https://travis-ci.org/settrade/stt-openapi-signer-python.svg?branch=master

Overview

Website: Settrade OpenAPI.

Related API: Login by APP.

Installation

pip install -U git+https://github.com/settrade/stt-openapi-signer-python

Usage

Python Example:

from stt.openapi.signer import sign
import requests

# STT Open API Parameters
broker_id = '0XX' # Broker ID
app_code = '<you_service_code>'
api_key = '<your_api_key>'
api_secret = '<your_api_secret>'
params = ''

# Sign it
signature, timestamp = sign(api_key, api_secret, params)

# Use it
url = 'https://open-api.settrade.com/api/oam/v1/{}/broker-apps/{}/login'.format(broker_id, app_code)
resp = requests.post(url, json={
    "apiKey": api_key,
    "params": params,
    "signature": signature,
    "timestamp": timestamp
}

CLI:

python -m stt.openapi.signer "<your_api_key>" "<your_api_secret>" "<your_params>" [<your_timestamp>]

CLI Example:

$ python -m stt.openapi.signer key1 "AIKi/X7lvfu0haz0SttdbCj+nXmWBt/jfrbPAHRjwNHq" ""
$ 3045022041e4ffdf2ccb366b00a7b1c8983a39a71065c1506d696afa3701a61328d2fe860221009075dd373cd35ce14c610eb9a7ba7f84ff84f4848cde237debefddc300dca0fe 1588137026555

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages