20 Directories

20.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 30.38.1. For the JSON schema refer to section 30.38.2.

Example

GET http://127.0.0.1:8888/api/directories/get?id=b91a45a6-bd5e-47b9-9e99-46226992e669&version=0
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
{
  "displayName": "Test Static User Directory",
  "id": "b91a45a6-bd5e-47b9-9e99-46226992e669",
  "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"
        }]
      }
    }
  }]
}

20.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:8888/api/directories/remove?force=true&version=0
HTTP Request Body
b91a45a6-bd5e-47b9-9e99-46226992e669
HTTP Response
HTTP/1.1 200 OK

20.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 30.39.1. For the JSON schema refer to section 30.39.2.

Response Body Structure

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

Example

PUT http://127.0.0.1:8888/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": null,
          "skipFurtherRules": false,
          "comment": "Wildcard Pattern Rewrite Outgoing",
          "tagRewrite": {
            "operations": [
              {
                "tag": "userIp",
                "type": "keep"
              },
              {
                "tag": "userPhone",
                "type": "delete"
              }
            ],
            "clearTags": false
          },
          "applyToSourceDialString": null,
          "applyToAllDialStrings": null,
          "addExtTrailingDigits": 0,
          "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": null,
          "skipFurtherRules": false,
          "comment": "Wildcard Pattern Rewrite",
          "tagRewrite": {
            "operations": [
              {
                "tag": "userIp",
                "type": "keep"
              },
              {
                "tag": "userPhone",
                "type": "delete"
              }
            ],
            "clearTags": false
          },
          "applyToSourceDialString": null,
          "applyToAllDialStrings": null,
          "addExtTrailingDigits": 0,
          "case": "casefold",
          "addPrefix": "2"
        }]
      }
    }
  }]
}
HTTP Response
HTTP/1.1 200 OK
HTTP Response Body
{
  "displayName": "Test Static User Directory",
  "id": "b91a45a6-bd5e-47b9-9e99-46226992e669",
  "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"
        }]
      }
    }
  }]
}

20.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 30.39.1. For the JSON schema refer to section 30.39.2.

Response Body Structure

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

Example

PUT http://127.0.0.1:8888/api/directories/staticUserDirectories/set?id=b91a45a6-bd5e-47b9-9e99-46226992e669&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": "b91a45a6-bd5e-47b9-9e99-46226992e669",
  "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"
        }
      }
    }
  }]
}

20.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://localhost:8088/api/directories/azureActiveDirectories/clientSecret/set?directoryId=1c2eba44-9841-4c9a-9d00-1f81624721a2&version=0
HTTP Request Body
3.a8ayM..gZh3OCCVj-GZEijiJj8uXV1-0
HTTP Response
HTTP/1.1 200 OK