IM-FormaDesigner for Accel Platform プログラミングガイド 第15版 2019-08-01

12.5. クライアントアプリケーションを実装する

ここでは、ワークフロー案件処理 Web APIを利用して実際にファイルアップロード・申請・承認を行うサンプルのリクエスト・レスポンス情報を紹介します。
認証方法については、Basic認証を利用します。

12.5.1. ファイルアップロード Web APIの実行

12.5.1.1. リクエスト情報

  • リクエストURI

    • basic/api/forma/imw/fileupload
  • リクエストメソッド

    • POST
  • リクエストヘッダ

    • Content-Type : multipart/form-data
    • Accept : application/json
    • Authorization : Basic dWVkYTp1ZWRh
    • X-Intramart-Session : once
  • リクエストパラメータ

    • file : ファイルデータ

12.5.1.2. レスポンス情報

  • レスポンスコード

    • 200
  • レスポンスヘッダ

    • Pragma : no-cache
    • Date : Sun, 26 Jul 2015 23:51:00 GMT
    • Cache-Control : no-store
    • Server : Resin/4.0.44
    • Content-Length : 81
    • Content-Type : application/json; charset=UTF-8
  • レスポンスボディ

{
  'error': false,
  'data': {
    'token': '5ieu48642uaowzo',
    'fileName': 'fileupload (2).js'
  }
}

12.5.2. 申請処理 Web APIの実行

12.5.2.1. リクエスト情報

  • リクエストURI

    • basic/api/forma/imw/apply
  • リクエストメソッド

    • POST
  • リクエストヘッダ

    • Content-Type : application/json
    • Accept : application/json
    • Authorization : Basic dWVkYTp1ZWRh
    • X-Intramart-Session : once
  • リクエストボディ

{
  "applyBaseDate": "2015/07/28",
  "matterName": "sample_matter",
  "applyExecuteUserCode": "aoyagi",
  "userParam": {},
  "formaUserParam": {
     "items" : {
        "textbox1" : "あいうえお"
     },
     "files": [
                 {
                     "token": "5ieu48a0fpe2hzo",
                     "fileName": "サンプルファイル名1",
                     "uploadItemId": "attach_fileupload_item1",
                     "notes": "サンプル備考1"
                 }
    ]
  },
  "applyAuthUserCode": "aoyagi",
  "flowId": "web_api_test"
}

12.5.2.2. レスポンス情報

  • レスポンスコード

    • 200
  • レスポンスヘッダ

    • Pragma : no-cache
    • Date : Mon, 27 Jul 2015 00:22:12 GMT
    • Cache-Control : no-store
    • Server : Resin/4.0.44
    • Content-Length : 121
    • Content-Type : application/json; charset=UTF-8
  • レスポンスボディ

{
   error: false
   data: {
      systemMatterId: 'ma_5ieu48aciukd9zo'
      userDataId: '5ieu48acirfd6zo'
      matterNumber: '0000000011'
   }
}

12.5.3. 承認処理 Web APIの実行

12.5.3.1. リクエスト情報

  • リクエストURI

    • basic/api/forma/imw/approve
  • リクエストメソッド

    • POST
  • リクエストヘッダ

    • Content-Type : application/json
    • Accept : application/json
    • Authorization : Basic dWVkYTp1ZWRh
    • X-Intramart-Session : once
  • リクエストボディ

{
  "executeUserCode": "aoyagi",
  "userParam": {},
  "formaUserParam": {
     "items" : {
        "textbox1" : "あいうえお"
     }
  },
  "authUserCode": "aoyagi",
  "systemMatterId": "ma_5ieu48aciukd9zo"
}

12.5.3.2. レスポンス情報

  • レスポンスコード

    • 200
  • レスポンスヘッダ

    • Pragma : no-cache
    • Date : Mon, 27 Jul 2015 00:34:17 GMT
    • Cache-Control : no-store
    • Server : Resin/4.0.44
    • Content-Length : 15
    • Content-Type : application/json; charset=UTF-8
  • レスポンスボディ

{
   error: false
}