Delete a notification channel for a user. The authenticated user must be the target user or have the on_call_admin permission
This endpoint requires the on_call_respond permission.
"""
Delete an On-Call notification channel for a user returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.on_call_apiimportOnCallApi# there is a valid "user" in the systemUSER_DATA_ID=environ["USER_DATA_ID"]# there is a valid "oncall_email_notification_channel" in the systemONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID=environ["ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=OnCallApi(api_client)api_instance.delete_user_notification_channel(user_id=USER_DATA_ID,channel_id=ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID,)
# Delete an On-Call notification channel for a user returns "No Content" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::OnCallAPI.new# there is a valid "user" in the systemUSER_DATA_ID=ENV["USER_DATA_ID"]# there is a valid "oncall_email_notification_channel" in the systemONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID=ENV["ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID"]api_instance.delete_user_notification_channel(USER_DATA_ID,ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID)
// Delete an On-Call notification channel for a user returns "No Content" responsepackagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "user" in the systemUserDataID:=os.Getenv("USER_DATA_ID")// there is a valid "oncall_email_notification_channel" in the systemOncallEmailNotificationChannelDataID:=os.Getenv("ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewOnCallApi(apiClient)r,err:=api.DeleteUserNotificationChannel(ctx,UserDataID,OncallEmailNotificationChannelDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `OnCallApi.DeleteUserNotificationChannel`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an On-Call notification channel for a user returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.OnCallApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();OnCallApiapiInstance=newOnCallApi(defaultClient);// there is a valid "user" in the systemStringUSER_DATA_ID=System.getenv("USER_DATA_ID");// there is a valid "oncall_email_notification_channel" in the systemStringONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID=System.getenv("ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID");try{apiInstance.deleteUserNotificationChannel(USER_DATA_ID,ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling OnCallApi#deleteUserNotificationChannel");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete an On-Call notification channel for a user returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_on_call::OnCallAPI;#[tokio::main]asyncfnmain(){// there is a valid "user" in the system
letuser_data_id=std::env::var("USER_DATA_ID").unwrap();// there is a valid "oncall_email_notification_channel" in the system
letoncall_email_notification_channel_data_id=std::env::var("ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=OnCallAPI::with_config(configuration);letresp=api.delete_user_notification_channel(user_data_id.clone(),oncall_email_notification_channel_data_id.clone(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete an On-Call notification channel for a user returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.OnCallApi(configuration);// there is a valid "user" in the system
constUSER_DATA_ID=process.env.USER_DATA_IDasstring;// there is a valid "oncall_email_notification_channel" in the system
constONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID=process.env.ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_IDasstring;constparams: v2.OnCallApiDeleteUserNotificationChannelRequest={userId: USER_DATA_ID,channelId: ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID,};apiInstance.deleteUserNotificationChannel(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));