PbxImpersonation

The PbxImpersonation API allows to use other APIs in behalf of a specified user, with the login of the App Service. It is available for the following APIs:

General structure

{
    "api": "PbxImpersonation",
    "src": string,
    "mt": string
}

api
To address this interface the value "PbxImpersonation" has to be used for the api property
src
The AppWebsocket src mechanism is supported on the interface. So a src property may be used
mt
The message type identifies the requested operation

Operations

CreateApi

This operation allows to create an api property, which can be used to address the target API as the given user. For this the user must be identified with a sip property and the target API with a target property.

Request message

{
    "api": "PbxImpersonation",
    "src": string,
    "mt": "CreateApi",
    "sip": string,
    "target": string
}

sip
The name of the user object on which behalf the target API shall be used
target
The target api. E.g. "PbxApi"

Result message

{
    "api": "PbxImpersonation",
    "src": string,
    "mt": "CreateApiResult",
    "target": string
}

target
The value to be used as api property for message to the target API

DeleteApi

This operation allows to delete an api property, that was previously created with the CreateApi operation.

Request message

{
    "api": "PbxImpersonation",
    "src": string,
    "mt": "DeleteApi",
    "target": string
}

target
The target api. E.g. "PbxApi.0"

Result message

{
    "api": "PbxImpersonation",
    "src": string,
    "mt": "DeleteApiResult",
    "ok": bool
}

ok
True, if the specified target was found and the api property has been deleted.