bonita BPM ------system API

system API


  • i18nlocale
  • i18ntranslation
  • Session
  • Tenant

    i18nlocale

    Description

    List the available locales.

    Representation
    {
      "name":"_Name of the language_",
      "locale":"_code of the locale_"
    }
    
    Methods

    The methods used for this resource are:

    • GET - list available locales
    List available locales
    • URL
      /API/system/i18nlocale
    • Method
      GET
    • Data Params
      Standard search parameters are available.
    • Success Response
      The list of locales as JSON
      • Code: 200
      • Payload:
        [
          {
            "name":"English",
            "locale":"en"
          },
          {
            "name":"Italiano",
            "locale":"it"
          },
          {
            "name":"Deutsch",
            "locale":"de"
          }
        ]

    这个API能够获取支持的语言版本。  通过工具发送命令并得到响应如下:

    命令:

    GET http://localhost:15177/bonita/API/system/i18nlocale?p=0&c=10 HTTP/1.1
    Host: localhost:15177
    Connection: keep-alive
    Accept: application/json, text/plain, */*
    X-Bonita-API-Token: ccd95f19-bfee-4f2c-b8c4-c885a1124020
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.9.3.1000 Chrome/39.0.2146.0 Safari/537.36
    DNT: 1
    Referer: http://localhost:15177/bonita/portal.js/
    Accept-Encoding: gzip,deflate
    Accept-Language: zh-CN
    Cookie: <strong><span style="color:#ff0000;">JSESSIONID=C4CD35ADAF8C1D9318D18DCA9C611B1C; bonita.tenant=1; X-Bonita-API-Token=ccd95f19-bfee-4f2c-b8c4-c885a1124020; BOS_Locale=en</span></strong>
    

    cookie 会随着每次登陆,随机分配一个新的。


    响应:

    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Pragma: No-cache
    Cache-Control: no-cache,no-store,no-transform,max-age=0
    Expires: 19    2016 04:48:19 GMT
    Content-Range: 0-10/4
    Content-Type: application/json;charset=UTF-8
    Transfer-Encoding: chunked
    Date: Thu, 20 Oct 2016 04:48:20 GMT
    
    8a
    [{"name":"English","locale":"en"},{"name":"Français","locale":"fr"},{"name":"Español","locale":"es"},{"name":"日本語","locale":"ja"}]
    0


    i18ntranslation

    Description

    Get the translations for the specified locale.

    Representation
    {
      "value":"_the translation_",
      "key":"_the key of the translation_"
    }
    
    Methods

    The methods used for this resource are:

    • GET - the translations for the specified locale
    List available translations

    Returns all translations of the product. If a locale is specified in the filter, that translation for that locale are returned. if no locale is specified, the translations in English are returned.

    • URL
      /API/system/i18ntranslation
    • Method
      GET
    • Data Params
      Standard search parameters are available.
      Example/API/system/i18ntranslation?p=0&c=2&f=locale%3dde
    • Success Response
      The list of translations as JSON
      • Code: 200
      • Payload:
        [
          {
            "value":" Um dies zu tun, gehen Sie zu %entitymappingprofilelink%.",
            "key":" To do so, go to %entitymappingprofilelink%."
          }, {
            "value":" Um dies zu tun, gehen Sie zu %profilelink%.",
            "key":" To do so, go to %profilelink%."
          }
        ]
    这个API能够获取翻译。  通过工具发送命令并得到响应如下:

    发送命令:

    GET http://localhost:15177/bonita/API/system/i18ntranslation?p=0&c=10&f=locale%3den HTTP/1.1
    Host: localhost:15177
    Connection: keep-alive
    Accept: application/json, text/plain, */*
    X-Bonita-API-Token: ccd95f19-bfee-4f2c-b8c4-c885a1124020
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.9.3.1000 Chrome/39.0.2146.0 Safari/537.36
    DNT: 1
    Referer: http://localhost:15177/bonita/portal.js/
    Accept-Encoding: gzip,deflate
    Accept-Language: zh-CN
    Cookie: JSESSIONID=C4CD35ADAF8C1D9318D18DCA9C611B1C; bonita.tenant=1; X-Bonita-API-Token=ccd95f19-bfee-4f2c-b8c4-c885a1124020; BOS_Locale=en
    

    响应:
    HTTP/1.1 200 OK
    Date: Thu, 20 Oct 2016 05:20:33 GMT
    Accept-Ranges: bytes
    Server: Restlet-Framework/2.3.1
    Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
    Content-Type: application/json;charset=UTF-8
    Transfer-Encoding: chunked
    
    11c21
    [{"key":"","value":"}]
    0

    Session

    Description

    Get the current session.

    Identifier

    unusedid, the id is not used, the current session is always returned

    Representation
    {
      "user_id":"_id of the user_",
      "user_name":"_name of the user_",
      "session_id":"_id of the session_",
      "conf":"_session configuration_",
      "is_technical_user":"_true if the user is the technical user, false otherwise_",
      "version":"_product version_"
    }
    
    Methods

    The methods used for this resource are:

    • GET - get the current session
    Get the current session
    • URL
      /API/system/session/unusedid
    • Method
      GET
    • Success Response
      The session in JSON
      • Code: 200
      • Payload:
        {
          "user_id":"12",
          "user_name":"william.jobs",
          "session_id":"2885803778329414975",
          "conf":"[\"D7A27EA0483FBAF903BD61BD16D70EF610DBE6D4\"]",
          "is_technical_user":"false",
          "version":"6.4.0"
        }

    这个API能够获取当前用户的会话,可以知道很多的用户信息。


    发送命令:

    GET http://localhost:15177/bonita/API/system/session/unusedid HTTP/1.1
    Host: localhost:15177
    Connection: keep-alive
    Accept: application/json, text/plain, */*
    X-Bonita-API-Token: ccd95f19-bfee-4f2c-b8c4-c885a1124020
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.9.3.1000 Chrome/39.0.2146.0 Safari/537.36
    DNT: 1
    Referer: http://localhost:15177/bonita/portal.js/
    Accept-Encoding: gzip,deflate
    Accept-Language: zh-CN
    Cookie: JSESSIONID=C4CD35ADAF8C1D9318D18DCA9C611B1C; bonita.tenant=1; X-Bonita-API-Token=ccd95f19-bfee-4f2c-b8c4-c885a1124020; BOS_Locale=en
    

    接收响应:

    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    X-Bonita-API-Token: ccd95f19-bfee-4f2c-b8c4-c885a1124020
    Set-Cookie: X-Bonita-API-Token=ccd95f19-bfee-4f2c-b8c4-c885a1124020; Path=/bonita
    Pragma: No-cache
    Cache-Control: no-cache,no-store,no-transform,max-age=0
    Expires: 19    2016 05:25:35 GMT
    Content-Type: application/json;charset=UTF-8
    Transfer-Encoding: chunked
    Date: Thu, 20 Oct 2016 05:25:35 GMT
    
    2f0
    {"user_name":"walter.bates","session_id":"-682001112821871477","is_technical_user":"false","user_id":"4","conf":"[\"5F2BC92C95C5B107B79328E93AF1C6D7F44703EA\",\"990C9B78A14AF27D7740B940D15D93B52FD3D5A4\",\"65177E19BB6AB602BF6ADC06994A6220C5DBF6AF\",\"A6BBD84BA4962AD792C451D11D2F55DEFC32A2AF\",\"69AAA75A48A4B70FB4A4F2D58CF10C8F0F5E3F3C\",\"92A5EB0F0109E0CC37621EAC02BCCC5547AB4322\",\"21961B0A801123EDA8454405867C880485A47A97\",\"AB2C080E6C8C23825FFB5A1C2802B00CA885C937\",\"8872CD6F4F9A144DCA6FD7E9AB8D3E16541C1156\",\"B4A67B64EB3D9647224EE42B9B50C917C71354C8\",\"D5442FBB2C0481F30CF5E25E93178D9C474D1E18\",\"7380CCA54822DDA33C7327B71ADA36C2E8686D0D\",\"A7B5C7702BFBB42A9EA65A662D5636F220F0DA52\"]","copyright":"Bonitasoft © 2016","version":"7.3.2"}
    0
    


    JSON对象:




    Tenant

    Description

    Pause and resume tenant services in order to do maintenance on a tenant.

    Identifier

    unusedid, the id is not used, the current tenant is always returned

    Representation
    {
      "paused":"_true if the tenant is paused, false otherwise_",
      "id":"_id of the tenant_"
    }
    
    Methods

    The methods used for this resource are:

    • GET - get the current tenant
    • PUT - pause or resume the tenant
    Get the current tenant
    • URL
      /API/system/tenant/unusedid
    • Method
      GET
    • Success Response
      The tenant id with its status in JSON
      • Code: 200
      • Payload:
        {
          "paused":"false",
          "id":"1"
        }
        
    发送命令:
    <span style="font-size:14px;">GET http://localhost:15177/bonita/API/system/tenant/unusedid HTTP/1.1
    Host: localhost:15177
    Connection: keep-alive
    Accept: application/json, text/plain, */*
    X-Bonita-API-Token: ccd95f19-bfee-4f2c-b8c4-c885a1124020
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.9.3.1000 Chrome/39.0.2146.0 Safari/537.36
    DNT: 1
    Referer: http://localhost:15177/bonita/portal.js/
    Accept-Encoding: gzip,deflate
    Accept-Language: zh-CN
    Cookie: JSESSIONID=C4CD35ADAF8C1D9318D18DCA9C611B1C; bonita.tenant=1; X-Bonita-API-Token=ccd95f19-bfee-4f2c-b8c4-c885a1124020; BOS_Locale=en</span><span style="font-size: 18px;">
    </span>


    响应命令:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Pragma: No-cache
    Cache-Control: no-cache,no-store,no-transform,max-age=0
    Expires: 19    2016 05:31:13 GMT
    Content-Type: application/json;charset=UTF-8
    Transfer-Encoding: chunked
    Date: Thu, 20 Oct 2016 05:31:14 GMT
    
    1b
    {"id":"1","paused":"false"}
    0




    Pause or resume the current tenant
    • URL
      /API/system/tenant/unusedid
    • Method
      PUT
    • Request Payload
      {
        "paused":"true"
      }
      
      or
      {
        "paused":"false"
      }
      
    • Success Response
      • Code: 200

    这个命令用来设置 "租户服务",但是还不清楚其真正的含义:

    发送命令:

    PUT http://localhost:15177/bonita/API/system/tenant/unusedid HTTP/1.1
    Host: localhost:15177
    Connection: keep-alive
    Accept: application/json, text/plain, */*
    X-Bonita-API-Token: ccd95f19-bfee-4f2c-b8c4-c885a1124020
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.9.3.1000 Chrome/39.0.2146.0 Safari/537.36
    DNT: 1
    Referer: http://localhost:15177/bonita/portal.js/
    Accept-Encoding: gzip,deflate
    Accept-Language: zh-CN
    Cookie: JSESSIONID=C4CD35ADAF8C1D9318D18DCA9C611B1C; bonita.tenant=1; X-Bonita-API-Token=ccd95f19-bfee-4f2c-b8c4-c885a1124020; BOS_Locale=en
    
    1b
    {"paused":"true"}
    0

    响应命令:

    HTTP/1.1 403 Forbidden
    Server: Apache-Coyote/1.1
    Content-Length: 0
    Date: Thu, 20 Oct 2016 05:36:01 GMT

    响应这边有点问题,好像是权限不够,目前解决不了。


    总结:

    这部分system的API都是系统层面的一些设置选项。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值