Create Customer from Lead with Tenant Id

This request enables you to create a new customer from a lead by creating a link between Live Platform portal database and the OnlinePstnGateway (AudioCodes SBC device configured to connect calls between PSTN trunk and Microsoft Teams) using the customer's Microsoft Azure tenant Id.

URI

Copy
{{baseUrl}}/api/v3/customer

HTTP Method

POST

Request Body

Parameter

Type

Description

ConfigurationName

string

OcEssential_TENANT_TYPE: The new customer is created based on the customer's Azure tenant subscription Id. A link is established with the Live Cloud server (OVOC) using this tenant Id.

shortName

string

Short customer name, complying with validation rules for customer name:

The string should be 3-15 characters long
The following characters cannot be used: \ / : * ? " < > |audit
Can contain letters (lower/UPPER case), Numbers and special characters are allowed, however cannot contain the dot (.) or blank spaces.
Unique name per M365 Tenant

CustomerFulName

string

Generally the company name, however, any value can be used.

msTenantID

string

The Microsoft Azure subscription Tenant Id of the customer lead.

Example Request Body

Copy
{
  "configurationName": "OcEssential_TENANT_TYPE",
  "customerShortName": "SIPTest",
  "customerFullName": "SIPTest",
  "msTenantID": "f94238e5-4f2c-4e1b-8125-2d27122ca75f"
}

Example Response

The initial response displays the Task Id.

Parameter

 

Type

Description

Task Id

string

The queued task Id that is generated for this action. You must run the Task request to retrieve the status of the action. See Task Status. Note that the wst string in the prefix is unique for this endpoint.

Copy
{
"jobId": "wst_80b54f45-6643-4fdf-960a-638c18edb787"
}

The execution of the request may take a few minutes. The status will progress from 'In Progress' to 'Completed Success'.

Copy
{
    "id": "wst_a597fe86-1e86-45d1-8dcf-cbdc6029c06b",
    "status": "CompletedSuccess",
    "details": [
        "Converted"
    ],
    "executionMessages": [
        {
            "level": "Information",
            "message": "Site created in Ovoc"
        }
    ],
    "outputData": {
        "umpCustomerGuid": "da68eafc-d3c6-4d3b-9a10-c48b26c6086b"
    },
    "createTime": "0001-01-01T00:00:00"
}

HTTP Responses

200 OK

Parameter

Type

Description

id

string

Task Id

status

string

One of the following values:

In Progress
Completed Success
Completed Failed

details

string

One of the following values:

Converted

executionMessages

list array

List array including the following parameters:

level
message

level

string

One of the following values:

Information
Error

message

string

The following Request body includes a customer ShortName containing more than 15 characters:
Copy
{
  "configurationName": "OcEssential_TENANT_TYPE",
  "customerShortName": "SIPTest412345567",
  "customerFullName": "SIPTest412345567",
  "msTenantID": "f79a7f93-5ef7-47d2-92c8-e4570503cec3"
}
As a result, the following error is displayed in the output of the Get Task Id request):
Copy
{
    "id": "wst_e05e70f6-a531-4e78-920f-d30daefe5dc4",
    "status": "CompletedFailed",
    "details": [
        "Failed"
    ],
    "executionMessages": [
        {
            "level": "Error",
            "message": "'Customer Short Name' must be between 3 and 15 characters."
        }
    ],
    "outputData": {
        "umpCustomerGuid": null
    },
    "createTime": "0001-01-01T00:00:00"
}
The following Request body includes an invalid character "-":
Copy
{
  "configurationName": "OcEssential_TENANT_TYPE",
  "customerShortName": "SIPTest4-",
  "customerFullName": "SIPTest4-",
  "msTenantID": "f79a7f93-5ef7-47d2-92c8-e4570503cec3"
}
As a result, the following error is displayed in the output of the Get Task Id request:
Copy
{
    "id": "wst_ef66e214-bb36-4f75-b51a-ed9fc779ea42",
    "status": "CompletedFailed",
    "details": [
        "Failed"
    ],
    "executionMessages": [
        {
            "level": "Error",
            "message": "Customer Short Name contains invalid characters. Allowed characters: letters, numbers and '_'."
        },
        {
            "level": "Error",
            "message": "Customer Full Name contains invalid characters. Allowed characters: letters, numbers, _, ' and space."
        }
    ],
    "outputData": {
        "umpCustomerGuid": null
    },
    "createTime": "0001-01-01T00:00:00"
}

The following error is displayed when there is no active lead:

Copy
{
    "id": "wst_cff0a251-1130-4f6d-a652-a170487bff2e",
    "status": "CompletedFailed",
    "details": [
        "Failed"
    ],
    "executionMessages": [
        {
            "level": "Error",
            "message": "Cannot find lead for the suplied msTenantId"
        }
    ],
    "outputData": {
        "umpCustomerGuid": null
    },
    "createTime": "0001-01-01T00:00:00"
}

The following error is displayed when a customer has already been created for the tenant:

Copy
{
    "id": "wst_943e74e2-df78-483f-ad5a-3af975002fdb",
    "status": "CompletedFailed",
    "details": [
        "Failed"
    ],
    "executionMessages": [
        {
            "level": "Error",
            "message": "Customer Short Name already exists"
        },
        {
            "level": "Error",
            "message": "CustomerFullName already exists"
        }
    ],
    "outputData": {
        "umpCustomerGuid": null
    },
    "createTime": "0001-01-01T00:00:00"
}

umpCustomerGuid

string($uuid)

This id is created in the Live Platform database for the customer tenant when a Live Platform license is applied. If this field is null, a license has not yet been applied to the lead.

This value is also obtained in the 'Get Task' response when the customer is created.

outputData

list array

Additional information.