Advertisement
grodobean

KikBotAPI

Aug 14th, 2016
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.25 KB | None | 0 0
  1. import requests
  2. import json
  3. bot_name = ''
  4. bot_key = ''
  5. auth = (bot_name,bot_key)
  6. url = "https://api.kik.com/v1/message"
  7. payload = json.dumps({
  8.         'messages': [
  9.             {
  10.                 'body': 'Hello I am a bot.',
  11.                 'to': 'me',
  12.                 'type': 'text',
  13.                 'chatId': 'b3be3bc15dbe59931666c06290abd944aaa769bb2ecaaf859bfb65678880afab',
  14.                 'keyboards': [
  15.                     {
  16.                         'type':'suggested',
  17.                         'responses':[
  18.                             {
  19.                                 'type':'text',
  20.                                 'body':'You are cool.'
  21.                             },
  22.                             {
  23.                                 'type':'text',
  24.                                 'body':'Add more features!'
  25.                             }
  26.                         ]
  27.                     }
  28.                 ]
  29.             }
  30.         ]
  31.     })
  32. headers = {
  33.     'content-type': "application/json",
  34.     'cache-control': "no-cache",
  35.     'postman-token': "578a7919-aa6e-2ced-65cc-32a763069bef"
  36.     }
  37. body = {
  38.     "features":{}
  39.     }
  40. response = requests.request("POST", auth=auth, url=url, data=payload, headers=headers)
  41.  
  42. print(response.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement