# External System Integration - Incidents & Tasks

<div id="bkmrk-external-system-inte"><span>BzCtrl. provides a feature that allows external systems to create<span> </span></span>**Incidents**<span><span> </span>and<span> </span></span>**Tasks**<span><span> </span>directly through REST API communication. This enables operational systems to register issues or actions directly within their own workflows while ensuring follow-up and tracking take place in BzCtrl.</span>

The main value of this feature is that it allows Incidents and Tasks to be created directly from specific screens or processes within an external operational system, without requiring users to manually enter data into BzCtrl.

<div>####   


#### Integration Flow

The integration process consists of the following steps:

The request contains the information required to create the Incident (or Task) in BzCtrl.

</div><div><div>  
</div>**Step 1 - Authentication**

Before an ApiForm can be called, the external application must authenticate with BzCtrl. Authentication is performed by sending a<span> </span>**POST**<span> </span>request to the appropriate authentication endpoint using credentials provided for API communication.

**Endpoints**

**Acceptance Environment (ACC)**  
<span><span><span>https://acc.bzctrl.com/bzctrl-core-api/oauth/token</span></span></span>

**Production Environment (PROD)**  
<span><span><span>https://bzctrl.com/bzctrl-core-api/oauth/token</span></span></span>

**Request Method**

<span><span><span>POST</span></span></span>

**Request Body (x-www-form-urlencoded)**

<div>```
<span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>grant_type=password</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><br></br></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>username=example@example.com</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><br></br></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>password=Ex@mpl3!</span></span></span></span></span></span>
```

</div><div style="margin-left: 20px;">  
</div>**Sample Response**

<div>```
<span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>{</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><br></br></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>  "access_token": </span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span class="ͼk">"xxxxxxxxxx"</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>,</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><br></br></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>  "refresh_token": </span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span class="ͼk">"xxxxxxxxxx"</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>,</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><br></br></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>  "token_type": </span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span class="ͼk">"Bearer"</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>,</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><br></br></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>  "expires_in": </span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span class="ͼj">3600</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>,</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><br></br></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>  "scope": </span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span class="ͼk">"*"</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>,</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><br></br></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>  "jti": </span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span class="ͼk">"xxxxxxxxxx"</span></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><br></br></span></span></span></span></span><span style="background-color: rgb(242, 242, 242);"><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span><span><span><span>}</span></span></span></span></span></span>
```

</div><div style="margin-left: 20px;">  
</div>**Result**

Upon successful authentication, BzCtrl. returns an<span> </span>**access token**<span> </span>that must be included in subsequent API requests. The token serves as proof of authentication and authorizes communication with the BzCtrl. API. The token remains valid for the period specified in the<span> </span><span><span><span>expires\_in</span></span></span><span><span> </span></span>field.

<div>  
</div></div>**Step 2 - Create Incident (or Task)**

<div style="text-align: inherit;"><span style="background-color: unset; font-size: 1em; text-align: inherit; font-family: Roboto, "Segoe UI", GeezaPro, "DejaVu Serif", "sans-serif", -apple-system, BlinkMacSystemFont; letter-spacing: 0.0178571em;">After receiving the access token from the OAuth API, use the Add Task API to create a new Task or Incident.</span></div><div>  
</div><div style="margin-left: 20px;">**EndPoint**</div><div><div><span style="background-color: rgb(242, 242, 242);">  
</span></div><span style="background-color: rgb(242, 242, 242);">ACC: </span><span style="background-color: rgb(242, 242, 242);">[https://acc.bzctrl.com/bzctrl-core-api/api/v1/task/add-task ](https://acc.bzctrl.com/bzctrl-core-api/api/v1/task/add-task "https://acc.bzctrl.com/bzctrl-core-api/api/v1/task/add-task")</span>

<span style="background-color: rgb(242, 242, 242);">PROD: </span><span style="background-color: rgb(242, 242, 242);">[https://www.bzctrl.com/bzctrl-core-api/api/v1/task/add-task](https://www.bzctrl.com/bzctrl-core-api/api/v1/task/add-task "https://www.bzctrl.com/bzctrl-core-api/api/v1/task/add-task")</span>

<div>  
</div></div><p class="callout info callout info">*****Note: The access token received from the OAuth Token API must be included in the Authorization header using the Bearer scheme.*****</p>

<span style="font-size: 10pt;"><span>Request Method<span style="background-color: transparent;">: </span></span></span><span style="background-color: rgb(242, 242, 242); font-size: 10pt; font-weight: 400; text-align: inherit; font-family: Roboto, "Segoe UI", GeezaPro, "DejaVu Serif", "sans-serif", -apple-system, BlinkMacSystemFont; letter-spacing: 0.0178571em;"><span style="color: rgb(68, 114, 196); text-decoration: inherit; font-size: 10pt;">POST</span></span>

 <span style="font-size: 10pt;"><span>Required Headers</span></span>

 <span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">Content-Type: application/json</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> Authorization: Bearer {access\_token}</span></span>

 <span style="font-size: 10pt;"><span>Sample Request Body</span></span>

 <span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">{</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "todoType":"INCIDENT",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "domainWorkSpace":"EXA-CON-BUS-WOR",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "title":"</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span>Potential Customs claim</span></span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "description":"</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span>Operation started without proper approvals</span></span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "financialImpact":"123577",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "impact":"HIGH",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "likelihood":"MEDIUM",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "status":"IN PROGRESS",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "priority":"HIGH",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "assignee":"Example@example.com",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "reporter":"Example@example.com",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "category":\["Customs"\],</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "subCategory":\["IT"\],</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "lrn":"725462",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "orderID":"ORDER 777",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "reminderDate":"2024-09-27"</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> }</span></span>

 <span style="font-size: 10pt;"><span>Sample Response</span></span>

 <span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">{</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "title":"Potential Customs claim",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "taskType":"INCIDENT",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "description":"Operation started without proper approvals",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "taskLink":"https://www.bzctrl.com/app/#/todo/</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"><span>EXA-CON-BUS-WOR</span></span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">-03",</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> "tags":\["ORDER 777"\]</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;">  
</span><span style="color: rgb(68, 114, 196); text-decoration: inherit;"> }</span></span>

<div style="margin-left: 20px;">**This URL can be stored in the external system for direct access and traceability. Or you can open this URL in the browser by the JavaScript function(window.open("URL") ).** </div><div style="margin-left: 20px;"><span>From a UI/UX perspective the following should be considered (</span>* Mandatory, *Italic -* User input, CAPITOL - System generated Values)</div><div style="margin-left: 20px;">  
</div><div style="margin-left: 20px;"><table border="0" cellpadding="0" cellspacing="0" class="e-rte-table-border e-rte-table" width="1137"><tbody><tr height="21"><td class="" height="21" width="125">**Todo Type**</td><td class="" width="124">**Fields**</td><td class="" width="235">**Input**</td><td class="" width="653">**Comments**</td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">todoType\*</td><td class="">INCIDENT</td><td class="" width="653"><span>**Customer**<span> </span>-<span> </span></span><span>option to change to Task</span><span><span> </span>(or in case only used for Incidents default value)</span></td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">domain\*</td><td class=""><span>EXA-CON-BUS-WOR</span></td><td class="" width="653">Default value to include by<span> </span><span>**Customer**,</span><span><span> </span>relates to the Domain</span></td></tr><tr height="43"><td class="" height="43">incident, task</td><td class="">workspace\*</td><td class=""><span>WOR</span></td><td class="" width="653">Default value to include by<span> </span>**Customer**, relates to the Workspace under the Domain</td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">title\*</td><td class="">*Free text field*</td><td class="" width="653"><span>**Customer**,</span><span><span> </span>allow user to provide Title/Subject</span></td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">description\*</td><td class="">*Free text field*</td><td class="" width="653"><span>**Customer**,</span><span><span> </span>allow user to provide Description</span></td></tr><tr height="21"><td class="" height="21">task</td><td class="">result</td><td class="">*Free text field*</td><td class="" width="653"><span>**Customer**,</span><span><span> </span>allow user to provide Results</span><span><span> <span> </span></span>(optional)</span></td></tr><tr height="43"><td class="" height="43">incident</td><td class="">financialImpact</td><td class="">*Numbers field*</td><td class="" width="653"><span>**Customer**<span> </span></span><span>- For User<span> <span> </span></span>it should be clear this is a EUR amount. Only Number is provided.<span> </span></span><span>BzCtrl</span><span>. - This should be included in the Field "Potential financial impact of the incident" set as EUR.</span></td></tr><tr height="21"><td class="" height="21">incident</td><td class="">impact</td><td class="">*High, Medium, Low*</td><td class="" width="653"><span>**Customer**,</span><span><span> </span>allow user to select out of these three options (optional)</span></td></tr><tr height="21"><td class="" height="21">incident</td><td class="">likelihood</td><td class="">*High, Medium, Low*</td><td class="" width="653"><span>**Customer**,</span><span><span> </span>allow user to select out of these three options (optional)</span></td></tr><tr height="43"><td class="" height="43">incident, task</td><td class="">status\*</td><td class="">*In Progress*</td><td class="" width="653">Options BzCtrl. are To do, In Progress, Done and Expired.<span> </span>**Customer**<span><span> </span>- default when sending on In Progress, with option to change by User to Done.<span> </span></span><span>BzCrtrl</span><span>. - If status - Done, set due date to date transaction.</span></td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">priority</td><td class="">*High, Medium, Low*</td><td class="" width="653"><span>**Customer**,</span><span><span> </span>allow user to select out of these three options (optional)</span></td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">assignee\*</td><td class="">[User@example.com](mailto:User@impala.com)</td><td class="" width="653"><span>**Customer**,</span><span><span> </span>Same as Reporter. E-mail address of the User.</span></td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">reporter\*</td><td class="">[User@example.com](mailto:User@impala.com)</td><td class="" width="653"><span>**Customer**,<span> </span></span><span>E-mail address of the User.</span></td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">category</td><td class=""> </td><td class="" width="653">n/a</td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">orderID\*</td><td class="">ServiceOrder Number</td><td class="" width="653"><span>**Customer**<span> </span></span><span>-<span> </span></span><span>BzCrtrl.</span><span><span> </span>- Set as Tag</span></td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">LRN</td><td class="">LRN</td><td class="" width="653">**Customer**<span><span> </span>-<span> </span></span><span>BzCrtrl.</span><span><span> </span>- Set as Tag (if available handy reference)</span></td></tr><tr height="21"><td class="" height="21">incident, task</td><td class="">reminderDate</td><td class="">Calendar selection</td><td class="" width="653">n/a</td></tr></tbody></table>

</div></div><div id="bkmrk--1">  
</div>