19 Directories

19.1 Get Directories

GET https://<HOST>:<PORT>/api/directories/get?version=0

Returns a list of directories or detailed information about a static user directory

Required Permissions

  • API

  • Configuration Mode Read Access

Request parameters

  • id

    The identifier or display name of the directory.

Response Body Structure

The response body is structured as DirectoryInfo JSON object. A description for its fields is at section 27.32.1. For the JSON schema refer to section 27.32.2.

Example

GET http://127.0.0.1:8111/api/directories/get?id=edadc2e6-9da2-411d-ac0f-17c8dc65dd52&version=0
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
{
  "displayName": "Test Static User Directory",
  "id": "edadc2e6-9da2-411d-ac0f-17c8dc65dd52",
  "directoryType": "STATIC_USER_DIRECTORY",
  "userRecords": [{
    "displayName": "Test User",
    "applicationRecords": {
      "associatedProvisioningDevices": [{
        "subId": "asd",
        "aorUserName": "asd",
        "staticVariables": {"test": "value"},
        "deviceId": "00b0d063c226"
      }],
      "webrtc": {
        "address": {
          "tagSet": ["userPhone"],
          "displayName": "qwe",
          "dialString": "123"
        },
        "credentials": {
          "passwordBase64": "d2VicnRjUHc=",
          "username": "webrtcUser"
        }
      },
      "sipCredentials": {"username": "qwe"},
      "sipRegistrar": {
        "dialStrings": [{
          "addresses": [
            {
              "tagSet": "",
              "dialString": "123"
            },
            {
              "tagSet": "",
              "dialString": "456"
            }
          ],
          "aorMatch": {
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          },
          "matches": [{
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          }]
        }],
        "failover": {
          "statusCodes": "486,501-503",
          "groupIdentifier": "93134fe9-8eff-4313-a5fe-e8513d21f043"
        }
      },
      "policy": {
        "rewriteTableOutgoing": [{
          "applyToDestinationDialString": true,
          "displayName": "test",
          "addSuffix": "3",
          "matchTags": {
            "tagSet": [
              "userIp",
              "userPhone"
            ],
            "type": "xor"
          },
          "index": 0,
          "deleteTrailingCharacters": 2,
          "deleteLeadingCharacters": 1,
          "wildcardPattern": "0123456789+\\+!?X.[]",
          "clearDisplayName": false,
          "rewriteType": "wildcardPattern",
          "skipRulesBelow": false,
          "skipFurtherRules": false,
          "comment": "Wildcard Pattern Rewrite Outgoing",
          "tagRewrite": {
            "operations": [
              {
                "tag": "userIp",
                "type": "keep"
              },
              {
                "tag": "userPhone",
                "type": "delete"
              }
            ],
            "clearTags": false
          },
          "case": "casefold",
          "addPrefix": "2"
        }],
        "sippgIncoming": {
          "include": [
            "RFC3323_SESSION",
            "RFC3325_ID",
            "RFC7044_HISTORY"
          ],
          "permit": [
            "RFC3323_USER",
            "RFC3323_SESSION",
            "RFC3325_ID"
          ],
          "passthrough": [
            "RFC3323_USER",
            "RFC3323_SESSION",
            "RFC7044_HISTORY"
          ],
          "enforce": [
            "RFC3323_USER",
            "RFC3325_ID",
            "RFC7044_HISTORY"
          ]
        },
        "sippgOutgoing": {
          "include": [
            "RFC3325_ID",
            "RFC7044_HISTORY"
          ],
          "permit": [
            "RFC3323_USER",
            "RFC3323_SESSION"
          ],
          "passthrough": [
            "RFC3323_SESSION",
            "RFC7044_HISTORY"
          ],
          "enforce": ["RFC3323_USER"]
        },
        "rewriteTableIncoming": [{
          "applyToDestinationDialString": true,
          "displayName": "test",
          "addSuffix": "3",
          "matchTags": {
            "tagSet": [
              "userIp",
              "userPhone"
            ],
            "type": "xor"
          },
          "index": 0,
          "deleteTrailingCharacters": 2,
          "deleteLeadingCharacters": 1,
          "wildcardPattern": "0123456789+\\+!?X.[]",
          "clearDisplayName": false,
          "rewriteType": "wildcardPattern",
          "skipRulesBelow": false,
          "skipFurtherRules": false,
          "comment": "Wildcard Pattern Rewrite",
          "tagRewrite": {
            "operations": [
              {
                "tag": "userIp",
                "type": "keep"
              },
              {
                "tag": "userPhone",
                "type": "delete"
              }
            ],
            "clearTags": false
          },
          "case": "casefold",
          "addPrefix": "2"
        }]
      }
    }
  }]
}

19.2 Remove Directory

DELETE https://<HOST>:<PORT>/api/directories/remove?version=0

Deletes a directory from the current configuration.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request parameters

  • force

    Deletes the object from the configuration even it is referenced elsewhere.

Request Body Structure

The request body must contain the identifier of the directory that should be deleted.

Example

DELETE http://127.0.0.1:8111/api/directories/remove?force=true&version=0
HTTP Request Body
442f1a38-52de-412c-a0fc-70f261cb12f7
HTTP Response
HTTP/1.1 200 OK

19.3 Add Static User Directory

PUT https://<HOST>:<PORT>/api/directories/staticUserDirectories/add?version=0

Creates a new static user directory.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request Body Structure

The request body is structured as StaticUserDirectory JSON object. A description for its fields is at section 27.33.1. For the JSON schema refer to section 27.33.2.

Response Body Structure

The response body is structured as DirectoryInfo JSON object. A description for its fields is at section 27.32.1. For the JSON schema refer to section 27.32.2.

Example

PUT http://127.0.0.1:8111/api/directories/staticUserDirectories/add?version=0
HTTP Request Body
{
  "displayName": "Test Static User Directory",
  "userRecords": [{
    "displayName": "Test User",
    "applicationRecords": {
      "associatedProvisioningDevices": [{
        "subId": "asd",
        "aorUserName": "asd",
        "staticVariables": {"test": "value"},
        "deviceId": "00-B0-D0-63-C2-26"
      }],
      "webrtc": {
        "address": {
          "tagSet": ["userPhone"],
          "displayName": "qwe",
          "dialString": "123"
        },
        "credentials": {
          "password": "webrtcPw",
          "username": "webrtcUser"
        }
      },
      "sipCredentials": {
        "password": "asd",
        "username": "qwe"
      },
      "sipRegistrar": {
        "dialStrings": [{
          "addresses": [
            {"dialString": "123"},
            {"dialString": "456"}
          ],
          "aorMatch": {
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          },
          "matches": [{
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          }]
        }],
        "failover": {
          "statusCodes": "486,501-503",
          "groupIdentifier": "93134fe9-8eff-4313-a5fe-e8513d21f043"
        }
      },
      "policy": {
        "rewriteTableOutgoing": [{
          "applyToDestinationDialString": true,
          "displayName": "test",
          "addSuffix": "3",
          "matchTags": {
            "tagSet": [
              "userIp",
              "userPhone"
            ],
            "type": "xor"
          },
          "index": 0,
          "deleteTrailingCharacters": 2,
          "deleteLeadingCharacters": 1,
          "wildcardPattern": "0123456789+\\+!?X.[]",
          "clearDisplayName": false,
          "rewriteType": "wildcardPattern",
          "skipRulesBelow": false,
          "skipFurtherRules": false,
          "comment": "Wildcard Pattern Rewrite Outgoing",
          "tagRewrite": {
            "operations": [
              {
                "tag": "userIp",
                "type": "keep"
              },
              {
                "tag": "userPhone",
                "type": "delete"
              }
            ],
            "clearTags": false
          },
          "applyToSourceDialString": false,
          "applyToAllDialStrings": false,
          "case": "casefold",
          "addPrefix": "2"
        }],
        "sippgIncoming": {
          "include": [
            "RFC3323_SESSION",
            "RFC3325_ID",
            "RFC7044_HISTORY"
          ],
          "permit": [
            "RFC3323_SESSION",
            "RFC3323_USER",
            "RFC3325_ID"
          ],
          "passthrough": [
            "RFC3323_SESSION",
            "RFC3323_USER",
            "RFC7044_HISTORY"
          ],
          "enforce": [
            "RFC3323_USER",
            "RFC3325_ID",
            "RFC7044_HISTORY"
          ]
        },
        "sippgOutgoing": {
          "include": [
            "RFC3325_ID",
            "RFC7044_HISTORY"
          ],
          "permit": [
            "RFC3323_SESSION",
            "RFC3323_USER"
          ],
          "passthrough": [
            "RFC3323_SESSION",
            "RFC7044_HISTORY"
          ],
          "enforce": ["RFC3323_USER"]
        },
        "rewriteTableIncoming": [{
          "applyToDestinationDialString": true,
          "displayName": "test",
          "addSuffix": "3",
          "matchTags": {
            "tagSet": [
              "userIp",
              "userPhone"
            ],
            "type": "xor"
          },
          "index": 0,
          "deleteTrailingCharacters": 2,
          "deleteLeadingCharacters": 1,
          "wildcardPattern": "0123456789+\\+!?X.[]",
          "clearDisplayName": false,
          "rewriteType": "wildcardPattern",
          "skipRulesBelow": false,
          "skipFurtherRules": false,
          "comment": "Wildcard Pattern Rewrite",
          "tagRewrite": {
            "operations": [
              {
                "tag": "userIp",
                "type": "keep"
              },
              {
                "tag": "userPhone",
                "type": "delete"
              }
            ],
            "clearTags": false
          },
          "applyToSourceDialString": false,
          "applyToAllDialStrings": false,
          "case": "casefold",
          "addPrefix": "2"
        }]
      }
    }
  }]
}
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
{
  "displayName": "Test Static User Directory",
  "id": "edadc2e6-9da2-411d-ac0f-17c8dc65dd52",
  "directoryType": "STATIC_USER_DIRECTORY",
  "userRecords": [{
    "displayName": "Test User",
    "applicationRecords": {
      "associatedProvisioningDevices": [{
        "subId": "asd",
        "aorUserName": "asd",
        "staticVariables": {"test": "value"},
        "deviceId": "00b0d063c226"
      }],
      "webrtc": {
        "address": {
          "tagSet": ["userPhone"],
          "displayName": "qwe",
          "dialString": "123"
        },
        "credentials": {
          "passwordBase64": "d2VicnRjUHc=",
          "username": "webrtcUser"
        }
      },
      "sipCredentials": {"username": "qwe"},
      "sipRegistrar": {
        "dialStrings": [{
          "addresses": [
            {
              "tagSet": "",
              "dialString": "123"
            },
            {
              "tagSet": "",
              "dialString": "456"
            }
          ],
          "aorMatch": {
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          },
          "matches": [{
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          }]
        }],
        "failover": {
          "statusCodes": "486,501-503",
          "groupIdentifier": "93134fe9-8eff-4313-a5fe-e8513d21f043"
        }
      },
      "policy": {
        "rewriteTableOutgoing": [{
          "applyToDestinationDialString": true,
          "displayName": "test",
          "addSuffix": "3",
          "matchTags": {
            "tagSet": [
              "userIp",
              "userPhone"
            ],
            "type": "xor"
          },
          "index": 0,
          "deleteTrailingCharacters": 2,
          "deleteLeadingCharacters": 1,
          "wildcardPattern": "0123456789+\\+!?X.[]",
          "clearDisplayName": false,
          "rewriteType": "wildcardPattern",
          "skipRulesBelow": false,
          "skipFurtherRules": false,
          "comment": "Wildcard Pattern Rewrite Outgoing",
          "tagRewrite": {
            "operations": [
              {
                "tag": "userIp",
                "type": "keep"
              },
              {
                "tag": "userPhone",
                "type": "delete"
              }
            ],
            "clearTags": false
          },
          "case": "casefold",
          "addPrefix": "2"
        }],
        "sippgIncoming": {
          "include": [
            "RFC3323_SESSION",
            "RFC3325_ID",
            "RFC7044_HISTORY"
          ],
          "permit": [
            "RFC3323_USER",
            "RFC3323_SESSION",
            "RFC3325_ID"
          ],
          "passthrough": [
            "RFC3323_USER",
            "RFC3323_SESSION",
            "RFC7044_HISTORY"
          ],
          "enforce": [
            "RFC3323_USER",
            "RFC3325_ID",
            "RFC7044_HISTORY"
          ]
        },
        "sippgOutgoing": {
          "include": [
            "RFC3325_ID",
            "RFC7044_HISTORY"
          ],
          "permit": [
            "RFC3323_USER",
            "RFC3323_SESSION"
          ],
          "passthrough": [
            "RFC3323_SESSION",
            "RFC7044_HISTORY"
          ],
          "enforce": ["RFC3323_USER"]
        },
        "rewriteTableIncoming": [{
          "applyToDestinationDialString": true,
          "displayName": "test",
          "addSuffix": "3",
          "matchTags": {
            "tagSet": [
              "userIp",
              "userPhone"
            ],
            "type": "xor"
          },
          "index": 0,
          "deleteTrailingCharacters": 2,
          "deleteLeadingCharacters": 1,
          "wildcardPattern": "0123456789+\\+!?X.[]",
          "clearDisplayName": false,
          "rewriteType": "wildcardPattern",
          "skipRulesBelow": false,
          "skipFurtherRules": false,
          "comment": "Wildcard Pattern Rewrite",
          "tagRewrite": {
            "operations": [
              {
                "tag": "userIp",
                "type": "keep"
              },
              {
                "tag": "userPhone",
                "type": "delete"
              }
            ],
            "clearTags": false
          },
          "case": "casefold",
          "addPrefix": "2"
        }]
      }
    }
  }]
}

19.4 Set Static User Directory

PUT https://<HOST>:<PORT>/api/directories/staticUserDirectories/set?version=0

Modifies an existing static user directory.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request Body Structure

The request body is structured as StaticUserDirectory JSON object. A description for its fields is at section 27.33.1. For the JSON schema refer to section 27.33.2.

Response Body Structure

The response body is structured as DirectoryInfo JSON object. A description for its fields is at section 27.32.1. For the JSON schema refer to section 27.32.2.

Example

PUT http://127.0.0.1:8111/api/directories/staticUserDirectories/set?id=edadc2e6-9da2-411d-ac0f-17c8dc65dd52&version=0
HTTP Request Body
{
  "displayName": "Test Static User Directory Edited",
  "userRecords": [{
    "displayName": "Test User",
    "applicationRecords": {
      "associatedProvisioningDevices": [{
        "subId": "asd",
        "aorUserName": "asd",
        "staticVariables": {"test": "value"},
        "deviceId": "00-B0-D0-63-C2-26"
      }],
      "webrtc": {
        "address": {
          "tagSet": ["userIp"],
          "displayName": "qwe",
          "dialString": "123"
        },
        "credentials": {
          "password": "webrtcPw",
          "username": "webrtcUser"
        }
      },
      "sipCredentials": {
        "password": "asd",
        "username": "qwe"
      },
      "sipRegistrar": {
        "dialStrings": [{
          "addresses": [
            {"dialString": "123"},
            {"dialString": "456"}
          ],
          "aorMatch": {
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          },
          "matches": [{
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          }]
        }],
        "failover": {
          "statusCodes": "486,501-503",
          "groupIdentifier": "93134fe9-8eff-4313-a5fe-e8513d21f043"
        }
      }
    }
  }]
}
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
{
  "displayName": "Test Static User Directory Edited",
  "id": "edadc2e6-9da2-411d-ac0f-17c8dc65dd52",
  "directoryType": "STATIC_USER_DIRECTORY",
  "userRecords": [{
    "displayName": "Test User",
    "applicationRecords": {
      "associatedProvisioningDevices": [{
        "subId": "asd",
        "aorUserName": "asd",
        "staticVariables": {"test": "value"},
        "deviceId": "00b0d063c226"
      }],
      "webrtc": {
        "address": {
          "tagSet": ["userIp"],
          "displayName": "qwe",
          "dialString": "123"
        },
        "credentials": {
          "passwordBase64": "d2VicnRjUHc=",
          "username": "webrtcUser"
        }
      },
      "sipCredentials": {"username": "qwe"},
      "sipRegistrar": {
        "dialStrings": [{
          "addresses": [
            {
              "tagSet": "",
              "dialString": "123"
            },
            {
              "tagSet": "",
              "dialString": "456"
            }
          ],
          "aorMatch": {
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          },
          "matches": [{
            "plain": {
              "prefix": "123",
              "suffix": "456"
            },
            "type": "PLAIN"
          }]
        }],
        "failover": {
          "statusCodes": "486,501-503",
          "groupIdentifier": "93134fe9-8eff-4313-a5fe-e8513d21f043"
        }
      }
    }
  }]
}

19.5 Set OAuth Client Secret

PUT https://<HOST>:<PORT>/api/directories/azureActiveDirectories/clientSecret/set?version=0

Modifies the OAuth client secret for a selected Azure Active Directory.

Required Permissions

  • API

  • Configuration Mode Read/Write Access

Request parameters

  • directoryId

    The id or display name of the Azure Active Directory which client secret will be modified.

Request Body Structure

The body must contain the new client secrect for the OAuth Client of the directory.

Example

PUT http://127.0.0.1:8111/api/directories/azureActiveDirectories/clientSecret/set?directoryId=7ee6c64a-fca4-4f6d-a660-eddcf18c26c3&version=0
HTTP Request Body
7ee6c64a-fca4-4f6d-a660-eddcf18c26c3
HTTP Response
HTTP/1.1 200 OK