BMC Helix Digital Workplace: How to submit a request using the Digital Workplace Catalog REST API via Postman - INCLUDES VIDEO
Knowledge Article
BMC Helix Digital Workplace: How to submit a request using the Digital Workplace Catalog REST API via Postman - INCLUDES VIDEO
Customer wants to submit a request for DWPC service named “Report an issue” using Digital Workplace Catalog REST API via postman.
BMC Helix Digital Workplace Advanced
v21.x, v22.x
BMC Helix Digital Workplace Advanced
v21.x, v22.x
How to submit a request using the Digital Workplace Catalog REST API via Postman?
Use case: Customer wants to submit a request for DWPC service named “Report an issue” using Digital Workplace Catalog REST API via postman.
Before we start, you should always have the following information in mind:
Base URI
This base URI /api/myit-sb/ is always used for calling the BMC Helix Digital Workplace Catalog server, below are some base URI examples:
Base URI format type
Example
Local machine
http://localhost:8008/api/myit-sb
HTTPS connection
https://calbroservices.com:8008/api/myit-sb
HTTP connection
http://calbroservices.com:8008/api/myit-sb
A server without a port assigned to it
http://calbroservices.com/api/myit-sb
Header
The following header is the most common used for all requests:
default-bundle-scope: myit-sb
Content-Type: application/json
X-Requested-By: <any_value>
Authentication
To be able to make REST API calls, you need to log in to the application by using the users/loginendpoint to be granted a session token, which is valid for about 30 minutes. The system-generated token must be included in all subsequent calls for the system to trust requests from the application or script that has been granted that token. This token is typically sent back and forth as an AR-JWT cookie.
NOTE: Please make sure the user login id used to generate the authentication token must match with the login id present in the CTM:People form. If the login id does not match you may get the below error while trying to create a SB Request using end point api/myit-sb/requests
Please note that for 21.x and above, the domain name doesn't need to be passed in the Login ID as it did in previous versions.
Following are the request activities used in Postman to submit a request using Digital Workplace Catalog Rest API.
Note: In the response we can see “requestId”: “38” was created, save that value, it will be used in next activities as well.
Get service questionnaire
Once we initiated a dwpc request, we need to get the questionnaire related to it, so in the request url you must include the “requestId” created in the previous activity, in this use case is 38
In the request url we included the “requestId”: “38” created in activity 3, in the body we included questionnaire info. We’ll send this request only for non-attachments questions, in a separate request we’ll the attachment question.
NOTE: you must send each question in a single request.
To send an answer for a 2nd question
In the request url we included the “requestId”: “38” created in previous activities, and in the body, we included questionnaire info. We send only in this request a single non-attachments questions, in a separate request we’ll send it.
The question id we got t it from activity 4 Get service questionnaire, and the “answers” is the value of previous activity “contentId”, and in the url is included the serviceRequestId.
As final activity, we submit a request, in the url includes values 103 & 38 which correspond to "serviceId" : "103" & "requestId": "38", obtained from activity 3.