Created
October 22, 2019 06:04
-
-
Save Miura55/5ac097e7f577ee07f676bac518011749 to your computer and use it in GitHub Desktop.
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
# | |
# | |
# main() will be run when you invoke this action | |
# | |
# @param Cloud Functions actions accept a single parameter, which must be a JSON object. | |
# | |
# @return The output of this action, which must be a JSON object. | |
# | |
# | |
import sys | |
import json | |
import requests | |
def main(dict): | |
# set Value | |
access_token = dict["ACCESS_TOKEN"] | |
url = 'https://notify-api.line.me/api/notify' | |
headers = { | |
'Authorization': 'Bearer {}'.format(access_token), | |
} | |
payload = { | |
'message': 'Hello World', | |
} | |
# request Notify | |
response = requests.post(url, headers=headers, params=payload) | |
res = json.loads(response.text) | |
print(res) | |
return { 'message': res["message"] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment