Read One Notification Policy
GET {{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}
Use the GET {{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}} endpoint to retrieve the details of a single notification policy. The policy is specified with its ID.
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff '{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}' \
--header 'Authorization: Bearer {{accessToken}}'
var options = new RestClientOptions("{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{accessToken}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer {{accessToken}}")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
GET /environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}} HTTP/1.1
Host: {{apiPath}}
Authorization: Bearer {{accessToken}}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}")
.method("GET", body)
.addHeader("Authorization", "Bearer {{accessToken}}")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}",
"method": "GET",
"timeout": 0,
"headers": {
"Authorization": "Bearer {{accessToken}}"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'GET',
'url': '{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}',
'headers': {
'Authorization': 'Bearer {{accessToken}}'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}"
payload = {}
headers = {
'Authorization': 'Bearer {{accessToken}}'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{accessToken}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
require "uri"
require "net/http"
url = URI("{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer {{accessToken}}"
response = http.request(request)
puts response.read_body
var request = URLRequest(url: URL(string: "{{apiPath}}/environments/{{envID}}/notificationsPolicies/{{notificationPolicyID}}")!,timeoutInterval: Double.infinity)
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Example Response
200 OK
{
"_links": {
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/notificationsPolicies/a66c0af1-64a5-4a59-bd94-af0944efb5cb"
},
"environment": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
}
},
"id": "a66c0af1-64a5-4a59-bd94-af0944efb5cb",
"environment": {
"id": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
},
"name": "Default Notification Policy",
"quotas": [
{
"type": "USER",
"deliveryMethods": [
"SMS",
"Voice"
],
"unclaimed": 10,
"claimed": 15
}
],
"countryLimit": {
"type": "NONE"
},
"updatedAt": "2024-12-26T12:01:57.760Z",
"createdAt": "2024-08-11T12:34:23.922Z",
"providerConfiguration": {
"conditions": [
{
"deliveryMethods": [
"SMS"
],
"countries": [
"SE"
],
"fallbackChain": [
{
"id": "33f0d52f-c4db-48a5-9d02-702a18bc49c9"
},
{
"id": "9061e33d-5513-40f7-a4c3-dcc59c631ec4"
},
{
"id": "b8a08588-a61e-418f-b712-56d450c2f2de"
}
]
},
{
"deliveryMethods": [
"SMS"
],
"countries": [
"JP"
],
"fallbackChain": [
{
"id": "9061e33d-5513-40f7-a4c3-dcc59c631ec4"
},
{
"id": "33f0d52f-c4db-48a5-9d02-702a18bc49c9"
},
{
"id": "b8a08588-a61e-418f-b712-56d450c2f2de"
}
]
},
{
"deliveryMethods": [
"VOICE",
"SMS"
],
"countries": [
"CA"
],
"fallbackChain": [
{
"id": "b8a08588-a61e-418f-b712-56d450c2f2de"
},
{
"id": "33f0d52f-c4db-48a5-9d02-702a18bc49c9"
},
{
"id": "9061e33d-5513-40f7-a4c3-dcc59c631ec4"
}
]
},
{
"deliveryMethods": [
"SMS"
],
"fallbackChain": [
{
"id": "b8a08588-a61e-418f-b712-56d450c2f2de"
}
]
}
]
},
"cooldownConfiguration": {
"sms": {
"enabled": false
},
"email": {
"enabled": false
},
"voice": {
"enabled": false
},
"whatsApp": {
"enabled": false
}
},
"default": true
}
Example Response
200 OK
{
"_links": {
"self": {
"href": "https://api.pingone.eu/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/notificationsPolicies/faedb6c3-feaf-4b6c-8b84-cc88d80758aa"
},
"environment": {
"href": "https://api.pingone.eu/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
},
"providersFallbackChain": {
"href": "https://api.pingone.eu/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/notificationsPolicies/faedb6c3-feaf-4b6c-8b84-cc88d80758aa/phoneDeliverySettings"
}
},
"id": "faedb6c3-feaf-4b6c-8b84-cc88d80758aa",
"environment": {
"id": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
},
"name": "Notification policy with environment limit and country limitation and cooldown periods",
"quotas": [
{
"type": "ENVIRONMENT",
"deliveryMethods": [
"SMS",
"Voice"
],
"total": 1000
}
],
"countryLimit": {
"type": "ALLOWED",
"deliveryMethods": [
"SMS",
"Voice"
],
"countries": [
"US",
"CA"
]
},
"updatedAt": "2025-03-26T09:19:21.243Z",
"createdAt": "2025-03-26T09:19:21.253Z",
"providerConfiguration": {
"conditions": [
{
"deliveryMethods": [
"SMS"
],
"fallbackChain": [
{
"id": "bd237e31-c920-406e-bb50-0f083b24f1e3"
}
]
}
]
},
"cooldownConfiguration": {
"sms": {
"enabled": true,
"groupBy": "",
"periods": [
{
"duration": 30,
"timeUnit": "SECONDS"
},
{
"duration": 2,
"timeUnit": "MINUTES"
},
{
"duration": 3,
"timeUnit": "MINUTES"
}
],
"resendLimit": 5
},
"email": {
"enabled": true,
"groupBy": "",
"periods": [
{
"duration": 30,
"timeUnit": "SECONDS"
},
{
"duration": 1,
"timeUnit": "MINUTES"
},
{
"duration": 2,
"timeUnit": "MINUTES"
}
],
"resendLimit": 4
},
"voice": {
"enabled": true,
"groupBy": "USER_ID",
"periods": [
{
"duration": 40,
"timeUnit": "SECONDS"
},
{
"duration": 2,
"timeUnit": "MINUTES"
},
{
"duration": 4,
"timeUnit": "MINUTES"
}
],
"resendLimit": 6
},
"whatsApp": {
"enabled": true,
"groupBy": "USER_ID",
"periods": [
{
"duration": 15,
"timeUnit": "SECONDS"
},
{
"duration": 2,
"timeUnit": "MINUTES"
},
{
"duration": 4,
"timeUnit": "MINUTES"
}
],
"resendLimit": 7
}
},
"default": false
}