Usage of Digital Workplace REST-API

Version 3
    Share This:

    One of many great features in DWP is the ability to create the most important business applications or business services as a service in DWP to give all DWP users the ability to exchange messages about this service, or to view the current status of the service. Each user who follow the service can decide if he wants to get an email/push notification if the status of the service has been updated.

    In the DWP Admin console you can predefine the membership of the service with a AD Group.

    The status of the service can be set manually in the DWP admin console.

    BMC offers an ootb integration with TrueSight to update the status of a service/application based on monitoring events automatically.

    If you don´t have TrueSight in place, but you want to use the feature with your monitoring/event management system you can use the REST API of DWP.

    Please note that the useage is not officially supported.

    This example can be used if DWP is also integrated with RSSO.

     

    This is a step-by-step manual to change the status of a DWP Service. You can get the available service information, you can update the status of an existing service and you can create an activity for a service.

    Step 1:

    Authentication via RSSO:

    POST Call on https://rssoserver.onbmc.com/rsso/start

    Header:

    Accept=*/*

    Content-Type=application/x-www-form-urlencoded

     

    For the body I use the RSSO bypass url.

    The correct body can be caputured with fiddler.

    Body:

    reauth=false&new-hpassword=&hpassword=YOURencryptedPassword&rsso_preauth=null&auth-index=0&tenant=YOURtenant&goto=https%3A%2F%2Fdwpserver.onbmc.com%2F&bypass-auth=true&url_hash_handler=true&password=&user-name=USER&redirect=0

     

    Cookie Result:

    ams_dev=_2b31f6cd-ba88-46e6-828b-69a0980016bc; 27250a883eb8d9c1820b9515afc5eb11=16a642ffacf3504ee8fd19203a91a617;onbmc_pool=!CtNz2wB4ASiwbr7J0hI+Rx3iwG4S8DPiTbH8XFa/yWulCTeo7gC7CVcTXWfJHJ1cxJvcol5Sqm7fyw==

     

    Step 2:

    GET Call auf https://dwpserver.onbmc.com/dwp/app

    Header:

    Accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8

    Cookie=ams_dev=_2b31f6cd-ba88-46e6-828b-69a0980016bc; 27250a883eb8d9c1820b9515afc5eb11=16a642ffacf3504ee8fd19203a91a617;onbmc_pool=!CtNz2wB4ASiwbr7J0hI+Rx3iwG4S8DPiTbH8XFa/yWulCTeo7gC7CVcTXWfJHJ1cxJvcol5Sqm7fyw==

     

    Cookie Result:

    JSESSIONID=01B1B6A65C20C20803DBC935D8ED37A8

     

    Step 3:

    Get Services Information:

    POST Call auf https://dwpserver.onbmc.com/dwp/rest/search

    Header:

    Accept=application/json, text/javascript, */*; q=0.01

    Content-Type=application/json; charset=utf-8

    Cookie=JSESSIONID=01B1B6A65C20C20803DBC935D8ED37A8

    X-Requested-By=XMLHttpRequest

     

    Body:

    {"queryName":"MYIT_ALL_SERVICES","attributes":{"ServiceAvailability":["id","linkedServiceId","linkedServiceName","name","desc","iconId","annotation","status","externalStatus","isEnabled","isAutoSubscribe","statusIsManual","accessGroups","actions","createDate","modifiedDate"]}}

     

    Step 4:

    Update Service Status

    POST Call auf https://dwpserver.onbmc.com/dwp/rest/update

    Header:

    Content-Type=application/json; charset=UTF-8

    Cookie=JSESSIONID=01B1B6A65C20C20803DBC935D8ED37A8

    X-Requested-By

    Body:

    {"ServiceAvailability": {"id":"86634509-8eaa-415e-94c4-a14e07b3798f","changes":{"status":"60"}}}

     

    Not Available = 60

    Available=10

     

    Step 5:

    Create Activity

    POST Call on https://dwpserver.onbmc.com/dwp/rest/v2/activity

    Header:

    Accept: application/json, text/plain, */*

    X-Requested-By: XMLHttpRequest

    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

    Content-Type:application/json; charset=UTF-8

    Cookie:JSESSIONID=01B1B6A65C20C20803DBC935D8ED37A8

    Body:

    {"text":"This is a test @[Digtial Workplace]|86634509-8eaa-415e-94c4-a14e07b3798f|(service)","type":"microblog"}

     

     

    Many thanks toAlexander Stern and Chetan Singh, who helped me to work out this solution.