Zum Inhalt

“auditLine” Resource Type#

Represents an audit line 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 auditLine auditLine Gets an auditLine object.
DELETE auditLine none Deletes an auditLine object.
POST auditLine auditLine Creates an auditLine object.
PATCH auditLine auditLine Updates an existing auditLine object.
Navigation Return Type Description
audit audit Gets the audit associated with the current audit line.

Properties#

Property Type Description
id Guid The unique ID of the audit line. Non-editable.
auditNo String Specifies the number of the associated audit.
lineNo Int32 Specifies the number of the current line.
auditQuestionCode String Specifies the code of the question used for this audit line.
description String Specifies the description of the question used for this audit line.
assessmentNumber Decimal Specifies the audit result of the current line.
comment String Specifies a short comment with a maximum length of 100 characters for the current line.
handlingInstructions String Specifies the instructions used for the current line. Non-editable. This field is read-only!
auditNote String Specifies the notes on the current audit line that were entered by the auditor.
photoB64 String Specifies the photo to be saved for the current audit line as a Base64-encoded string.
photoMimeType String Specifies the Mime type of the photo. Examples are "image/bmp", "image/jpeg", "image/gif",...
sketchB64 String Specifies the drawing to be saved for the current audit line as a Base64-encoded string.
sketchMimeType String Specifies the Mime type of the drawing. Examples are "image/bmp", "image/jpeg", "image/gif",...
videoB64 String Specifies the video to be saved for the current audit line as a Base64-encoded string.
videoMimeType String Specifies the Mime type of the video. Examples are "video/mp4", "video/x-msvideo",...
audioB64 String Specifies the audio file to be saved for the current audit line as a Base64-encoded string.
audioMimeType String Specifies the Mime type of the audio file. Examples are "audio/mpeg", "audio/x-wav",...
documentB64 String Specifies the document to be saved for the current audit line as a Base64-encoded string.
documentMimeType String Specifies the Mime type of the document. Examples are "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/pdf,...

JSON Representation#

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

{
    "id": "GUID",
    "auditNo": "string",
    "lineNo": "int",
    "auditQuestionCode": "string",
    "description": "string",
    "assessmentNumber": "decimal",
    "comment": "string",
    "handlingInstructions": "string",
    "auditNote": "string"
}

HTTP Requests#

Get auditLines#

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})/auditLines({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})/auditLines({id})

Response The following code shows an example of the response.

{
    "@odata.context": "https://{businesscentralPrefix}/api/kumavision/kvsvrm/v1.0/companies({id})/auditLines",
    "value": [
        {
            "@odata.etag": "W/\"JzE5OzcyOTU1OTg5NDg1NTU1MDE1OTYxOzAwOyc=\"",
            "id": "142b512a-71ac-ed11-9eb2-c7df0d0ebfab",
            "auditNo": "A000002",
            "lineNo": 10000,
            "auditQuestionCode": "AS",
            "description": "Is occupational health and safety observed?",
            "assessmentNumber": 0,
            "comment": "",
            "handlingInstructions": "",
            "auditNote": "",
            "photoB64": "",
            "photoMimeType": "",
            "sketchB64": "",
            "sketchMimeType": "",
            "videoB64": "",
            "videoMimeType": "",
            "audioB64": "",
            "audioMimeType": "",
            "documentB64": "",
            "documentMimeType": ""
        },
        {
            "@odata.etag": "W/\"JzE5OzY2MjcwMDI1NjQwMjc2ODg2NjQxOzAwOyc=\"",
            "id": "152b512a-71ac-ed11-9eb2-c7df0d0ebfab",
            "auditNo": "A000002",
            "lineNo": 20000,
            "auditQuestionCode": "DS",
            "description": "Are the privacy policies followed?",
            "assessmentNumber": 0,
            "comment": "",
            "handlingInstructions": "",
            "auditNote": "",
            "photoB64": "",
            "photoMimeType": "",
            "sketchB64": "",
            "sketchMimeType": "",
            "videoB64": "",
            "videoMimeType": "",
            "audioB64": "",
            "audioMimeType": "",
            "documentB64": "",
            "documentMimeType": ""
        },
        {
            "@odata.etag": "W/\"JzIwOzEwNzk1MjQwOTQ4NDI4NDUzNTUzMTswMDsn\"",
            "id": "162b512a-71ac-ed11-9eb2-c7df0d0ebfab",
            "auditNo": "A000002",
            "lineNo": 30000,
            "auditQuestionCode": "ISO",
            "description": "Is ISO certification available?",
            "assessmentNumber": 0,
            "comment": "",
            "handlingInstructions": "",
            "auditNote": "",
            "photoB64": "",
            "photoMimeType": "",
            "sketchB64": "",
            "sketchMimeType": "",
            "videoB64": "",
            "videoMimeType": "",
            "audioB64": "",
            "audioMimeType": "",
            "documentB64": "",
            "documentMimeType": ""
        }
    ]
}

Delete auditLines#

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})/auditLines({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})/auditLines({id})

Response

The following code shows an example of the response.

HTTP/1.1 204 No Content

Create auditLines#

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})/auditLines({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 auditLine object.

Response#

If successful, this method returns the 201 Created response code and an auditLine 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})/auditLines
Content-type: application/json
{
    "auditNo": "A000003",
    "lineNo": 40000,
    "auditQuestionCode": "",
    "description": "Is a test question available?",
    "assessmentNumber": 10,
    "comment": "No. Not for testing",
    "auditNote": "",
    "photoB64": "",
    "photoMimeType": "",
    "sketchB64": "",
    "sketchMimeType": "",
    "videoB64": "",
    "videoMimeType": "",
    "audioB64": "",
    "audioMimeType": "",
    "documentB64": "",
    "documentMimeType": ""
}

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}})/auditLines/$entity",
    "@odata.etag": "W/\"JzE5OzU3MDk5MzQ4MjAzOTU4OTg4ODkxOzAwOyc=\"",
    "id": "285a4ef0-77ac-ed11-9eb2-c7df0d0ebfab",
    "auditNo": "A000003",
    "lineNo": 40000,
    "auditQuestionCode": "",
    "description": "Is a test question available?",
    "assessmentNumber": 10,
    "comment": "No. Not for testing",
    "handlingInstructions": "",
    "auditNote": "",
    "photoB64": "",
    "photoMimeType": "",
    "sketchB64": "",
    "sketchMimeType": "",
    "videoB64": "",
    "videoMimeType": "",
    "audioB64": "",
    "audioMimeType": "",
    "documentB64": "",
    "documentMimeType": ""
}

Update auditLines#

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})/auditLines({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})/auditLines({id})
Content-type: application/json
{
    "assessmentNumber": 50,
    "comment": "No. Not for testing. But 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}})/auditLines/$entity",
    "@odata.etag": "W/\"JzIwOzE3MzY4NTEyODY5OTU3NTc1OTUyMTswMDsn\"",
    "id": "285a4ef0-77ac-ed11-9eb2-c7df0d0ebfab",
    "auditNo": "A000003",
    "lineNo": 40000,
    "auditQuestionCode": "",
    "description": "Is a test question available?",
    "assessmentNumber": 50,
    "comment": "No. Not for testing. But planned.",
    "handlingInstructions": "",
    "auditNote": "",
    "photoB64": "",
    "photoMimeType": "",
    "sketchB64": "",
    "sketchMimeType": "",
    "videoB64": "",
    "videoMimeType": "",
    "audioB64": "",
    "audioMimeType": "",
    "documentB64": "",
    "documentMimeType": ""
}