This time, I made an app with a field code called "Text1".
Write the data "abcde".
#!/usr/bin/python
# _*_ coding: utf-8 _*_
import requests
URL = "https://◯◯◯◯.cybozu.com:443" # URL
APP_ID = "APP ID" #kintone app ID
API_TOKEN = "API TOKEN" #kintone API token
class KINTONE:
def PostToKintone(self, url, appId, apiToken):
#KINTONE field code: Text1
record={'Text1':{'value' : 'abcde'}} #Field code and data to write
data = {'app':appId,'record':record}
headers = {"X-Cybozu-API-Token": apiToken, "Content-Type" : "application/json"}
resp=requests.post(url+'/k/v1/record.json',json=data,headers=headers)
return resp
if __name__ == '__main__':
knt=KINTONE()
resp=knt.PostToKintone(URL, APP_ID, API_TOKEN)
print resp.text
The output is
{"id":"1","revision":"1"}
I felt happy next to me.
Recommended Posts