-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from kebe7jun/master
+ add subscription api.
- Loading branch information
Showing
4 changed files
with
35 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env python | ||
# coding=utf-8 | ||
# Created by kebe | ||
|
||
from base_service import BaseService | ||
from daovoice import models | ||
from daovoice.api_operations import SimpleAll, Save, Get | ||
|
||
|
||
class Subscription(BaseService, SimpleAll, Save, Get): | ||
@property | ||
def resource_class(self): | ||
return models.Subscription | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import os | ||
from daovoice.client import Client | ||
|
||
# init client | ||
|
||
client = Client(base_url="http://api.daovoice.co/v1", | ||
token="EF802AE9611FD09B0F8B3BBFA13703A6061E20A9D5D68A36689845108D7D71C3") | ||
client = Client(token=os.getenv('TOKEN', '')) | ||
|
||
# get conversation | ||
|
||
conversation = client.conversations.get(id="0204274f-0e61-4c15-a794-9e950aca0eb0") | ||
conversation = client.conversations.get(id="11678500-4f3f-4ca3-a322-c5ced27d77f3") | ||
|
||
print conversation.conversation_parts | ||
print conversation.conversation_message | ||
|
@@ -20,8 +20,13 @@ | |
for ad in admins: | ||
print ad.name | ||
|
||
subscriptions = client.subscriptions.all() | ||
|
||
for sub in subscriptions: | ||
print sub.subscription_id | ||
|
||
# reply conversation | ||
client.conversations.reply(id="0204274f-0e61-4c15-a794-9e950aca0eb0", admin_id=admins[0].admin_id, body="hello") | ||
client.conversations.reply(id="11678500-4f3f-4ca3-a322-c5ced27d77f3", admin_id=admins[0].admin_id, body="hello") | ||
|
||
# create user | ||
print client.user.create(user_id="test_134", name="example", email="[email protected]") |