Skip to content

Instantly share code, notes, and snippets.

@Miura55
Created October 22, 2019 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Miura55/5ac097e7f577ee07f676bac518011749 to your computer and use it in GitHub Desktop.
Save Miura55/5ac097e7f577ee07f676bac518011749 to your computer and use it in GitHub Desktop.
#
#
# 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