mémorandum.
Obtenez des informations utilisateur de l'API Garoon SOAP avec Python + Zeep https://qiita.com/yamashi6/items/d360546eb4ccf2495951
Spécifications communes de l'API Garoon SOAP https://developer.cybozu.io/hc/ja/articles/202228464
Rechercher des rendez-vous https://developer.cybozu.io/hc/ja/articles/202235474
from zeep import Client
from zeep import xsd
client = Client(wsdl='https://(Nom du sous-domaine).cybozu.com/g/index.csp?WSDL')
#Vous ne pouvez pas utiliser l'acquisition programmée sauf si vous liez
sc_client = client.bind('ScheduleService', 'SchedulePort')
header = xsd.ComplexType([
xsd.Element('Action', xsd.String()),
xsd.Element('Security',
xsd.ComplexType([xsd.Element(
'UsernameToken',
xsd.ComplexType([
xsd.Element('Username', xsd.String()),
xsd.Element('Password', xsd.String()),
])
)]
)),
xsd.Element('Timestamp',
xsd.ComplexType([
xsd.Element('Created', xsd.String()),
xsd.Element('Expires', xsd.String()),
])
),
xsd.Element('Locale', xsd.String()),
])
header_value = header(
Action="ScheduleSearchEvents",
#Changer les utilisateurs et les mots de passe
Security={'UsernameToken':{'Username':'','Password':''}},
Timestamp={'Created':'2010-08-12T14:45:00Z','Expires':'2037-08-12T14:45:00Z'},
Locale="jp")
#Cette façon d'écrire est également OK
# header_value = header("ScheduleSearchEvents",
# {'UsernameToken':{'Username':'', 'Password':''}},
# {'Created':'2010-08-12T14:45:00Z','Expires':'2037-08-12T14:45:00Z'},
# 'jp')
request = xsd.Element('parameters',
xsd.ComplexType([
xsd.Attribute('text', xsd.String()),
xsd.Attribute('start', xsd.String()),
xsd.Attribute('end', xsd.String()),
xsd.Attribute('title_search', xsd.Boolean()),
xsd.Attribute('customer_search', xsd.Boolean()),
xsd.Attribute('memo_search', xsd.Boolean()),
xsd.Attribute('follow_search', xsd.Boolean()),
xsd.Attribute('all_repeat_events', xsd.Boolean())])
)
request_data = request("test","2019-06-06T02:00:00Z", "2019-07-07T02:00:00Z", True, False, False, False, False)
#Cette façon d'écrire est également OK
# request_data = request(
# text='test',
# start= "2019-06-06T02:00:00Z",
# end="2019-10-07T02:00:00Z",
# title_search= True,
# customer_search=False,
# memo_search=False,
# follow_search=False,
# all_repeat_events=False
# )
try:
response = sc_client.ScheduleSearchEvents(request_data, _soapheaders=[header_value])
#Retourné dans la liste
print(response)
except:
import traceback
traceback.print_exc()
Retourné dans la liste
[{
'members': {
'member': [
{
'user': {
'id': '1',
'order': 0,
'_attr_1': {
'name': 'Yamada Taro'
}
},
'organization': None,
'facility': None,
'_value_1': None,
'_attr_1': None
}
],
'_value_1': None,
'_attr_1': None
},
'observers': None,
'customer': None,
'repeat_info': None,
'when': {
'_attr_1': None,
'datetime': [
{
'_value_1': None,
'start': datetime.datetime(2019, 6, 20, 10, 0, tzinfo=<isodate.tzinfo.Utc object at 0x000001B4773B0F08>),
'end': datetime.datetime(2019, 6, 20, 12, 0, tzinfo=<isodate.tzinfo.Utc object at 0x000001B4773B0F08>),
'facility_id': None,
'_attr_1': {
}
}
],
'date': None
},
'follows': None,
'file': [],
'remove_file_id': [],
'_value_1': None,
'id': '11111',
'event_type': 'normal',
'version': '111111111',
'public_type': 'public',
'plan': 'Réunion',
'detail': 'test',
'description': 'test',
'timezone': 'Asia/Tokyo',
'end_timezone': 'Asia/Tokyo',
'allday': False,
'start_only': False,
'hidden_private': None,
'facility_using_purpose': None,
'_attr_1': {
}
}]
Recommended Posts