S
S
SJ2272017-08-05 13:29:26
API
SJ227, 2017-08-05 13:29:26

Authorization via QIWI API token?

I'm reading the documentation developer.qiwi.com/qiwiwallet/
And I can't figure out how to authorize using a token
. Are there any examples? php/python
Poke your nose please
On the github I found a ready-made library for working with the kiwi api, but the documentation is in English and nothing is clear ..

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
d_garmashev, 2017-08-14
@d_garmashev

Requests for Python is a good solution.
The token must be passed in the header. Sample code for Python 3, how to get the balance status of a token:

import requests
import json

api_access_token = '' # токен можно получить здесь https://qiwi.com/api

s = requests.Session()
#s.headers['Accept']= 'application/json'
s.headers['authorization'] = 'Bearer ' + api_access_token  
b = s.get('https://edge.qiwi.com/funding-sources/v1/accounts/current')
print(json.loads(b.text))

What is what in the method return can be read here https://developer.qiwi.com/qiwiwallet/qiwicom_ru.h...

A
Andrew_L, 2017-08-11
@Andrew_L

In general, I searched a lot, but could not find good examples. Therefore, I decided to do everything through the request library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question