Skip to content

Commit ad2d042

Browse files
author
Dmitry
committed
Update README.md
1 parent a64b44d commit ad2d042

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

README.md

+24-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,28 @@
22
Python class for use esputnik
33

44
```
5-
sputnik = ApiEsputnik()
6-
sputnik.info()
7-
sputnik.add_contact(email="[email protected]")
8-
sputnik.remove_contact(id=90000000)
9-
sputnik.get_contact(id=90000000)
10-
sputnik.update_contact(id=90000000, email="[email protected]", first_name="test")
5+
api = eSputnik()
6+
7+
api.balance()
8+
# {'status_code': 200, 'result': u'{"currentBalance":"0.0","creditLimit":"0.0","currency":"UAH","bonusEmails":"2500","bonusSmses":"10"}'}
9+
10+
api.addressbooks()
11+
# {'status_code': 200, 'result': u'{"addressBook":{"addressBookId":"8550","name":"\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439","fieldGroups":{"name":"Personal","fields":[{"id":"18884","name":"\u0414\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f","description":{"required":"false","readonly":"false"}},{"id":"18885","name":"\u041f\u043e\u043b","description":{"allowedValues":{"possibleValues":["\u043c","\u0436"]},"required":"false","readonly":"false"}}]}}}'}
12+
13+
api.info()
14+
# {'status_code': 200, 'result': u'{"version":"20417","protocolVersion":"1.0"}'}
15+
16+
info = {"email": "[email protected]", "first_name": "first_name", "group": "test"}
17+
api.add_contact(info)
18+
# {'status_code': 200, 'result': u'{"id":"95064156"}'}
19+
20+
api.remove_contact(id=95064156)
21+
# {'status_code': 200, 'result': u"Contact with id='95064156' has been deleted"}
22+
23+
api.get_contact(id=95064060)
24+
# {'status_code': 200, 'result': u'{"firstName":"first_name","channels":[{"type":"email","value":"[email protected]"}],"addressBookId":8585,"id":95064060,"groups":[{"id":3601264,"name":"test","type":"Static"}]}'}
25+
26+
api.update_contact(95064060, info)
27+
# Contact with id='95064060' has been updated
28+
1129
```

0 commit comments

Comments
 (0)