# API for specific error detection rules at service level

**URL:** <https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132>\
**Category:** Dynatrace API\
**Tags:** problem-detection, dynatrace-api\
**Created:** [October 29, 2021, 9:52am UTC](https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132 "2021-10-29T09:52:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bert\_VanderHeyd](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/bert_vanderheyd/32/162_2.png) [@Bert\_VanderHeyd](https://community.dynatrace.com/u/Bert_VanderHeyd)\
**Post date:** [October 29, 2021, 9:52am UTC](https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132/1 "2021-10-29T09:52:09Z")

</div>

I know that we can use this early-adopter API to add some specific error-detection-rule based on a service request-attribute. This already helped us a lot.

> **[Failure detection API - POST a detection rule](https://docs.dynatrace.com/docs/dynatrace-api/configuration-api/service-api/failure-detection/detection-rules/post-rule)**
>
> Create a failure detection rule via the Dynatrace API.

However, now I want to make an Exception exclusion rule only on some specific services with a specific tag. I could do this manual, but that’s a lot of work to maintain. And I don’t see an API for that.

Is there an API? Or are there alternatives?

---

<div class="post-metadata">

**Author:** ![Bert\_VanderHeyd](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/bert_vanderheyd/32/162_2.png) [@Bert\_VanderHeyd](https://community.dynatrace.com/u/Bert_VanderHeyd)\
**Post date:** [October 29, 2021, 1:39pm UTC](https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132/2 "2021-10-29T13:39:07Z")

</div>

Found it. It is possible via that API after all. See&nbsp;ignoredExceptionPatterns in&nbsp;[Failure detection API - POST a parameter set — Dynatrace Docs](https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/service-api/failure-detection/parameter-set/post-parameter-set/)

---

<div class="post-metadata">

**Author:** ![shreyas\_shivapr](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@shreyas\_shivapr](https://community.dynatrace.com/u/shreyas_shivapr)\
**Post date:** [November 10, 2021, 9:39pm UTC](https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132/3 "2021-11-10T21:39:04Z")

</div>

This is great. Do you have an example of POST request to ignore a certain Exception? Also, I had added some exceptions to ignore list in the UI under Service settings. But when I do a GET all parameterSets, I get an empty response. Does this API only return the parameter sets that were created via API?

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 10, 2021, 10:30pm UTC](https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132/4 "2021-11-10T22:30:26Z")

</div>

Correct. The API returns only settings that were created using API.&nbsp;  
Unfortunately in the UI you don’t see the parameters created using API, even in read-only mode.

---

<div class="post-metadata">

**Author:** ![shreyas\_shivapr](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@shreyas\_shivapr](https://community.dynatrace.com/u/shreyas_shivapr)\
**Post date:** [November 10, 2021, 10:52pm UTC](https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132/5 "2021-11-10T22:52:05Z")

</div>

Thank you! And on my other question regarding example POST request, I figured it out and was able to ignore a specific exception.

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [November 11, 2021, 9:53am UTC](https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132/6 "2021-11-11T09:53:12Z")

</div>

Hello&nbsp;[@shreyas\_shivapr](https://community.dynatrace.com/user/31766)

Im using below to exclude an exception using API.

1st step: Creating the parameter:

{  
“id”: “FDP\_1”,  
“name”: “Exclusion 500 Internal Server Error”,  
“description”: “Exclusion 500 Internal Server Error”,  
“clientSideMissingHttpCodeIsFailure”: false,  
“serverSideMissingHttpCodeIsFailure”: false,  
“failingHttpCodesClientSide”: “400-599”,  
“failingHttpCodesClientSide”: “400-499, 501-599”,  
“failingHttpCodesServerSide”: “500-599”,  
“failingHttpCodesServerSide”: “501-599”,  
“http404NotFoundFailureEnabled”: false,  
“brokenLinkDomains”: [],  
“successForcingExceptionPatterns”: [],  
“ignoredExceptionPatterns”: [  
{  
“classPattern”: “System.Net.WebException”,  
“messagePattern”: “The remote server returned an error: (500) Internal Server Error.”  
}  
],

“tagConditions”: []  
}

2nd create the rule:

{  
“id”: “R\_1”,  
“name”: “Exclusion 500 Internal Server Error”,  
“description”: “Exception Excluse 500 Server error”,  
“enabled”: true,  
“fdpId”: “FDP\_1”,  
“conditions”: [  
{  
“attribute”: “SERVICE\_NAME”,  
“predicate”: {  
“type”: “STRING\_STARTS\_WITH”,  
“ignoreCase”: false,  
“values”: [  
“Default Web Site:80,443”,  
“ANB-SRV-OUTDMZ”  
]  
}  
}  
]  
}

---

<div class="post-metadata">

**Author:** ![shreyas\_shivapr](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@shreyas\_shivapr](https://community.dynatrace.com/u/shreyas_shivapr)\
**Post date:** [November 11, 2021, 2:24pm UTC](https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132/7 "2021-11-11T14:24:46Z")

</div>

Thanks&nbsp;[@Malaik](https://community.dynatrace.com/user/23195)&nbsp;  
Do we always need to create the rule followed by creating the parameter? And is the rule to apply the parameter to specific service?

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [November 12, 2021, 10:10am UTC](https://community.dynatrace.com/t/api-for-specific-error-detection-rules-at-service-level/33132/8 "2021-11-12T10:10:37Z")

</div>

Hi&nbsp;[@shreyas\_shivapr](https://community.dynatrace.com/user/31766)

We need to create le parameter first, because the ID of the parameter is one item of the rule.

You can specify a list of services … (in my example, you can see all services starting with&nbsp;“Default Web Site:80,443”

“type”: “ **STRING\_STARTS\_WITH** ”,  
“ignoreCase”: false,  
“values”: [  
**“Default Web Site:80,443”,**
