1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Update typetalk.py to use com domain (#46045)

Typetalk now uses "com" domain.
FYI: https://www.typetalk.com/blog/typetalk-gets-new-top-level-domain-typetalk-com/

+label: docsite_pr
This commit is contained in:
Horie Issei 2018-09-25 06:42:06 +09:00 committed by Alicia Cozine
parent 86e8d21667
commit d8d4be40b0

View file

@ -19,7 +19,7 @@ module: typetalk
version_added: "1.6" version_added: "1.6"
short_description: Send a message to typetalk short_description: Send a message to typetalk
description: description:
- Send a message to typetalk using typetalk API ( http://developers.typetalk.in/ ) - Send a message to typetalk using typetalk API
options: options:
client_id: client_id:
description: description:
@ -78,7 +78,7 @@ def get_access_token(module, client_id, client_secret):
'grant_type': 'client_credentials', 'grant_type': 'client_credentials',
'scope': 'topic.post' 'scope': 'topic.post'
} }
res = do_request(module, 'https://typetalk.in/oauth2/access_token', params) res = do_request(module, 'https://typetalk.com/oauth2/access_token', params)
return json.load(res)['access_token'] return json.load(res)['access_token']
@ -88,7 +88,7 @@ def send_message(module, client_id, client_secret, topic, msg):
""" """
try: try:
access_token = get_access_token(module, client_id, client_secret) access_token = get_access_token(module, client_id, client_secret)
url = 'https://typetalk.in/api/v1/topics/%d' % topic url = 'https://typetalk.com/api/v1/topics/%d' % topic
headers = { headers = {
'Authorization': 'Bearer %s' % access_token, 'Authorization': 'Bearer %s' % access_token,
} }