Skip to content

“audit” Resource Type#

Represents an audit as part of Vendor Rating Management in Business Central.

Note

For information about enabling APIs for Business Central, please refer to Enabling APIs for Dynamics 365 Business Central.

Methods#

Method Return Type Description
GET audit audit Gets an audit object.
DELETE audit none Deletes an audit object.
POST audit audit Creates an audit object.
PATCH audit audit Updates an existing audit object.
Navigation Return Type Description
auditTemplate auditTemplate Gets the audit template associated with the current audit.
auditLines auditLines Gets the set of audit lines associated with the current audit.

Properties#

Property Type Description
id Guid The unique ID of the audit. Non-editable.
no String Specifies the unique number of the audit.
description String Specifies the description of the audit.
vendorNo String Specifies the number of the vendor this audit was conducted for.
auditDirector String Specifies the code of the user responsible for this audit.
auditDate Date Specifies the date when the audit was processed.
auditStatus NAV.KVSVRMAuditHeaderStatus Specifies the status of the audit. Possible values: "New", "Planned", "In Progress", or "Completed".
completedAt Date Specifies the date when the audit was completed.
completedBy String Specifies the user who completed the audit.
achievedAssessmentNumber Decimal Specifies the points scored in the audit.
maxAchievableAssessmentNo Decimal Specifies the possible maximum score that could be achieved in the audit.
templateNo String Specifies the code of the audit template that was used for the current audit.
newAuditStatus NAV.KVSVRMAuditHeaderStatus Specifies the new status of the audit. Possible values: "New", "Planned", "In Progress", or "Completed".

JSON Representation#

The following code shows a JSON representation of the audit resource.

{
    "id": "GUID",
    "no": "string",
    "description": "string",
    "vendorNo": "string",
    "auditDirector": "string",
    "auditDate": "date",
    "auditStatus": "string",
    "completedAt": "date",
    "completedBy": "string",
    "achievedAssessmentNumber": "decimal",
    "maxAchievableAssessmentNo": "decimal",
    "templateNo": "string",
    "newAuditStatus": "string"
}

HTTP Requests#

Get audits#

Retrieves the properties and relationships of an audit object for Business Central.

HTTP Request#

Replace the URL prefix for Business Central depending on your environment, following the guideline.

GET businesscentralPrefix/kumavision/kvsvrm/v1.0/companies({id})/audits({id})

Request Headers#

Header Value
Authorization Bearer {token}. Required.

Request Body#

For this method, no request body is required.

Response#

If successful, this method returns the 200 OK response code and an audit object in the response body.

Example#

Request

The following code shows an example of the request.

GET https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/audits({id})

Response The following code shows an example of the response.

{
    "@odata.context": "https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/audits",
    "value": [
        {
            "@odata.etag": "W/\"JzE4OzcwNjQyMDUxOTcyNjAwMjU3NDE7MDA7Jw==\"",
            "id": "d9d1ad17-71ac-ed11-9eb2-c7df0d0ebfab",
            "no": "A000001",
            "description": "Healthstate Audit",
            "vendorNo": "10000",
            "auditDirector": "KUMA",
            "auditDate": "2024-01-25",
            "auditStatus": "New",
            "completedAt": "0001-01-01",
            "completedBy": "",
            "achievedAssessmentNumber": 0,
            "maxAchievableAssessmentNo": 100,
            "templateNo": "",
            "newAuditStatus": "New"
        },
        {
            "@odata.etag": "W/\"JzE5OzcwMzYyMTE1OTAyNjcwMjc0MjIxOzAwOyc=\"",
            "id": "132b512a-71ac-ed11-9eb2-c7df0d0ebfab",
            "no": "A000002",
            "description": "Classification Audit",
            "vendorNo": "10000",
            "auditDirector": "KUMA",
            "auditDate": "2024-01-25",
            "auditStatus": "Planned",
            "completedAt": "0001-01-01",
            "completedBy": "",
            "achievedAssessmentNumber": 0,
            "maxAchievableAssessmentNo": 100,
            "templateNo": "A01",
            "newAuditStatus": "New"
        },
        {
            "@odata.etag": "W/\"JzE5OzQ3NzkzNDk0NzQyOTI1NjA4NDgxOzAwOyc=\"",
            "id": "7fbe4649-71ac-ed11-9eb2-c7df0d0ebfab",
            "no": "A000003",
            "description": "Classification Audit",
            "vendorNo": "21201992",
            "auditDirector": "KUMA",
            "auditDate": "2024-01-25",
            "auditStatus": "Planned",
            "completedAt": "0001-01-01",
            "completedBy": "",
            "achievedAssessmentNumber": 0,
            "maxAchievableAssessmentNo": 100,
            "templateNo": "A01",
            "newAuditStatus": "New"
        }
    ]
}

Delete audits#

Deletes an audit from Business Central.

HTTP Request#

Replace the URL prefix for Business Central depending on your environment, following the guideline.

DELETE businesscentralPrefix/kumavision/kvsvrm/v1.0/companies({id})/audits({id})

Request Headers#

Header Value
Authorization Bearer {token}. Required.
If-Match Required. If this request header is included and the eTag provided does not match the current tag of the audit, the audit will not be updated.

Request Body#

For this method, no request body is required.

Response#

If successful, this method returns the 204 No Content response code and deletes the audit. Nothing will be returned in the response body.

Example#

Request

The following code shows an example of the request.

DELETE https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/audits({id})

Response

The following code shows an example of the response.

HTTP/1.1 204 No Content

Create audits#

Creates an audit in Business Central.

HTTP Request#

Replace the URL prefix for Business Central depending on your environment, following the guideline.

POST businesscentralPrefix/kumavision/kvsvrm/v1.0/companies({id})/audits({id})

Request Headers#

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json
If-Match Required. If this request header is included and the eTag provided does not match the current tag of the audit, the audit will not be updated.

Request Body#

In the request body, supply a JSON representation of an audit object.

Response#

If successful, this method returns the 201 Created response code and an audit object in the response body.

Example#

Request

The following code shows an example of the request.

POST https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/audits
Content-type: application/json
{
    "description": "Test Audit",
    "vendorNo": "10000",
    "auditDirector": "KUMA",
    "auditDate": "2023-05-12",
    "auditStatus": "New",
    "completedAt": "0001-01-01",
    "completedBy": "",
    "achievedAssessmentNumber": 0,
    "maxAchievableAssessmentNo": 100,
    "templateNo": "A01",
    "newAuditStatus": "New"
}

Response The following code shows an example of the response.

HTTP/1.1 201 Created
Content-type: application/json
{
    "@odata.context": "https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/$metadata#companies({id}})/audits/$entity",
    "@odata.etag": "W/\"JzE5OzM2NDI2MTg4MzEwMTMxMjMxNzYxOzAwOyc=\"",
    "id": "3f5803f5-71ac-ed11-9eb2-c7df0d0ebfab",
    "no": "A000004",
    "description": "Test Audit",
    "vendorNo": "10000",
    "auditDirector": "KUMA",
    "auditDate": "2023-02-14",
    "auditStatus": "New",
    "completedAt": "0001-01-01",
    "completedBy": "",
    "achievedAssessmentNumber": 0,
    "maxAchievableAssessmentNo": 100,
    "templateNo": "A01",
    "newAuditStatus": "New"
}

Update audits#

Updates the properties of an audit object for Business Central.

HTTP Request#

Replace the URL prefix for Business Central depending on your environment, following the guideline.

PATCH businesscentralPrefix/kumavision/kvsvrm/v1.0/companies({id})/audits({id})

Request Headers#

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json
If-Match Required. If this request header is included and the eTag provided does not match the current tag of the audit, the audit will not be updated.

Request Body#

In the request body, supply the values for the fields to be updated. Existing properties that are not included in the request body will maintain their previous values or will be recalculated based on the changes made to other property values. For optimum performance, do not include existing values that have not changed.

Response#

If successful, this method returns the 200 OK response code and an updated audit object in the response body.

Example#

Request

The following code shows an example of the request.

PATCH https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/audits({id})
Content-type: application/json
{
    "description": "Test Audit by KUMA",
    "auditDate": "2023-06-01",
    "newAuditStatus": "Planned"
}

Response The following code shows an example of the response.

HTTP/1.1 200 OK
Content-type: application/json
{
    "@odata.context": "https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/$metadata#companies({id}})/audits/$entity",
    "@odata.etag": "W/\"JzE2OzI0ODM5MzAwMDc2OTM1MTExOzAwOyc=\"",
    "id": "3f5803f5-71ac-ed11-9eb2-c7df0d0ebfab",
    "no": "A000004",
    "description": "Test Audit by KUMA",
    "vendorNo": "10000",
    "auditDirector": "KUMA",
    "auditDate": "2023-06-01",
    "auditStatus": "Planned",
    "completedAt": "0001-01-01",
    "completedBy": "",
    "achievedAssessmentNumber": 0,
    "maxAchievableAssessmentNo": 100,
    "templateNo": "A01",
    "newAuditStatus": "Planned"
}