Put Access Control Developing
Run in Apidog
Create access control for project# 📣 This POST endpoint creates access control rule for a project 🔰 simple Payload data for post request {
"geo_country" : {
"action" : "allow" ,
"countries" : [ "US" , "UK" ] ,
"enabled" : true
} ,
"geo_ip" : {
"action" : "block" ,
"ips" : [ "192.168.1.1" , "10.0.0.1" ] ,
"enabled" : true
} ,
"token" : {
"secret" : "my_secret_token" ,
"enabled" : true
} ,
"domain_referrer" : {
"action" : "allow" ,
"domains" : [ "example.com" , "example.net" ] ,
"enabled" : false
}
}
🔰 here the POST request sets the access control rule for a project . 📢 Info message : Here URL is contructed likePUT /projects/<project_id>/access-controls
Request Provide your bearer token in the Authorization
header when making requests to protected resources. Example: Authorization: Bearer ********************
Body Params application/json
{
"geo_country" : {
"action" : "allow" ,
"countries" : [ "US" , "UK" ] ,
"enabled" : true
} ,
"geo_ip" : {
"action" : "block" ,
"ips" : [ "192.168.1.1" , "10.0.0.1" ] ,
"enabled" : true
} ,
"token" : {
"secret" : "my_secret_token" ,
"enabled" : true
} ,
"domain_referrer" : {
"action" : "allow" ,
"domains" : [ "example.com" , "example.net" ] ,
"enabled" : false
}
}
Request Code Samples
curl --location --request PUT 'http://localhost:8080/v1/projects/66a1084b-4b6b-4001-a4ad-d34d13463068/access-controls' \
--header 'Content-Type: application/json' \
--data-raw '{
"geo_country": {
"action": "allow",
"countries": ["US", "UK"],
"enabled": true
},
"geo_ip": {
"action": "block",
"ips": ["192.168.1.1", "10.0.0.1"],
"enabled": true
},
"token": {
"secret": "my_secret_token",
"enabled": true
},
"domain_referrer": {
"action": "allow",
"domains": ["example.com", "example.net"],
"enabled": false
}
}'
Responses application/json Generate Code
Modified at 2024-03-13 09:27:54