LoginSignup
24
23

More than 5 years have passed since last update.

Cybozu ガルーン API を使ってみる

Last updated at Posted at 2014-06-17

WSDLの取得

https://developers.cybozu.com/ja/garoon-api/common-soapapi.html
に書いている

Garoon on cybozu.com: https://(サブドメイン名).cybozu.com/g/index.csp?WSDL
パッケージ版 Windows 環境:http://(インストールしたサーバーの IP アドレスまたはホスト名)/scripts/(インストール識別子)/grn.exe?WSDL
パッケージ版 Linux 環境:http://(インストールしたサーバーの IP アドレスまたはホスト名)/cgi-bin/(インストール識別子)/grn.cgi?WSDL

等で取得できる

golangでsoap

WSDLが取得できたので早速golangで叩いてみようとおもい
SOAPの実装を探してみたが、なかった。
みんな自分XML組み立ててやれって書いてるような気がする。

自分で叩いてみる

ChromeのAdvanced Rest Clinetを使って生でたたいてみることにした。

URL

https://ホスト名/インストールパス/grn.cgi/cbpapi/schedule/api?

リクエストPayload

<?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">
      ScheduleGetEvents
    </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>xxxxxxxxxx</Username>
        <Password>xxxxxxxxxx</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>
    <ScheduleGetEvents>
<parameters start="2014-01-01T08:00:00" end="2014-01-30T20:00:00" > 
</parameters>
    </ScheduleGetEvents>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

レスポンス

<?xml version="1.0" encoding="utf-8" ?>
 <soap:Envelope>
 <soap:Header>
<vendor>Cybozu</vendor>
<product>Garoon</product>
<product_type>1</product_type>
<version>3.7.2</version>
<apiversion>1.3.0</apiversion>
 </soap:Header>
<soap:Body>
<schedule:ScheduleGetEventsResponse>
<returns>
<schedule_event id="3451422" event_type="repeat" public_type="public" plan="打合せ" ・・・・





でた。
今日はここまで・・

24
23
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
23