-
Notifications
You must be signed in to change notification settings - Fork 1
Edit Operation JSON Body Syntax
This guide demonstrates the syntax necessary for performing an edit operation on an Active Directory object using the /edit endpoint.
The base JSON body syntax looks like:
{
"dn": "<DN of object to edit>",
"edits": {
// any edit operation keywords
}
}The edits JSON object can have any combination of the following edit keywords added.
Indicates to add the specified value(s) to designated attributes. No existing values are overwritten using this.
Add accepts a JSON object of property/value pairs.
EXAMPLE
{
"dn": "CN=John Doe,DC=contoso,DC=com",
"edits": {
"add": {
"proxyAddresses": [
"smtp:additionalemail@thisplace.com",
"smtp:anotheremail@wherever.com"
]
}
}Indicates to remove ALL values from a property value collection (e.g. - ProxyAddresses).
Clear can accept a single string value or be a JSON arrays of property names.
EXAMPLE 1
{
"dn": "CN=John Doe,DC=contoso,DC=com",
"edits": {
"clear": "proxyAddresses"
}
}EXAMPLE 2
{
"dn": "CN=John Doe,DC=contoso,DC=com",
"edits": {
"clear": [
"description",
"proxyAddresses"
]
}
}Indicates to remove only the specified values from the designated properties of an Active Directory object.
Remove accepts a JSON object of property JSON objects where each property of said object matches an existing value that is to be removed.
EXAMPLE 1
{
"dn": "CN=John Doe,DC=contoso,DC=com",
"edits": {
"remove": {
"proxyAddresses": "smtp:badaddress@smtp.com"
}
}
}EXAMPLE 2
{
"dn": "CN=John Doe,DC=contoso,DC=com",
"edits": {
"remove": {
"proxyAddresses": [
"smtp:badaddress@smtp.com",
"smtp:anotherbadaddress@smtp.com"
]
}
}
}Indicates that the specified properties should have their existing values replaced with new ones.
Replace accepts a JSON object of property JSON objects where each property of said object matches an existing value with the JSON value being the replacement.
EXAMPLE
{
"dn": "CN=John Doe,DC=contoso,DC=com",
"edits": {
"replace": {
"proxyAddresses": {
"smtp:badaddress@smtp.com": "smtp:goodaddress@smtp.com"
}
}
}Indicates to replace ALL values of the designated properties with a replacement set.
Set accepts an JSON object of additional JSON objects whose key is the LDAP attribute name. The values for each object can be either a single int or string value or an array of values.
EXAMPLE 1
{
"dn": "CN=John Doe,DC=contoso,DC=com",
"edits": {
"set": {
"proxyAddresses": "smtp:badaddress@smtp.com"
}
}
}EXAMPLE 2
{
"dn": "CN=John Doe,DC=contoso,DC=com",
"edits": {
"set": {
"proxyAddresses": [
"smtp:badaddress@smtp.com",
"smtp:anotherbadaddress@smtp.com"
]
}
}
}When specifying multiple operation keywords together in a single request, each operation will be executed in the following order:
- Set
- Remove
- Add
- Replace
- Clear