Garoon APIにおける、JSESSIONIDを利用した予定登録方法について、質問させてください。
下記2つを参考に、JSESSIONIDを利用しスケジュール登録を試したのですが、うまくいきませんでした。
どのようにしたら実現できますでしょうか?
■「Cookieを用いた認証方式」
https://cybozudev.zendesk.com/hc/ja/articles/202228464-SOAP-API%E3%81%AE%E5%85%B1%E9%80%9A%E4%BB%95%E6%A7%98#step2
リクエストのBody(下記に記載)に、ID・PWを記述した場合は、予定が登録されることを確認しております。
また、「Cookieを用いた認証方式」も、サイトの例にあった「UtilGetREquestToken」の実行は動作確認できています。
しかしながら、Util APIのUtilLoginでログインして取得したJSESSIONIDを用いて、予定の登録をすることができません。
下記にリクエストとレスポンス(エラー)を記載します。
■リクエスト
・Method: POST
・URL: https://*******.cybozu.com/g/cbpapi/schedule/api?
・Header
Cookie: JSESSIONID=*************;
Content-Type: text/xml;
・Body
<?xml version=“1.0” encoding=“UTF-8”?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://www.w3.org/2003/05/soap-envelope”
xmlns:xsd=“http://www.w3.org/2001/XMLSchema”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/”
xmlns:base_services=“http://wsdl.cybozu.co.jp/base/2008”>
SOAP-ENV:Header
<Action SOAP-ENV:mustUnderstand=“1”
xmlns=“http://schemas.xmlsoap.org/ws/2003/03/addressing”>
ScheduleAddEvents
</Action>
<Security xmlns:wsu=“http://schemas.xmlsoap.org/ws/2002/07/utility”
SOAP-ENV:mustUnderstand=“1”
xmlns=“http://schemas.xmlsoap.org/ws/2002/12/secext”>
<UsernameToken wsu:Id=“id”>
<Username></Username>
<Password></Password>
</UsernameToken>
</Security>
<Timestamp SOAP-ENV:mustUnderstand=“1” Id=“id”
xmlns=“http://schemas.xmlsoap.org/ws/2002/07/utility”>
<Created>2037-08-12T14:45:00Z</Created>
<Expires>2037-08-12T14:45:00Z</Expires>
</Timestamp>
<Locale>jp</Locale>
/SOAP-ENV:Header
SOAP-ENV:Body
<ScheduleAddEvents>
<parameters>
<schedule_event
xmlns=“”
id=“dummy”
event_type=“normal”
version=“dummy”
public_type=“public”
plan=“サイボウズAPIテスト(plan)”
detail=“サイボウズAPIテスト(detail)”
description=“サイボウズAPIテスト(description)”
timezone=“Asia/Tokyo”
end_timezone=“Asia/Tokyo”
allday=“true”
start_only=“false”>
<members>
<member>
<user id=“751”></user>
</member>
</members>
<when>
<datetime start=“2015-06-11T08:00:00” end=“2015-06-11T09:00:00”></datetime>
</when>
</schedule_event>
</parameters>
</ScheduleAddEvents>
/SOAP-ENV:Body
/SOAP-ENV:Envelope
■レスポンス(エラー)
<?xml version=“1.0” encoding=“utf-8”?>
<soap:Envelope xmlns:soap=“http://www.w3.org/2003/05/soap-envelope”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:xsd=“http://www.w3.org/2001/XMLSchema”
xmlns:wsa=“http://schemas.xmlsoap.org/ws/2004/08/addressing”
xmlns:wsse=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd”
xmlns:wsu=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd”>
soap:Header<vendor>Cybozu</vendor><product>Garoon</product><product_type>2</product_type><version>4.1.0</version><apiversion>1.5.0</apiversion>/soap:Header
soap:Body
soap:Fault
soap:Code
soap:Valuesoap:Receiver/soap:Value
/soap:Code
soap:Reason
soap:Textログインできません。/soap:Text
/soap:Reason
soap:Detail
<code>FW00007</code>
<diagnosis>ログインできません。</diagnosis>
<cause>パスワードまたはログイン名に誤りがあります。</cause>
<counter_measure>パスワードまたはログイン名を確認し、再度実行してください。</counter_measure>
/soap:Detail
/soap:Fault
/soap:Body
/soap:Envelope
以上、よろしくお願いいたします。